igloo-d2c-components 1.1.6-non-prod → 1.1.7-non-prod
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 +82 -5
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +82 -6
- package/dist/esm/index.js.map +1 -0
- package/dist/types/components/HealthConditionChecklist/HealthConditionChecklist.d.ts +28 -0
- package/dist/types/components/HealthConditionChecklist/index.d.ts +2 -0
- package/dist/types/components/HealthConditionChecklist/styled.d.ts +13 -0
- package/dist/types/components/HealthInformationForm/HealthInformationForm.d.ts +13 -1
- package/dist/types/components/HealthQuestionGroup/HealthQuestionGroup.d.ts +35 -0
- package/dist/types/components/HealthQuestionGroup/index.d.ts +1 -1
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -5242,19 +5242,73 @@ const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed =
|
|
|
5242
5242
|
return (jsxRuntime.jsx(ButtonContainer, { isFixed: fixed, desktopRightAligned: desktopRightAligned, sx: sx, children: jsxRuntime.jsx(StyledButton, { type: type, disabled: disabled || loading, isDisabled: disabled || loading, desktopWidth: desktopWidth, onClick: onClick, children: loading ? 'Processing...' : text }) }));
|
|
5243
5243
|
};
|
|
5244
5244
|
|
|
5245
|
+
const ChecklistContainer = styles.styled(material.Box)({
|
|
5246
|
+
display: 'flex',
|
|
5247
|
+
flexDirection: 'column',
|
|
5248
|
+
gap: '8px',
|
|
5249
|
+
});
|
|
5250
|
+
const ChecklistTitle = styles.styled(material.Typography)({
|
|
5251
|
+
fontSize: '14px',
|
|
5252
|
+
fontWeight: 400,
|
|
5253
|
+
lineHeight: '20px',
|
|
5254
|
+
color: '#13131B',
|
|
5255
|
+
wordSpacing: '0px',
|
|
5256
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
5257
|
+
});
|
|
5258
|
+
const ChecklistGrid = styles.styled(material.Box)({
|
|
5259
|
+
display: 'grid',
|
|
5260
|
+
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
|
|
5261
|
+
columnGap: '8px',
|
|
5262
|
+
rowGap: '0px',
|
|
5263
|
+
});
|
|
5264
|
+
const ChecklistOptionLabel = styles.styled(material.Typography)({
|
|
5265
|
+
fontSize: '12px',
|
|
5266
|
+
fontWeight: 400,
|
|
5267
|
+
lineHeight: '16px',
|
|
5268
|
+
color: '#5F5E62',
|
|
5269
|
+
wordSpacing: '0px',
|
|
5270
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
5271
|
+
});
|
|
5272
|
+
|
|
5273
|
+
const HealthConditionChecklist = ({ title, options, selected, onToggle, error, }) => (jsxRuntime.jsxs(ChecklistContainer, { children: [jsxRuntime.jsx(ChecklistTitle, { children: title }), jsxRuntime.jsx(ChecklistGrid, { children: options.map((option) => (jsxRuntime.jsx(material.Box, { children: jsxRuntime.jsx(material.FormControlLabel, { control: (jsxRuntime.jsx(material.Checkbox, { checked: selected.includes(option.value), onChange: () => onToggle(option.value), sx: {
|
|
5274
|
+
color: '#464555',
|
|
5275
|
+
padding: '4px 8px 4px 0',
|
|
5276
|
+
'& .MuiSvgIcon-root': {
|
|
5277
|
+
fontSize: '20px',
|
|
5278
|
+
},
|
|
5279
|
+
'&.Mui-checked': {
|
|
5280
|
+
color: '#0090DA',
|
|
5281
|
+
},
|
|
5282
|
+
} })), label: (jsxRuntime.jsx(ChecklistOptionLabel, { children: option.label })), sx: {
|
|
5283
|
+
alignItems: 'flex-start',
|
|
5284
|
+
margin: 0,
|
|
5285
|
+
'& .MuiFormControlLabel-label': {
|
|
5286
|
+
marginTop: '5px',
|
|
5287
|
+
},
|
|
5288
|
+
} }) }, option.value))) }), error && (jsxRuntime.jsx(material.Typography, { sx: {
|
|
5289
|
+
color: 'error.main',
|
|
5290
|
+
fontSize: '12px',
|
|
5291
|
+
mt: 0.5,
|
|
5292
|
+
wordSpacing: '0px',
|
|
5293
|
+
}, children: error }))] }));
|
|
5294
|
+
|
|
5245
5295
|
const QuestionContainer = styles.styled(material.Box)({
|
|
5246
5296
|
display: 'flex',
|
|
5247
5297
|
flexDirection: 'column',
|
|
5248
5298
|
gap: '16px',
|
|
5249
5299
|
});
|
|
5250
|
-
const QuestionText = styles.styled(material.Typography)({
|
|
5300
|
+
const QuestionText = styles.styled(material.Typography)(({ theme }) => ({
|
|
5251
5301
|
fontSize: '16px',
|
|
5252
5302
|
fontWeight: 400,
|
|
5253
5303
|
color: '#13131B',
|
|
5254
5304
|
lineHeight: '24px',
|
|
5255
5305
|
wordSpacing: '0px',
|
|
5256
5306
|
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
5257
|
-
|
|
5307
|
+
[theme.breakpoints.down('md')]: {
|
|
5308
|
+
fontSize: '14px',
|
|
5309
|
+
lineHeight: '20px',
|
|
5310
|
+
},
|
|
5311
|
+
}));
|
|
5258
5312
|
const OptionsContainer = styles.styled(material.Box)({
|
|
5259
5313
|
display: 'flex',
|
|
5260
5314
|
gap: '16px',
|
|
@@ -5286,10 +5340,31 @@ styles.styled(material.Typography)(({ selected }) => ({
|
|
|
5286
5340
|
wordSpacing: '0px',
|
|
5287
5341
|
}));
|
|
5288
5342
|
|
|
5289
|
-
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, OptionButtonComponent, }) => {
|
|
5343
|
+
const HealthQuestionGroup = ({ description, bullets, question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, OptionButtonComponent, followUp, }) => {
|
|
5290
5344
|
const yesLabel = labels.yes || 'Yes';
|
|
5291
5345
|
const noLabel = labels.no || 'No';
|
|
5292
|
-
return (jsxRuntime.jsxs(QuestionContainer, { sx: sx, children: [
|
|
5346
|
+
return (jsxRuntime.jsxs(QuestionContainer, { sx: sx, children: [description && (jsxRuntime.jsx(material.Typography, { sx: {
|
|
5347
|
+
fontSize: '14px',
|
|
5348
|
+
fontWeight: 400,
|
|
5349
|
+
color: '#13131B',
|
|
5350
|
+
lineHeight: '20px',
|
|
5351
|
+
wordSpacing: '0px',
|
|
5352
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
5353
|
+
}, children: description })), jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), Boolean(bullets?.length) && (jsxRuntime.jsx("ul", { style: {
|
|
5354
|
+
margin: '0',
|
|
5355
|
+
paddingInlineStart: '20px',
|
|
5356
|
+
listStyleType: 'disc',
|
|
5357
|
+
listStylePosition: 'outside',
|
|
5358
|
+
}, children: bullets?.map((bullet) => (jsxRuntime.jsx("li", { style: {
|
|
5359
|
+
marginBottom: '2px',
|
|
5360
|
+
}, children: jsxRuntime.jsx(material.Typography, { component: "span", sx: {
|
|
5361
|
+
fontSize: '14px',
|
|
5362
|
+
fontWeight: 400,
|
|
5363
|
+
color: '#13131B',
|
|
5364
|
+
lineHeight: '20px',
|
|
5365
|
+
wordSpacing: '0px',
|
|
5366
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
5367
|
+
}, children: bullet }) }, bullet))) })), jsxRuntime.jsx(OptionsContainer, { children: OptionButtonComponent ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OptionButtonComponent, { variant: "filledLightBorder", selected: value === 'yes', onClick: () => onChange('yes'), fullWidth: true, children: yesLabel }), jsxRuntime.jsx(OptionButtonComponent, { variant: "filledLightBorder", selected: value === 'no', onClick: () => onChange('no'), fullWidth: true, children: noLabel })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OptionButton, { value: "yes", label: yesLabel, selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsxRuntime.jsx(OptionButton, { value: "no", label: noLabel, selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] })) }), followUp && value === 'yes' && (jsxRuntime.jsx(HealthConditionChecklist, { title: followUp.title, options: followUp.options, selected: followUp.selected, onToggle: followUp.onToggle, error: followUp.error })), error && (jsxRuntime.jsx(material.Typography, { sx: {
|
|
5293
5368
|
color: 'error.main',
|
|
5294
5369
|
fontSize: '12px',
|
|
5295
5370
|
mt: 0.5,
|
|
@@ -5565,7 +5640,7 @@ const MeasurementFieldsGrid = styles.styled(material.Box)({
|
|
|
5565
5640
|
|
|
5566
5641
|
const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, OptionButtonComponent, }) => {
|
|
5567
5642
|
const Container = desktopGridLayout ? DesktopFormContainer$1 : FormContainer$1;
|
|
5568
|
-
return (jsxRuntime.jsx(material.Box, { ref: formRef, component: "form", onSubmit: onSubmit, children: jsxRuntime.jsx(Container, { sx: sx, children: jsxRuntime.jsxs(material.Box, { sx: { display: 'flex', flexDirection: 'column', gap: '24px' }, children: [desktopGridLayout ? (jsxRuntime.jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (jsxRuntime.jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels, OptionButtonComponent: OptionButtonComponent }, question.name || index)))] }) }) }));
|
|
5643
|
+
return (jsxRuntime.jsx(material.Box, { ref: formRef, component: "form", onSubmit: onSubmit, children: jsxRuntime.jsx(Container, { sx: sx, children: jsxRuntime.jsxs(material.Box, { sx: { display: 'flex', flexDirection: 'column', gap: '24px' }, children: [desktopGridLayout ? (jsxRuntime.jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (jsxRuntime.jsx(HealthQuestionGroup, { description: question.description, bullets: question.bullets, question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels, followUp: question.followUp, OptionButtonComponent: OptionButtonComponent }, question.name || index)))] }) }) }));
|
|
5569
5644
|
};
|
|
5570
5645
|
|
|
5571
5646
|
const FormContainer = styles.styled(material.Box)({
|
|
@@ -6419,6 +6494,7 @@ exports.ErrorBoundary = ErrorBoundary;
|
|
|
6419
6494
|
exports.FAQAccordion = FAQAccordion;
|
|
6420
6495
|
exports.Footer = Footer;
|
|
6421
6496
|
exports.Header = Header$1;
|
|
6497
|
+
exports.HealthConditionChecklist = HealthConditionChecklist;
|
|
6422
6498
|
exports.HealthInformationForm = HealthInformationForm;
|
|
6423
6499
|
exports.HealthQuestionGroup = HealthQuestionGroup;
|
|
6424
6500
|
exports.ICON_PATHS = ICON_PATHS;
|
|
@@ -6467,3 +6543,4 @@ exports.useTenantId = useTenantId;
|
|
|
6467
6543
|
exports.useTenantLogo = useTenantLogo;
|
|
6468
6544
|
exports.useTenantTheme = useTenantTheme;
|
|
6469
6545
|
exports.withErrorBoundary = withErrorBoundary;
|
|
6546
|
+
//# sourceMappingURL=index.js.map
|