igloo-d2c-components 1.0.31 → 1.0.33

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 CHANGED
@@ -2252,6 +2252,85 @@ const StyledDrawer = material.styled(material.Drawer)(() => ({
2252
2252
  maxHeight: '90vh',
2253
2253
  },
2254
2254
  }));
2255
+ // Desktop Dialog styles
2256
+ const StyledDialog = material.styled(material.Dialog)(() => ({
2257
+ '& .MuiDialog-paper': {
2258
+ borderRadius: '0px',
2259
+ maxHeight: '90vh',
2260
+ display: 'flex',
2261
+ flexDirection: 'column',
2262
+ width: '100%',
2263
+ maxWidth: '900px',
2264
+ },
2265
+ }));
2266
+ const DialogHeader = material.styled(material.Box)(() => ({
2267
+ position: 'sticky',
2268
+ top: 0,
2269
+ backgroundColor: '#fff',
2270
+ zIndex: 1,
2271
+ padding: '24px 24px 0',
2272
+ }));
2273
+ const DialogHeaderTitle = material.styled(material.Typography)(() => ({
2274
+ fontFamily: 'Montserrat, sans-serif',
2275
+ fontSize: '24px',
2276
+ fontWeight: 600,
2277
+ lineHeight: '32px',
2278
+ color: '#13131b',
2279
+ marginBottom: '8px',
2280
+ paddingRight: '32px',
2281
+ wordSpacing: '0px',
2282
+ }));
2283
+ const DialogHeaderSubtitle = material.styled(material.Typography)(() => ({
2284
+ fontFamily: 'Montserrat, sans-serif',
2285
+ fontSize: '14px',
2286
+ fontWeight: 400,
2287
+ lineHeight: '20px',
2288
+ color: '#5f5e62',
2289
+ wordSpacing: '-5px',
2290
+ }));
2291
+ const DialogContent = material.styled(material.Box)(() => ({
2292
+ flex: 1,
2293
+ overflowY: 'auto',
2294
+ padding: '24px',
2295
+ }));
2296
+ const DialogProductsGrid = material.styled(material.Box)(() => ({
2297
+ display: 'grid',
2298
+ gridTemplateColumns: 'repeat(2, 1fr)',
2299
+ gap: '16px',
2300
+ }));
2301
+ const DialogProductCard = material.styled(material.Box)(() => ({
2302
+ border: '1px solid #E0E0E0',
2303
+ borderRadius: '0px',
2304
+ padding: '16px',
2305
+ display: 'flex',
2306
+ flexDirection: 'column',
2307
+ alignItems: 'center',
2308
+ gap: '16px',
2309
+ }));
2310
+ const DialogProductLogo = material.styled(material.Box)(() => ({
2311
+ height: '32px',
2312
+ display: 'flex',
2313
+ alignItems: 'center',
2314
+ justifyContent: 'center',
2315
+ }));
2316
+ const DialogProductName = material.styled(material.Typography)(() => ({
2317
+ fontFamily: 'Montserrat, sans-serif',
2318
+ fontSize: '16px',
2319
+ fontWeight: 600,
2320
+ lineHeight: '24px',
2321
+ color: '#13131b',
2322
+ textAlign: 'center',
2323
+ wordSpacing: '0px',
2324
+ }));
2325
+ const DialogProductType = material.styled(material.Typography)(() => ({
2326
+ fontFamily: 'Montserrat, sans-serif',
2327
+ fontSize: '14px',
2328
+ fontWeight: 400,
2329
+ lineHeight: '20px',
2330
+ color: '#5f5e62',
2331
+ textAlign: 'center',
2332
+ wordSpacing: '-5px',
2333
+ }));
2255
2334
  const DrawerContent = material.styled(material.Box)({
2256
2335
  display: 'flex',
2257
2336
  flexDirection: 'column',
@@ -2349,20 +2428,40 @@ const ViewPlansButton = material.styled(material.Button)({
2349
2428
  borderRadius: '8px',
2350
2429
  height: '36px',
2351
2430
  textTransform: 'none',
2352
- fontFamily: 'Montserrat, sans-serif',
2353
2431
  fontSize: '14px',
2354
2432
  fontWeight: 500,
2355
2433
  lineHeight: '18px',
2356
2434
  wordSpacing: '-5px',
2357
2435
  });
2358
2436
 
2359
- 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', }) {
2437
+ 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', }) {
2360
2438
  var _a, _b, _c, _d, _e, _f;
2361
2439
  const tenantTheme = useTenantTheme();
2362
2440
  // Get primary color from tenant theme, fallback to default
2363
- 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) || '#317abc';
2364
- 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) || '#2869a8';
2365
- const primaryDarker = '#1f5489'; // Active state
2441
+ 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';
2442
+ 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';
2443
+ const primaryDarker = '#006699'; // Active state
2444
+ // Desktop Dialog variant
2445
+ if (variant === 'dialog') {
2446
+ return (jsxRuntime.jsxs(StyledDialog, Object.assign({ open: open, onClose: onClose, maxWidth: "md", fullWidth: true }, { children: [jsxRuntime.jsxs(DialogHeader, { children: [jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onClose, sx: {
2447
+ position: 'absolute',
2448
+ right: 16,
2449
+ top: 16,
2450
+ } }, { children: jsxRuntime.jsx(CloseIcon, {}) })), jsxRuntime.jsx(DialogHeaderTitle, { children: title }), jsxRuntime.jsx(DialogHeaderSubtitle, { children: subtitle })] }), jsxRuntime.jsx(DialogContent, { children: jsxRuntime.jsx(DialogProductsGrid, { children: products.map((product) => (jsxRuntime.jsxs(DialogProductCard, { children: [jsxRuntime.jsx(DialogProductLogo, { children: jsxRuntime.jsx("img", { src: product.logo, alt: product.name, style: {
2451
+ width: '88px',
2452
+ height: '32px',
2453
+ objectFit: 'cover',
2454
+ } }) }), jsxRuntime.jsxs(material.Box, Object.assign({ sx: { textAlign: 'center' } }, { children: [jsxRuntime.jsx(DialogProductName, { children: product.name }), jsxRuntime.jsx(DialogProductType, { children: product.type })] })), jsxRuntime.jsx(ViewPlansButton, Object.assign({ variant: "contained", fullWidth: true, onClick: () => onProductSelect(product.id), sx: {
2455
+ backgroundColor: primaryColor,
2456
+ '&:hover': {
2457
+ backgroundColor: primaryDark,
2458
+ },
2459
+ '&:active': {
2460
+ backgroundColor: primaryDarker,
2461
+ },
2462
+ } }, { children: viewPlansButtonText }))] }, product.id))) }) })] })));
2463
+ }
2464
+ // Mobile Drawer variant (default)
2366
2465
  return (jsxRuntime.jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxRuntime.jsxs(DrawerContent, { children: [jsxRuntime.jsx(DrawerHeader, { children: jsxRuntime.jsx(CloseButtonContainer, { children: jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsxRuntime.jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxRuntime.jsxs(Header, { children: [jsxRuntime.jsx(HeaderTitle, { children: title }), jsxRuntime.jsx(HeaderSubtitle, { children: subtitle })] }), jsxRuntime.jsx(ProductsContainer, { children: jsxRuntime.jsx(ProductsGrid, { children: products.map((product) => (jsxRuntime.jsxs(ProductCard$1, { children: [jsxRuntime.jsxs(ProductInfo$1, { children: [jsxRuntime.jsx(ProductLogo, { children: jsxRuntime.jsx("img", { src: product.logo, alt: product.name, style: {
2367
2466
  width: '88px',
2368
2467
  height: '32px',
@@ -3278,7 +3377,6 @@ const ProductCardContainer = styles.styled(material.Box)(({ theme, showIndicator
3278
3377
  const LogoContainer = styles.styled(material.Box)({
3279
3378
  width: '45px',
3280
3379
  height: '40px',
3281
- border: '1.25px solid rgba(0, 0, 0, 0.1)',
3282
3380
  borderRadius: '10px',
3283
3381
  display: 'flex',
3284
3382
  alignItems: 'center',
@@ -3391,7 +3489,7 @@ const StyledButton = styles.styled('button')(({ isDisabled, desktopWidth }) => (
3391
3489
  fontSize: '14px',
3392
3490
  fontWeight: 500,
3393
3491
  lineHeight: '18px',
3394
- wordSpacing: '-5px',
3492
+ wordSpacing: '0px',
3395
3493
  cursor: isDisabled ? 'not-allowed' : 'pointer',
3396
3494
  transition: 'all 0.2s ease',
3397
3495
  '&:hover': {
@@ -3461,6 +3559,7 @@ const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error,
3461
3559
  color: 'error.main',
3462
3560
  fontSize: '12px',
3463
3561
  mt: 0.5,
3562
+ wordSpacing: '-5px',
3464
3563
  } }, { children: error })))] })));
3465
3564
  };
3466
3565
 
@@ -3534,18 +3633,21 @@ const PersonalInformationForm = ({ renderField, fields, consents, onSubmit, form
3534
3633
  ml: 2,
3535
3634
  color: '#5F5E62',
3536
3635
  fontSize: '12px',
3636
+ wordSpacing: '-5px',
3537
3637
  } }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.salutation), renderField(fields.nationality), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), desktopGridLayout ? (jsxRuntime.jsx(FullWidthField$1, { children: jsxRuntime.jsxs(CheckboxContainer$1, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
3538
3638
  defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
3539
3639
  color: 'error.main',
3540
3640
  fontSize: '12px',
3541
3641
  mt: 0.5,
3542
3642
  ml: 4,
3643
+ wordSpacing: '-5px',
3543
3644
  } }, { children: consents.bank_account_confirmation.error })))] }) })) : (jsxRuntime.jsxs(CheckboxContainer$1, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
3544
3645
  defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
3545
3646
  color: 'error.main',
3546
3647
  fontSize: '12px',
3547
3648
  mt: 0.5,
3548
3649
  ml: 4,
3650
+ wordSpacing: '-5px',
3549
3651
  } }, { children: consents.bank_account_confirmation.error })))] })), desktopGridLayout ? (jsxRuntime.jsx(FullWidthField$1, { children: jsxRuntime.jsx(CheckboxContainer$1, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.marketing_consent.checked, onChange: (e) => consents.marketing_consent.onChange(e.target.checked), name: "marketing_consent" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.marketing_consent.label || defaultMarketingLabel }) }) }) })) : (jsxRuntime.jsx(CheckboxContainer$1, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.marketing_consent.checked, onChange: (e) => consents.marketing_consent.onChange(e.target.checked), name: "marketing_consent" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.marketing_consent.label || defaultMarketingLabel }) }) }))] })) })));
3550
3652
  };
3551
3653
 
@@ -3759,6 +3861,7 @@ const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, desk
3759
3861
  ml: 2,
3760
3862
  color: '#5F5E62',
3761
3863
  fontSize: '12px',
3864
+ wordSpacing: '-5px',
3762
3865
  } }, { children: fields.full_name.helperText })))] }), fields.nric ? renderField(fields.nric) : renderField(fields.date_of_birth), fields.nric && renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] }) })));
3763
3866
  }
3764
3867
  // Mobile layout - single column
@@ -3768,6 +3871,7 @@ const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, desk
3768
3871
  ml: 2,
3769
3872
  color: '#5F5E62',
3770
3873
  fontSize: '12px',
3874
+ wordSpacing: '-5px',
3771
3875
  } }, { children: fields.full_name.helperText })))] }), fields.nric && renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] })) })));
3772
3876
  };
3773
3877