beem-component 2.1.10 → 2.1.11
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 +9 -2
- package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +10 -3
- package/package.json +1 -1
- package/src/App.js +2 -0
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +20 -0
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +17 -8
|
@@ -147,6 +147,9 @@ const Description = _styledComponents.default.p.withConfig({
|
|
|
147
147
|
} = _ref20;
|
|
148
148
|
return variant === 'confirmation' ? '0.875rem' : '1rem';
|
|
149
149
|
});
|
|
150
|
+
const ImageWrapper = _styledComponents.default.div.withConfig({
|
|
151
|
+
displayName: "CustomCardTitle__ImageWrapper"
|
|
152
|
+
})(["width:100%;aspect-ratio:1 / 1;overflow:hidden;border-radius:0.75rem;margin-top:1rem;img{width:100%;height:100%;object-fit:cover;display:block;}"]);
|
|
150
153
|
const BmCustomCardTitle = _ref21 => {
|
|
151
154
|
let {
|
|
152
155
|
icon: Icon,
|
|
@@ -154,7 +157,8 @@ const BmCustomCardTitle = _ref21 => {
|
|
|
154
157
|
title,
|
|
155
158
|
description,
|
|
156
159
|
variant = 'booking',
|
|
157
|
-
withStripe = false
|
|
160
|
+
withStripe = false,
|
|
161
|
+
imageSrc
|
|
158
162
|
} = _ref21;
|
|
159
163
|
const content = /*#__PURE__*/_react.default.createElement(CardContainer, {
|
|
160
164
|
variant: variant
|
|
@@ -165,7 +169,10 @@ const BmCustomCardTitle = _ref21 => {
|
|
|
165
169
|
variant: variant
|
|
166
170
|
}, title), description && /*#__PURE__*/_react.default.createElement(Description, {
|
|
167
171
|
variant: variant
|
|
168
|
-
}, description)
|
|
172
|
+
}, description), imageSrc && /*#__PURE__*/_react.default.createElement(ImageWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
173
|
+
src: imageSrc,
|
|
174
|
+
alt: title || 'Card image'
|
|
175
|
+
})));
|
|
169
176
|
return withStripe ? /*#__PURE__*/_react.default.createElement(BackgroundStripe, {
|
|
170
177
|
themeColor: themeColor,
|
|
171
178
|
variant: variant
|
|
@@ -20,6 +20,7 @@ const iconOptions = {
|
|
|
20
20
|
Clock: _AccessTime.default,
|
|
21
21
|
Heart: _Favorite.default
|
|
22
22
|
};
|
|
23
|
+
const imgs = 'https://i.imgur.com/HiAzUHl.jpeg';
|
|
23
24
|
const Template = args => {
|
|
24
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
26
|
style: {
|
|
@@ -35,7 +36,8 @@ Default.args = {
|
|
|
35
36
|
title: 'Book Your Medical Appointment',
|
|
36
37
|
description: 'Schedule a 30-minute consultation with our healthcare specialists',
|
|
37
38
|
variant: 'booking',
|
|
38
|
-
withStripe: true
|
|
39
|
+
withStripe: true,
|
|
40
|
+
imageSrc: imgs
|
|
39
41
|
};
|
|
40
42
|
Default.argTypes = {
|
|
41
43
|
icon: {
|
|
@@ -65,6 +67,10 @@ Default.argTypes = {
|
|
|
65
67
|
control: {
|
|
66
68
|
type: 'boolean'
|
|
67
69
|
}
|
|
70
|
+
},
|
|
71
|
+
imageSrc: {
|
|
72
|
+
control: 'text',
|
|
73
|
+
description: 'URL of the image to display in the card'
|
|
68
74
|
}
|
|
69
75
|
};
|
|
70
76
|
var _default = exports.default = {
|
|
@@ -73,13 +79,14 @@ var _default = exports.default = {
|
|
|
73
79
|
argTypes: Default.argTypes
|
|
74
80
|
};
|
|
75
81
|
const Example = () => {
|
|
76
|
-
/*#__PURE__*/_react.default.createElement(_CustomCardTitle.default, {
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_CustomCardTitle.default, {
|
|
77
83
|
icon: _CalendarTodayOutlined.default,
|
|
78
84
|
themeColor: "#33B1BA",
|
|
79
85
|
title: "Book Your Medical Appointment",
|
|
80
86
|
description: "Schedule a 30-minute consultation with our healthcare specialists",
|
|
81
87
|
variant: "booking",
|
|
82
|
-
withStripe: true
|
|
88
|
+
withStripe: true,
|
|
89
|
+
imageSrc: imgs
|
|
83
90
|
});
|
|
84
91
|
};
|
|
85
92
|
exports.Example = Example;
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1013,6 +1013,7 @@ const Chat = () => {
|
|
|
1013
1013
|
|
|
1014
1014
|
const [selectedSlotId, setSelectedSlotId] = useState(null);
|
|
1015
1015
|
console.log({ selectedSlotId });
|
|
1016
|
+
const imgs = 'https://i.imgur.com/HiAzUHl.jpeg';
|
|
1016
1017
|
return (
|
|
1017
1018
|
<>
|
|
1018
1019
|
<GlobalStyle />
|
|
@@ -1098,6 +1099,7 @@ const Chat = () => {
|
|
|
1098
1099
|
description="Schedule a 30-minute consultation with our healThcare specialists"
|
|
1099
1100
|
variant="booking"
|
|
1100
1101
|
withStripe
|
|
1102
|
+
imageSrc={imgs}
|
|
1101
1103
|
/>
|
|
1102
1104
|
</div>
|
|
1103
1105
|
<div>
|
|
@@ -110,6 +110,20 @@ const Description = styled.p`
|
|
|
110
110
|
}
|
|
111
111
|
`;
|
|
112
112
|
|
|
113
|
+
const ImageWrapper = styled.div`
|
|
114
|
+
width: 100%;
|
|
115
|
+
aspect-ratio: 1 / 1;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
border-radius: 0.75rem;
|
|
118
|
+
margin-top: 1rem;
|
|
119
|
+
|
|
120
|
+
img {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
object-fit: cover;
|
|
124
|
+
display: block;
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
113
127
|
const BmCustomCardTitle = ({
|
|
114
128
|
icon: Icon,
|
|
115
129
|
themeColor = '#33B1BA',
|
|
@@ -117,6 +131,7 @@ const BmCustomCardTitle = ({
|
|
|
117
131
|
description,
|
|
118
132
|
variant = 'booking',
|
|
119
133
|
withStripe = false,
|
|
134
|
+
imageSrc,
|
|
120
135
|
}) => {
|
|
121
136
|
const content = (
|
|
122
137
|
<CardContainer variant={variant}>
|
|
@@ -127,6 +142,11 @@ const BmCustomCardTitle = ({
|
|
|
127
142
|
{description && (
|
|
128
143
|
<Description variant={variant}>{description}</Description>
|
|
129
144
|
)}
|
|
145
|
+
{imageSrc && (
|
|
146
|
+
<ImageWrapper>
|
|
147
|
+
<img src={imageSrc} alt={title || 'Card image'} />
|
|
148
|
+
</ImageWrapper>
|
|
149
|
+
)}
|
|
130
150
|
</CardContainer>
|
|
131
151
|
);
|
|
132
152
|
|
|
@@ -15,6 +15,7 @@ const iconOptions = {
|
|
|
15
15
|
Heart: FavoriteIcon,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const imgs = 'https://i.imgur.com/HiAzUHl.jpeg';
|
|
18
19
|
const Template = (args) => {
|
|
19
20
|
return (
|
|
20
21
|
<div style={{ maxWidth: 500, margin: '2rem auto' }}>
|
|
@@ -32,6 +33,7 @@ Default.args = {
|
|
|
32
33
|
'Schedule a 30-minute consultation with our healthcare specialists',
|
|
33
34
|
variant: 'booking',
|
|
34
35
|
withStripe: true,
|
|
36
|
+
imageSrc: imgs,
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
Default.argTypes = {
|
|
@@ -63,6 +65,10 @@ Default.argTypes = {
|
|
|
63
65
|
type: 'boolean',
|
|
64
66
|
},
|
|
65
67
|
},
|
|
68
|
+
imageSrc: {
|
|
69
|
+
control: 'text',
|
|
70
|
+
description: 'URL of the image to display in the card',
|
|
71
|
+
},
|
|
66
72
|
};
|
|
67
73
|
|
|
68
74
|
export default {
|
|
@@ -72,12 +78,15 @@ export default {
|
|
|
72
78
|
};
|
|
73
79
|
|
|
74
80
|
export const Example = () => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
return (
|
|
82
|
+
<BmCustomCardTitle
|
|
83
|
+
icon={CalendarTodayOutlinedIcon}
|
|
84
|
+
themeColor="#33B1BA"
|
|
85
|
+
title="Book Your Medical Appointment"
|
|
86
|
+
description="Schedule a 30-minute consultation with our healthcare specialists"
|
|
87
|
+
variant="booking"
|
|
88
|
+
withStripe
|
|
89
|
+
imageSrc={imgs}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
83
92
|
};
|