igloo-d2c-components 1.0.32 → 1.0.34
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/cjs/index.js +110 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +111 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +9 -4
- package/dist/types/components/ProductSelectionDrawer/styled.d.ts +28 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { createContext, useMemo, useContext, useState, useEffect } from 'react';
|
|
5
|
-
import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography, Menu, MenuItem, Avatar, Drawer, IconButton, FormControlLabel, useTheme, useMediaQuery, Toolbar, Icon, RadioGroup, Radio, AppBar as AppBar$1, Divider, List, ListItem, ListItemButton, ListItemText, styled as styled$1, ButtonBase, Slider, Checkbox, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
5
|
+
import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography, Menu, MenuItem, Avatar, Drawer, IconButton, FormControlLabel, useTheme, useMediaQuery, Toolbar, Icon, RadioGroup, Radio, AppBar as AppBar$1, Divider, List, ListItem, ListItemButton, ListItemText, styled as styled$1, Dialog, ButtonBase, Slider, Checkbox, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
6
6
|
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
7
7
|
import CloseIcon from '@mui/icons-material/Close';
|
|
8
8
|
import AppBar from '@mui/material/AppBar';
|
|
@@ -2232,6 +2232,85 @@ const StyledDrawer = styled$1(Drawer)(() => ({
|
|
|
2232
2232
|
maxHeight: '90vh',
|
|
2233
2233
|
},
|
|
2234
2234
|
}));
|
|
2235
|
+
// Desktop Dialog styles
|
|
2236
|
+
const StyledDialog = styled$1(Dialog)(() => ({
|
|
2237
|
+
'& .MuiDialog-paper': {
|
|
2238
|
+
borderRadius: '0px',
|
|
2239
|
+
maxHeight: '90vh',
|
|
2240
|
+
display: 'flex',
|
|
2241
|
+
flexDirection: 'column',
|
|
2242
|
+
width: '100%',
|
|
2243
|
+
maxWidth: '900px',
|
|
2244
|
+
},
|
|
2245
|
+
}));
|
|
2246
|
+
const DialogHeader = styled$1(Box)(() => ({
|
|
2247
|
+
position: 'sticky',
|
|
2248
|
+
top: 0,
|
|
2249
|
+
backgroundColor: '#fff',
|
|
2250
|
+
zIndex: 1,
|
|
2251
|
+
padding: '24px 24px 0',
|
|
2252
|
+
}));
|
|
2253
|
+
const DialogHeaderTitle = styled$1(Typography)(() => ({
|
|
2254
|
+
fontFamily: 'Montserrat, sans-serif',
|
|
2255
|
+
fontSize: '24px',
|
|
2256
|
+
fontWeight: 600,
|
|
2257
|
+
lineHeight: '32px',
|
|
2258
|
+
color: '#13131b',
|
|
2259
|
+
marginBottom: '8px',
|
|
2260
|
+
paddingRight: '32px',
|
|
2261
|
+
wordSpacing: '0px',
|
|
2262
|
+
}));
|
|
2263
|
+
const DialogHeaderSubtitle = styled$1(Typography)(() => ({
|
|
2264
|
+
fontFamily: 'Montserrat, sans-serif',
|
|
2265
|
+
fontSize: '14px',
|
|
2266
|
+
fontWeight: 400,
|
|
2267
|
+
lineHeight: '20px',
|
|
2268
|
+
color: '#5f5e62',
|
|
2269
|
+
wordSpacing: '-5px',
|
|
2270
|
+
}));
|
|
2271
|
+
const DialogContent = styled$1(Box)(() => ({
|
|
2272
|
+
flex: 1,
|
|
2273
|
+
overflowY: 'auto',
|
|
2274
|
+
padding: '24px',
|
|
2275
|
+
}));
|
|
2276
|
+
const DialogProductsGrid = styled$1(Box)(() => ({
|
|
2277
|
+
display: 'grid',
|
|
2278
|
+
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
2279
|
+
gap: '16px',
|
|
2280
|
+
}));
|
|
2281
|
+
const DialogProductCard = styled$1(Box)(() => ({
|
|
2282
|
+
border: '1px solid #E0E0E0',
|
|
2283
|
+
borderRadius: '0px',
|
|
2284
|
+
padding: '16px',
|
|
2285
|
+
display: 'flex',
|
|
2286
|
+
flexDirection: 'column',
|
|
2287
|
+
alignItems: 'center',
|
|
2288
|
+
gap: '16px',
|
|
2289
|
+
}));
|
|
2290
|
+
const DialogProductLogo = styled$1(Box)(() => ({
|
|
2291
|
+
height: '32px',
|
|
2292
|
+
display: 'flex',
|
|
2293
|
+
alignItems: 'center',
|
|
2294
|
+
justifyContent: 'center',
|
|
2295
|
+
}));
|
|
2296
|
+
const DialogProductName = styled$1(Typography)(() => ({
|
|
2297
|
+
fontFamily: 'Montserrat, sans-serif',
|
|
2298
|
+
fontSize: '16px',
|
|
2299
|
+
fontWeight: 600,
|
|
2300
|
+
lineHeight: '24px',
|
|
2301
|
+
color: '#13131b',
|
|
2302
|
+
textAlign: 'center',
|
|
2303
|
+
wordSpacing: '0px',
|
|
2304
|
+
}));
|
|
2305
|
+
const DialogProductType = styled$1(Typography)(() => ({
|
|
2306
|
+
fontFamily: 'Montserrat, sans-serif',
|
|
2307
|
+
fontSize: '14px',
|
|
2308
|
+
fontWeight: 400,
|
|
2309
|
+
lineHeight: '20px',
|
|
2310
|
+
color: '#5f5e62',
|
|
2311
|
+
textAlign: 'center',
|
|
2312
|
+
wordSpacing: '-5px',
|
|
2313
|
+
}));
|
|
2235
2314
|
const DrawerContent = styled$1(Box)({
|
|
2236
2315
|
display: 'flex',
|
|
2237
2316
|
flexDirection: 'column',
|
|
@@ -2286,7 +2365,7 @@ const ProductCard$1 = styled$1(Box)({
|
|
|
2286
2365
|
flexDirection: 'column',
|
|
2287
2366
|
gap: '16px',
|
|
2288
2367
|
backgroundColor: '#ffffff',
|
|
2289
|
-
borderRadius: '
|
|
2368
|
+
borderRadius: '0',
|
|
2290
2369
|
boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)',
|
|
2291
2370
|
padding: '16px 12px 12px',
|
|
2292
2371
|
height: '168px',
|
|
@@ -2329,20 +2408,40 @@ const ViewPlansButton = styled$1(Button$1)({
|
|
|
2329
2408
|
borderRadius: '8px',
|
|
2330
2409
|
height: '36px',
|
|
2331
2410
|
textTransform: 'none',
|
|
2332
|
-
fontFamily: 'Montserrat, sans-serif',
|
|
2333
2411
|
fontSize: '14px',
|
|
2334
2412
|
fontWeight: 500,
|
|
2335
2413
|
lineHeight: '18px',
|
|
2336
|
-
wordSpacing: '
|
|
2414
|
+
wordSpacing: '0px',
|
|
2337
2415
|
});
|
|
2338
2416
|
|
|
2339
|
-
function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', viewPlansButtonText = 'View plans', }) {
|
|
2417
|
+
function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', viewPlansButtonText = 'View plans', variant = 'drawer', }) {
|
|
2340
2418
|
var _a, _b, _c, _d, _e, _f;
|
|
2341
2419
|
const tenantTheme = useTenantTheme();
|
|
2342
2420
|
// Get primary color from tenant theme, fallback to default
|
|
2343
|
-
const primaryColor = ((_c = (_b = (_a = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#
|
|
2344
|
-
const primaryDark = ((_f = (_e = (_d = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _d === void 0 ? void 0 : _d.palette) === null || _e === void 0 ? void 0 : _e.primary) === null || _f === void 0 ? void 0 : _f.dark) || '#
|
|
2345
|
-
const primaryDarker = '#
|
|
2421
|
+
const primaryColor = ((_c = (_b = (_a = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#0090DA';
|
|
2422
|
+
const primaryDark = ((_f = (_e = (_d = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _d === void 0 ? void 0 : _d.palette) === null || _e === void 0 ? void 0 : _e.primary) === null || _f === void 0 ? void 0 : _f.dark) || '#007bb8';
|
|
2423
|
+
const primaryDarker = '#006699'; // Active state
|
|
2424
|
+
// Desktop Dialog variant
|
|
2425
|
+
if (variant === 'dialog') {
|
|
2426
|
+
return (jsxs(StyledDialog, Object.assign({ open: open, onClose: onClose, maxWidth: "md", fullWidth: true }, { children: [jsxs(DialogHeader, { children: [jsx(IconButton, Object.assign({ onClick: onClose, sx: {
|
|
2427
|
+
position: 'absolute',
|
|
2428
|
+
right: 16,
|
|
2429
|
+
top: 16,
|
|
2430
|
+
} }, { children: jsx(CloseIcon, {}) })), jsx(DialogHeaderTitle, { children: title }), jsx(DialogHeaderSubtitle, { children: subtitle })] }), jsx(DialogContent, { children: jsx(DialogProductsGrid, { children: products.map((product) => (jsxs(DialogProductCard, { children: [jsx(DialogProductLogo, { children: jsx("img", { src: product.logo, alt: product.name, style: {
|
|
2431
|
+
width: '88px',
|
|
2432
|
+
height: '32px',
|
|
2433
|
+
objectFit: 'cover',
|
|
2434
|
+
} }) }), jsxs(Box, Object.assign({ sx: { textAlign: 'center' } }, { children: [jsx(DialogProductName, { children: product.name }), jsx(DialogProductType, { children: product.type })] })), jsx(ViewPlansButton, Object.assign({ variant: "contained", fullWidth: true, onClick: () => onProductSelect(product.id), sx: {
|
|
2435
|
+
backgroundColor: primaryColor,
|
|
2436
|
+
'&:hover': {
|
|
2437
|
+
backgroundColor: primaryDark,
|
|
2438
|
+
},
|
|
2439
|
+
'&:active': {
|
|
2440
|
+
backgroundColor: primaryDarker,
|
|
2441
|
+
},
|
|
2442
|
+
} }, { children: viewPlansButtonText }))] }, product.id))) }) })] })));
|
|
2443
|
+
}
|
|
2444
|
+
// Mobile Drawer variant (default)
|
|
2346
2445
|
return (jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxs(DrawerContent, { children: [jsx(DrawerHeader, { children: jsx(CloseButtonContainer, { children: jsx(IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxs(Header, { children: [jsx(HeaderTitle, { children: title }), jsx(HeaderSubtitle, { children: subtitle })] }), jsx(ProductsContainer, { children: jsx(ProductsGrid, { children: products.map((product) => (jsxs(ProductCard$1, { children: [jsxs(ProductInfo$1, { children: [jsx(ProductLogo, { children: jsx("img", { src: product.logo, alt: product.name, style: {
|
|
2347
2446
|
width: '88px',
|
|
2348
2447
|
height: '32px',
|
|
@@ -3370,7 +3469,7 @@ const StyledButton = styled('button')(({ isDisabled, desktopWidth }) => ({
|
|
|
3370
3469
|
fontSize: '14px',
|
|
3371
3470
|
fontWeight: 500,
|
|
3372
3471
|
lineHeight: '18px',
|
|
3373
|
-
wordSpacing: '
|
|
3472
|
+
wordSpacing: '0px',
|
|
3374
3473
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
3375
3474
|
transition: 'all 0.2s ease',
|
|
3376
3475
|
'&:hover': {
|
|
@@ -3573,7 +3672,7 @@ const FullWidthField = styled(Box)({
|
|
|
3573
3672
|
const CheckboxContainer = styled(Box)({
|
|
3574
3673
|
marginTop: '12px',
|
|
3575
3674
|
'& .MuiFormControlLabel-root': {
|
|
3576
|
-
alignItems: '
|
|
3675
|
+
alignItems: 'center',
|
|
3577
3676
|
marginLeft: 0,
|
|
3578
3677
|
'@media (min-width: 900px)': {
|
|
3579
3678
|
alignItems: 'center',
|
|
@@ -3778,7 +3877,7 @@ const FAQTitle = styled$1(Typography)(({ theme }) => ({
|
|
|
3778
3877
|
fontWeight: 700,
|
|
3779
3878
|
fontSize: '20px',
|
|
3780
3879
|
lineHeight: '28px',
|
|
3781
|
-
wordSpacing: '
|
|
3880
|
+
wordSpacing: '-5px',
|
|
3782
3881
|
textAlign: 'center',
|
|
3783
3882
|
width: '100%',
|
|
3784
3883
|
margin: 0,
|
|
@@ -3827,7 +3926,7 @@ const FAQQuestion = styled$1(Typography)(({ theme }) => ({
|
|
|
3827
3926
|
fontWeight: 700,
|
|
3828
3927
|
fontSize: '14px',
|
|
3829
3928
|
lineHeight: '20px',
|
|
3830
|
-
wordSpacing: '
|
|
3929
|
+
wordSpacing: '-5px',
|
|
3831
3930
|
flex: 1,
|
|
3832
3931
|
[theme.breakpoints.up('md')]: {
|
|
3833
3932
|
fontSize: '18px',
|