igloo-d2c-components 1.0.36 → 1.0.37
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/README.md +0 -1
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/HealthInformationForm/HealthInformationForm.d.ts +6 -0
- package/dist/types/components/HealthQuestionGroup/HealthQuestionGroup.d.ts +13 -0
- package/dist/types/components/HealthQuestionGroup/index.d.ts +1 -1
- package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +1 -5
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -2581,7 +2581,7 @@ material.styled(material.Box)({
|
|
|
2581
2581
|
padding: '4px',
|
|
2582
2582
|
});
|
|
2583
2583
|
|
|
2584
|
-
function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans',
|
|
2584
|
+
function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', variant = 'drawer', }) {
|
|
2585
2585
|
// Desktop Dialog variant
|
|
2586
2586
|
if (variant === 'dialog') {
|
|
2587
2587
|
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: {
|
|
@@ -3713,8 +3713,10 @@ styles.styled(material.Typography)(({ selected }) => ({
|
|
|
3713
3713
|
wordSpacing: '-5px',
|
|
3714
3714
|
}));
|
|
3715
3715
|
|
|
3716
|
-
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
|
|
3717
|
-
|
|
3716
|
+
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, OptionButtonComponent, }) => {
|
|
3717
|
+
const yesLabel = labels.yes || 'Yes';
|
|
3718
|
+
const noLabel = labels.no || 'No';
|
|
3719
|
+
return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsx(OptionsContainer, { children: OptionButtonComponent ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OptionButtonComponent, Object.assign({ variant: "filledLightBorder", selected: value === 'yes', onClick: () => onChange('yes'), fullWidth: true }, { children: yesLabel })), jsxRuntime.jsx(OptionButtonComponent, Object.assign({ 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" })] })) }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
|
|
3718
3720
|
color: 'error.main',
|
|
3719
3721
|
fontSize: '12px',
|
|
3720
3722
|
mt: 0.5,
|
|
@@ -3988,9 +3990,9 @@ const MeasurementFieldsGrid = styles.styled(material.Box)({
|
|
|
3988
3990
|
},
|
|
3989
3991
|
});
|
|
3990
3992
|
|
|
3991
|
-
const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3993
|
+
const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, OptionButtonComponent, }) => {
|
|
3992
3994
|
const Container = desktopGridLayout ? DesktopFormContainer$1 : FormContainer$1;
|
|
3993
|
-
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ 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 }, question.name || index)))] })) })));
|
|
3995
|
+
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ 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)))] })) })));
|
|
3994
3996
|
};
|
|
3995
3997
|
|
|
3996
3998
|
const FormContainer = styles.styled(material.Box)({
|