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.
- package/Dockerfile +1 -3
- package/Jenkinsfile +5 -20
- package/dist/components/BmSelector/BmSelector.js +4 -31
- package/dist/components/BmSelector/BmSelector.stories.js +1 -14
- package/dist/components/Card_v2/Card.js +3 -17
- package/dist/components/InfoPanel/InfoPanel.js +21 -72
- package/dist/components/InfoPanel/InfoPanel.stories.js +4 -56
- package/dist/components/ProgressIndicator/ProgressIndicator.js +3 -17
- package/dist/components/SelectionNotice/SelectionNotice.js +3 -17
- package/dist/components/globalStyles.js +1 -1
- package/dist/components/index.js +0 -14
- package/dist/components/text.js +10 -11
- package/dist/components/typography.js +2 -3
- package/nginx.conf +12 -26
- package/package.json +1 -1
- package/public/index.html +0 -1
- package/src/App.js +65 -128
- package/src/fonts.scss +0 -6
- package/src/lib/components/BmSelector/BmSelector.js +2 -34
- package/src/lib/components/BmSelector/BmSelector.stories.jsx +0 -10
- package/src/lib/components/Card_v2/Card.js +1 -39
- package/src/lib/components/InfoPanel/InfoPanel.js +12 -55
- package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +2 -42
- package/src/lib/components/ProgressIndicator/ProgressIndicator.js +1 -19
- package/src/lib/components/SelectionNotice/SelectionNotice.js +1 -19
- package/src/lib/components/globalStyles.js +1 -2
- package/src/lib/components/index.js +0 -4
- package/src/lib/components/text.js +11 -17
- package/src/lib/components/typography.js +0 -1
- package/dist/components/Alert/Alert.js +0 -83
- package/dist/components/Alert/Alert.stories.js +0 -66
- package/dist/components/BmCustomCardTitle/CustomCardTitle.js +0 -174
- package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +0 -85
- 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/lib/components/Alert/Alert.js +0 -111
- package/src/lib/components/Alert/Alert.stories.jsx +0 -66
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +0 -142
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +0 -83
|
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
|
|
@@ -1,111 +0,0 @@
|
|
|
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 AlertWrapper = styled.div`
|
|
25
|
-
border: 1px solid ${({ themeColor }) => hexToRgba(themeColor, 0.2)};
|
|
26
|
-
background-color: ${({ themeColor }) => hexToRgba(themeColor, 0.05)};
|
|
27
|
-
border-radius: 0.5rem;
|
|
28
|
-
padding: 0.75rem;
|
|
29
|
-
|
|
30
|
-
@media (min-width: 640px) {
|
|
31
|
-
padding: 1rem;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const Content = styled.div`
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: flex-start;
|
|
38
|
-
gap: 0.75rem;
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
const IconContainer = styled.div`
|
|
42
|
-
background-color: ${({ themeColor }) => hexToRgba(themeColor, 0.1)};
|
|
43
|
-
border-radius: 9999px;
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
width: 2rem;
|
|
48
|
-
height: 2rem;
|
|
49
|
-
margin-top: 0.125rem;
|
|
50
|
-
|
|
51
|
-
@media (min-width: 640px) {
|
|
52
|
-
width: 2.1rem;
|
|
53
|
-
height: 2.1rem;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
svg {
|
|
57
|
-
width: 1rem;
|
|
58
|
-
height: 1rem;
|
|
59
|
-
color: ${({ themeColor }) => themeColor};
|
|
60
|
-
|
|
61
|
-
@media (min-width: 640px) {
|
|
62
|
-
width: 1.25rem;
|
|
63
|
-
height: 1.25rem;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
const TextContent = styled.div`
|
|
69
|
-
flex: 1;
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
const Title = styled.h3`
|
|
73
|
-
font-weight: 500;
|
|
74
|
-
color: ${({ themeColor }) => themeColor};
|
|
75
|
-
font-size: 0.875rem;
|
|
76
|
-
margin-bottom: 0.25rem;
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
const Description = styled.p`
|
|
80
|
-
color: #6b7280;
|
|
81
|
-
font-size: 0.75rem;
|
|
82
|
-
|
|
83
|
-
@media (min-width: 640px) {
|
|
84
|
-
font-size: 0.875rem;
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
const BmAlertBox = ({
|
|
89
|
-
icon: Icon,
|
|
90
|
-
themeColor = '#EF4444',
|
|
91
|
-
title,
|
|
92
|
-
description,
|
|
93
|
-
}) => {
|
|
94
|
-
return (
|
|
95
|
-
<AlertWrapper themeColor={themeColor}>
|
|
96
|
-
<Content>
|
|
97
|
-
{Icon && (
|
|
98
|
-
<IconContainer themeColor={themeColor}>
|
|
99
|
-
<Icon />
|
|
100
|
-
</IconContainer>
|
|
101
|
-
)}
|
|
102
|
-
<TextContent>
|
|
103
|
-
<Title themeColor={themeColor}>{title}</Title>
|
|
104
|
-
<Description>{description}</Description>
|
|
105
|
-
</TextContent>
|
|
106
|
-
</Content>
|
|
107
|
-
</AlertWrapper>
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export default BmAlertBox;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
3
|
-
import PersonIcon from '@mui/icons-material/Person';
|
|
4
|
-
import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
|
|
5
|
-
import BmAlertBox from './Alert';
|
|
6
|
-
|
|
7
|
-
const iconOptions = {
|
|
8
|
-
AccessTimeIcon,
|
|
9
|
-
PersonIcon,
|
|
10
|
-
CalendarTodayOutlinedIcon,
|
|
11
|
-
None: null,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = (args) => {
|
|
15
|
-
return (
|
|
16
|
-
<div style={{ maxWidth: 500, margin: '2rem auto' }}>
|
|
17
|
-
<BmAlertBox {...args} />
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Default = Template.bind({});
|
|
23
|
-
Default.args = {
|
|
24
|
-
icon: AccessTimeIcon,
|
|
25
|
-
themeColor: '#EF4444',
|
|
26
|
-
title: 'Submission Failed',
|
|
27
|
-
description:
|
|
28
|
-
'There was an issue processing your request. Please try again later.',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
Default.argTypes = {
|
|
32
|
-
icon: {
|
|
33
|
-
control: {
|
|
34
|
-
type: 'select',
|
|
35
|
-
labels: Object.keys(iconOptions),
|
|
36
|
-
},
|
|
37
|
-
options: Object.keys(iconOptions),
|
|
38
|
-
mapping: iconOptions,
|
|
39
|
-
},
|
|
40
|
-
themeColor: {
|
|
41
|
-
control: 'color',
|
|
42
|
-
},
|
|
43
|
-
title: {
|
|
44
|
-
control: 'text',
|
|
45
|
-
},
|
|
46
|
-
description: {
|
|
47
|
-
control: 'text',
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default {
|
|
52
|
-
title: 'Components/BmAlertBox',
|
|
53
|
-
component: BmAlertBox,
|
|
54
|
-
argTypes: Default.argTypes,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Example = () => {
|
|
58
|
-
return (
|
|
59
|
-
<BmAlertBox
|
|
60
|
-
icon={AccessTimeIcon}
|
|
61
|
-
themeColor="#DC2626"
|
|
62
|
-
title="Payment Error"
|
|
63
|
-
description="We couldn't process your payment. Please try again later or contact support."
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
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 BackgroundStripe = styled.div`
|
|
25
|
-
background-color: ${({ themeColor }) => hexToRgba(themeColor, 0.1)};
|
|
26
|
-
padding-top: ${({ variant }) =>
|
|
27
|
-
variant === 'confirmation' ? '1rem' : '1.5rem'};
|
|
28
|
-
padding-bottom: ${({ variant }) =>
|
|
29
|
-
variant === 'confirmation' ? '1rem' : '2rem'};
|
|
30
|
-
padding-left: 1rem;
|
|
31
|
-
padding-right: 1rem;
|
|
32
|
-
|
|
33
|
-
@media (min-width: 640px) {
|
|
34
|
-
padding-top: ${({ variant }) =>
|
|
35
|
-
variant === 'confirmation' ? '1.5rem' : '2rem'};
|
|
36
|
-
padding-bottom: ${({ variant }) =>
|
|
37
|
-
variant === 'confirmation' ? '1.5rem' : '2.5rem'};
|
|
38
|
-
padding-left: 1.5rem;
|
|
39
|
-
padding-right: 1.5rem;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
const CardContainer = styled.div`
|
|
44
|
-
background-color: ${hexToRgba('#ffffff', 0.7)};
|
|
45
|
-
padding: 1rem;
|
|
46
|
-
border-radius: 0.75rem;
|
|
47
|
-
|
|
48
|
-
@media (min-width: 640px) {
|
|
49
|
-
padding: 1.5rem;
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const IconWrapper = styled.div`
|
|
54
|
-
background-color: ${({ themeColor }) => hexToRgba(themeColor, 0.1)};
|
|
55
|
-
height: ${({ variant }) => (variant === 'confirmation' ? '3.5rem' : '4rem')};
|
|
56
|
-
width: ${({ variant }) => (variant === 'confirmation' ? '3.5rem' : '4rem')};
|
|
57
|
-
border-radius: 9999px;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
margin: 0 auto
|
|
62
|
-
${({ variant }) => (variant === 'confirmation' ? '0.75rem' : '1rem')};
|
|
63
|
-
|
|
64
|
-
@media (min-width: 640px) {
|
|
65
|
-
height: ${({ variant }) => (variant === 'confirmation' ? '4rem' : '5rem')};
|
|
66
|
-
width: ${({ variant }) => (variant === 'confirmation' ? '4rem' : '5rem')};
|
|
67
|
-
margin-bottom: ${({ variant }) =>
|
|
68
|
-
variant === 'confirmation' ? '1rem' : '1.25rem'};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
svg {
|
|
72
|
-
height: ${({ variant }) =>
|
|
73
|
-
variant === 'confirmation' ? '1.75rem' : '2rem'};
|
|
74
|
-
width: ${({ variant }) =>
|
|
75
|
-
variant === 'confirmation' ? '1.75rem' : '2rem'};
|
|
76
|
-
color: ${({ themeColor }) => themeColor};
|
|
77
|
-
|
|
78
|
-
@media (min-width: 640px) {
|
|
79
|
-
height: ${({ variant }) =>
|
|
80
|
-
variant === 'confirmation' ? '2rem' : '2.5rem'};
|
|
81
|
-
width: ${({ variant }) =>
|
|
82
|
-
variant === 'confirmation' ? '2rem' : '2.5rem'};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
const Title = styled.h2`
|
|
88
|
-
text-align: center;
|
|
89
|
-
font-size: 1.125rem;
|
|
90
|
-
color: ${({ themeColor }) => themeColor};
|
|
91
|
-
margin-bottom: ${({ variant }) =>
|
|
92
|
-
variant === 'confirmation' ? '0.25rem' : '0.5rem'};
|
|
93
|
-
|
|
94
|
-
@media (min-width: 640px) {
|
|
95
|
-
font-size: 1.25rem;
|
|
96
|
-
margin-bottom: ${({ variant }) =>
|
|
97
|
-
variant === 'confirmation' ? '0.5rem' : '0.75rem'};
|
|
98
|
-
}
|
|
99
|
-
`;
|
|
100
|
-
|
|
101
|
-
const Description = styled.p`
|
|
102
|
-
text-align: center;
|
|
103
|
-
font-size: ${({ variant }) =>
|
|
104
|
-
variant === 'confirmation' ? '0.75rem' : '0.875rem'};
|
|
105
|
-
color: #6b7280;
|
|
106
|
-
|
|
107
|
-
@media (min-width: 640px) {
|
|
108
|
-
font-size: ${({ variant }) =>
|
|
109
|
-
variant === 'confirmation' ? '0.875rem' : '1rem'};
|
|
110
|
-
}
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
const BmCustomCardTitle = ({
|
|
114
|
-
icon: Icon,
|
|
115
|
-
themeColor = '#33B1BA',
|
|
116
|
-
title,
|
|
117
|
-
description,
|
|
118
|
-
variant = 'booking',
|
|
119
|
-
withStripe = false,
|
|
120
|
-
}) => {
|
|
121
|
-
const content = (
|
|
122
|
-
<CardContainer variant={variant}>
|
|
123
|
-
<IconWrapper themeColor={themeColor} variant={variant}>
|
|
124
|
-
{Icon && <Icon />}
|
|
125
|
-
</IconWrapper>
|
|
126
|
-
{title && <Title variant={variant}>{title}</Title>}
|
|
127
|
-
{description && (
|
|
128
|
-
<Description variant={variant}>{description}</Description>
|
|
129
|
-
)}
|
|
130
|
-
</CardContainer>
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
return withStripe ? (
|
|
134
|
-
<BackgroundStripe themeColor={themeColor} variant={variant}>
|
|
135
|
-
{content}
|
|
136
|
-
</BackgroundStripe>
|
|
137
|
-
) : (
|
|
138
|
-
content
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export default BmCustomCardTitle;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
// MUI icons
|
|
4
|
-
import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
|
|
5
|
-
import CheckIcon from '@mui/icons-material/Check';
|
|
6
|
-
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
7
|
-
import FavoriteIcon from '@mui/icons-material/Favorite';
|
|
8
|
-
import BmCustomCardTitle from './CustomCardTitle';
|
|
9
|
-
|
|
10
|
-
// Icon options mapped by name
|
|
11
|
-
const iconOptions = {
|
|
12
|
-
Calendar: CalendarTodayOutlinedIcon,
|
|
13
|
-
Check: CheckIcon,
|
|
14
|
-
Clock: AccessTimeIcon,
|
|
15
|
-
Heart: FavoriteIcon,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const Template = (args) => {
|
|
19
|
-
return (
|
|
20
|
-
<div style={{ maxWidth: 500, margin: '2rem auto' }}>
|
|
21
|
-
<BmCustomCardTitle {...args} />
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Default = Template.bind({});
|
|
27
|
-
Default.args = {
|
|
28
|
-
icon: CalendarTodayOutlinedIcon,
|
|
29
|
-
themeColor: '#33B1BA',
|
|
30
|
-
title: 'Book Your Medical Appointment',
|
|
31
|
-
description:
|
|
32
|
-
'Schedule a 30-minute consultation with our healthcare specialists',
|
|
33
|
-
variant: 'booking',
|
|
34
|
-
withStripe: true,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
Default.argTypes = {
|
|
38
|
-
icon: {
|
|
39
|
-
control: {
|
|
40
|
-
type: 'select',
|
|
41
|
-
labels: Object.keys(iconOptions),
|
|
42
|
-
},
|
|
43
|
-
options: Object.keys(iconOptions),
|
|
44
|
-
mapping: iconOptions,
|
|
45
|
-
},
|
|
46
|
-
themeColor: {
|
|
47
|
-
control: 'color',
|
|
48
|
-
},
|
|
49
|
-
title: {
|
|
50
|
-
control: 'text',
|
|
51
|
-
},
|
|
52
|
-
description: {
|
|
53
|
-
control: 'text',
|
|
54
|
-
},
|
|
55
|
-
variant: {
|
|
56
|
-
control: {
|
|
57
|
-
type: 'radio',
|
|
58
|
-
},
|
|
59
|
-
options: ['booking', 'confirmation'],
|
|
60
|
-
},
|
|
61
|
-
withStripe: {
|
|
62
|
-
control: {
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export default {
|
|
69
|
-
title: 'Components/BmCustomCardTitle',
|
|
70
|
-
component: BmCustomCardTitle,
|
|
71
|
-
argTypes: Default.argTypes,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const Example = () => {
|
|
75
|
-
<BmCustomCardTitle
|
|
76
|
-
icon={CalendarTodayOutlinedIcon}
|
|
77
|
-
themeColor="#33B1BA"
|
|
78
|
-
title="Book Your Medical Appointment"
|
|
79
|
-
description="Schedule a 30-minute consultation with our healthcare specialists"
|
|
80
|
-
variant="booking"
|
|
81
|
-
withStripe
|
|
82
|
-
/>;
|
|
83
|
-
};
|