@popmenu/common-ui 0.172.1 → 0.172.3
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/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +2 -0
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +3 -1
- package/build/cjs/index.js +75 -37
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/util/selectDisplay.d.ts +8 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +16 -5
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +3 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +3 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +2 -2
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.js +20 -12
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.js.map +1 -1
- package/build/esm/components/Icon/Icon.js +8 -11
- package/build/esm/components/Icon/Icon.js.map +1 -1
- package/build/esm/components/Icon/IconStyles.js +12 -7
- package/build/esm/components/Icon/IconStyles.js.map +1 -1
- package/build/esm/util/selectDisplay.d.ts +8 -0
- package/build/esm/util/selectDisplay.js +21 -0
- package/build/esm/util/selectDisplay.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTheme, useMediaQuery, Grid, ThemeProvider, Dialog } from '@material-ui/core';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useId, useState, useEffect } from 'react';
|
|
3
3
|
import { FollowerAuthenticationDialogContextProvider } from './context.js';
|
|
4
4
|
import { FollowerAuthenticationBody } from './FollowerAuthenticationBody.js';
|
|
5
5
|
import { FollowerAuthenticationCloseButton } from './FollowerAuthenticationCloseButton.js';
|
|
@@ -20,14 +20,23 @@ const FollowerAuthenticationDialog = (props) => {
|
|
|
20
20
|
const handleClose = () => {
|
|
21
21
|
restProps.onActionButtonClick('close');
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const titleId = useId();
|
|
24
24
|
const showV2 = !!restProps.showV2;
|
|
25
|
+
const stepValue = restProps.state.value;
|
|
26
|
+
const stepTitle = restProps.messages[`${stepValue}Title`];
|
|
27
|
+
const hasStepTitle = stepTitle !== undefined && stepTitle !== null && stepTitle !== '' && stepTitle !== false;
|
|
28
|
+
const initialTitle = typeof restProps.messages.initialTitle === 'string' ? restProps.messages.initialTitle : undefined;
|
|
29
|
+
const [paper, setPaper] = useState(null);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (open)
|
|
32
|
+
paper?.focus();
|
|
33
|
+
}, [open, paper, stepValue]);
|
|
25
34
|
const showSidebar = showV2 && (typeof restProps.logoUrl === 'string' || typeof restProps.signUpBackgroundImageUrl === 'string');
|
|
26
35
|
const dialogInner = (React.createElement(FollowerAuthenticationContent, null,
|
|
27
36
|
React.createElement(FollowerAuthenticationCloseButton, { show: showCloseButton }),
|
|
28
37
|
React.createElement(FollowerAuthenticationVipLogo, null),
|
|
29
38
|
React.createElement(FollowerAuthenticationGraphic, null),
|
|
30
|
-
React.createElement(FollowerAuthenticationTitle,
|
|
39
|
+
React.createElement(FollowerAuthenticationTitle, { id: hasStepTitle ? titleId : undefined }),
|
|
31
40
|
React.createElement(FollowerAuthenticationInfo, null),
|
|
32
41
|
React.createElement(FollowerAuthenticationVipBenefitRows, null),
|
|
33
42
|
React.createElement(FollowerAuthenticationBody, null),
|
|
@@ -39,9 +48,11 @@ const FollowerAuthenticationDialog = (props) => {
|
|
|
39
48
|
return (React.createElement(ThemeProvider, { theme: theme$1 },
|
|
40
49
|
React.createElement(FollowerAuthenticationDialogContextProvider, { value: restProps },
|
|
41
50
|
React.createElement(Dialog, { open: open, fullScreen: fullScreen, maxWidth: showV2 ? false : undefined, onClose: handleClose, PaperProps: {
|
|
42
|
-
|
|
51
|
+
ref: setPaper,
|
|
52
|
+
tabIndex: -1,
|
|
53
|
+
...(hasStepTitle ? { 'aria-labelledby': titleId } : { 'aria-label': initialTitle }),
|
|
43
54
|
'aria-modal': 'true',
|
|
44
|
-
style: showV2
|
|
55
|
+
style: { outline: 'none', ...(showV2 && { maxWidth: showSidebar ? 800 : 540, width: '100%' }) },
|
|
45
56
|
} }, dialogContent))));
|
|
46
57
|
};
|
|
47
58
|
|
package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowerAuthenticationDialog.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.tsx"],"sourcesContent":["import { createTheme, Dialog, Grid, Theme, ThemeProvider, useMediaQuery } from '@material-ui/core'\nimport React from 'react'\nimport { FollowerAuthenticationDialogContextProvider } from './context'\nimport { FollowerAuthenticationBody } from './FollowerAuthenticationBody'\nimport { FollowerAuthenticationCloseButton } from './FollowerAuthenticationCloseButton'\nimport { FollowerAuthenticationContent } from './FollowerAuthenticationContent'\nimport { FollowerAuthenticationDialogProps } from './FollowerAuthenticationDialogProps'\nimport { FollowerAuthenticationFooter } from './FollowerAuthenticationFooter'\nimport { FollowerAuthenticationGraphic } from './FollowerAuthenticationGraphic'\nimport { FollowerAuthenticationInfo } from './FollowerAuthenticationInfo'\nimport { FollowerAuthenticationLogoContainer } from './FollowerAuthenticationLogoContainer'\nimport { FollowerAuthenticationTitle } from './FollowerAuthenticationTitle'\nimport { FollowerAuthenticationVipBenefitRows } from './FollowerAuthenticationVipBenefitRows'\nimport { FollowerAuthenticationVipLogo } from './FollowerAuthenticationVipLogo'\nimport { theme as themeOptions } from './theme'\n\nexport const FollowerAuthenticationDialog = (props: FollowerAuthenticationDialogProps) => {\n const { open, showCloseButton = true, ...restProps } = props\n const theme = createTheme(themeOptions)\n const fullScreen = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'))\n const handleClose = () => {\n restProps.onActionButtonClick('close')\n }\n const initialTitle = typeof restProps.messages.initialTitle === 'string' ? restProps.messages.initialTitle : undefined\n const
|
|
1
|
+
{"version":3,"file":"FollowerAuthenticationDialog.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.tsx"],"sourcesContent":["import { createTheme, Dialog, Grid, Theme, ThemeProvider, useMediaQuery } from '@material-ui/core'\nimport React, { useEffect, useId, useState } from 'react'\nimport { FollowerAuthenticationDialogContextProvider } from './context'\nimport { FollowerAuthenticationBody } from './FollowerAuthenticationBody'\nimport { FollowerAuthenticationCloseButton } from './FollowerAuthenticationCloseButton'\nimport { FollowerAuthenticationContent } from './FollowerAuthenticationContent'\nimport { FollowerAuthenticationDialogProps, MessageKey } from './FollowerAuthenticationDialogProps'\nimport { FollowerAuthenticationFooter } from './FollowerAuthenticationFooter'\nimport { FollowerAuthenticationGraphic } from './FollowerAuthenticationGraphic'\nimport { FollowerAuthenticationInfo } from './FollowerAuthenticationInfo'\nimport { FollowerAuthenticationLogoContainer } from './FollowerAuthenticationLogoContainer'\nimport { FollowerAuthenticationTitle } from './FollowerAuthenticationTitle'\nimport { FollowerAuthenticationVipBenefitRows } from './FollowerAuthenticationVipBenefitRows'\nimport { FollowerAuthenticationVipLogo } from './FollowerAuthenticationVipLogo'\nimport { theme as themeOptions } from './theme'\n\nexport const FollowerAuthenticationDialog = (props: FollowerAuthenticationDialogProps) => {\n const { open, showCloseButton = true, ...restProps } = props\n const theme = createTheme(themeOptions)\n const fullScreen = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'))\n const handleClose = () => {\n restProps.onActionButtonClick('close')\n }\n const titleId = useId()\n const showV2 = !!restProps.showV2\n\n const stepValue = restProps.state.value\n const stepTitle = restProps.messages[`${stepValue}Title` as MessageKey]\n const hasStepTitle = stepTitle !== undefined && stepTitle !== null && stepTitle !== '' && stepTitle !== false\n const initialTitle = typeof restProps.messages.initialTitle === 'string' ? restProps.messages.initialTitle : undefined\n\n const [paper, setPaper] = useState<HTMLDivElement | null>(null)\n useEffect(() => {\n if (open) paper?.focus()\n }, [open, paper, stepValue])\n\n const showSidebar =\n showV2 && (typeof restProps.logoUrl === 'string' || typeof restProps.signUpBackgroundImageUrl === 'string')\n\n const dialogInner = (\n <FollowerAuthenticationContent>\n <FollowerAuthenticationCloseButton show={showCloseButton} />\n <FollowerAuthenticationVipLogo />\n <FollowerAuthenticationGraphic />\n <FollowerAuthenticationTitle id={hasStepTitle ? titleId : undefined} />\n <FollowerAuthenticationInfo />\n <FollowerAuthenticationVipBenefitRows />\n <FollowerAuthenticationBody />\n <FollowerAuthenticationFooter />\n </FollowerAuthenticationContent>\n )\n\n const dialogContent = showSidebar ? (\n <Grid container>\n <Grid item lg={4} md={3} xs={12}>\n <FollowerAuthenticationLogoContainer />\n </Grid>\n <Grid item lg={8} md={9} xs={12}>\n {dialogInner}\n </Grid>\n </Grid>\n ) : (\n dialogInner\n )\n\n return (\n <ThemeProvider theme={theme}>\n <FollowerAuthenticationDialogContextProvider value={restProps}>\n <Dialog\n open={open}\n fullScreen={fullScreen}\n maxWidth={showV2 ? false : undefined}\n onClose={handleClose}\n PaperProps={{\n ref: setPaper,\n tabIndex: -1,\n ...(hasStepTitle ? { 'aria-labelledby': titleId } : { 'aria-label': initialTitle }),\n 'aria-modal': 'true',\n style: { outline: 'none', ...(showV2 && { maxWidth: showSidebar ? 800 : 540, width: '100%' }) },\n }}\n >\n {dialogContent}\n </Dialog>\n </FollowerAuthenticationDialogContextProvider>\n </ThemeProvider>\n )\n}\n"],"names":["theme","themeOptions"],"mappings":";;;;;;;;;;;;;;;A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ED,OAAK,EAAA;AACzB,QAAA,KAAA,CAAA,aAAA,CAAC,2CAA2C,EAAA,EAAC,KAAK,EAAE,SAAS,EAAA;YAC3D,KAAC,CAAA,aAAA,CAAA,MAAM,EACL,EAAA,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,EACpC,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE;AACV,oBAAA,GAAG,EAAE,QAAQ;oBACb,QAAQ,EAAE,EAAE;AACZ,oBAAA,IAAI,YAAY,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AACnF,oBAAA,YAAY,EAAE,MAAM;AACpB,oBAAA,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,MAAM,IAAI,EAAE,QAAQ,EAAE,WAAW,GAAG,GAAG,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;AAChG,iBAAA,EAAA,EAEA,aAAa,CACP,CACmC,CAChC;AAEpB;;;;"}
|
package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type FollowerAuthenticationDialogProps = {
|
|
|
16
16
|
messages: Record<MessageKey, ReactNode> & {
|
|
17
17
|
closeButtonLabel: string;
|
|
18
18
|
smsAccessCodeDisclaimer?: ReactNode;
|
|
19
|
+
/** Appended to the name of a required select, heard but not seen. Defaults to 'required'. */
|
|
20
|
+
requiredFieldLabel?: ReactNode;
|
|
19
21
|
};
|
|
20
22
|
locationOptions: LocationOption[];
|
|
21
23
|
loading: boolean;
|
|
@@ -4,6 +4,7 @@ import { makeStyles, TextField, Button, Box, FormControlLabel, Typography, Check
|
|
|
4
4
|
import { FollowerAuthenticationUserForm } from './FollowerAuthenticationUserForm.js';
|
|
5
5
|
import { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy.js';
|
|
6
6
|
import { validatePhoneNumber } from './phoneValidation.js';
|
|
7
|
+
import { renderSelectValue } from '../../util/selectDisplay.js';
|
|
7
8
|
|
|
8
9
|
const useStyles = makeStyles({
|
|
9
10
|
checkboxLabel: {
|
|
@@ -25,7 +26,8 @@ const useStyles = makeStyles({
|
|
|
25
26
|
},
|
|
26
27
|
});
|
|
27
28
|
function LocationAndBirthday({ checkFieldValidity, classes, loading, locationOptions, messages, showLocationErrorText, showV2, }) {
|
|
28
|
-
const
|
|
29
|
+
const locationItems = locationOptions.map((locationOption) => (React.createElement(MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)));
|
|
30
|
+
const locationSelect = (React.createElement(TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, id: "location-input", inputProps: { required: true }, name: "location", SelectProps: { displayEmpty: true, renderValue: renderSelectValue(locationItems) } }, locationItems));
|
|
29
31
|
if (showV2) {
|
|
30
32
|
return (React.createElement(React.Fragment, null,
|
|
31
33
|
React.createElement(Box, { display: "flex", flexDirection: "column", gridGap: 4, style: { width: '100%' } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowerAuthenticationForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, ReactNode, useEffect, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Button, Checkbox, FormControlLabel, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\nimport { FollowerAuthenticationUserForm } from './FollowerAuthenticationUserForm'\nimport { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy'\nimport { validatePhoneNumber } from './phoneValidation'\n\nconst useStyles = makeStyles({\n checkboxLabel: {\n '& > a': {\n textDecoration: 'underline',\n },\n fontSize: '0.75rem',\n },\n form: {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gridGap: 16,\n width: '100%',\n },\n label: {\n alignSelf: 'start',\n fontSize: '0.85rem',\n },\n})\n\ntype LocationAndBirthdayProps = {\n checkFieldValidity: ChangeEventHandler<HTMLInputElement>\n classes: { label: string }\n loading: boolean\n locationOptions: { label: string; value: string }[]\n messages: Record<MessageKey, ReactNode>\n showLocationErrorText: boolean | undefined\n showV2: boolean | undefined\n}\n\nfunction LocationAndBirthday({\n checkFieldValidity,\n classes,\n loading,\n locationOptions,\n messages,\n showLocationErrorText,\n showV2,\n}: LocationAndBirthdayProps) {\n const locationSelect = (\n <TextField\n disabled={loading}\n select\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n id=\"location-input\"\n inputProps={{ required: true }}\n name=\"location\"\n >\n {locationOptions.map((locationOption) => (\n <MenuItem data-cy={'option'} key={locationOption.value} value={locationOption.value}>\n {locationOption.label}\n </MenuItem>\n ))}\n </TextField>\n )\n\n if (showV2) {\n return (\n <>\n <Box display=\"flex\" flexDirection=\"column\" gridGap={4} style={{ width: '100%' }}>\n <Typography className={classes.label}>{messages.signUpBirthdaySectionLabel}</Typography>\n <Box display=\"flex\" gridGap={16}>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n style={{ flex: 1 }}\n />\n <TextField\n disabled={loading}\n label={messages.signUpDayInputLabel}\n id=\"birthday-date-input\"\n name=\"birthdayDate\"\n style={{ flex: 1 }}\n />\n </Box>\n </Box>\n {locationSelect}\n </>\n )\n }\n\n return (\n <>\n {locationSelect}\n <Typography style={{ alignSelf: 'start' }}>{messages.signUpBirthdaySectionLabel}</Typography>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n />\n <TextField disabled={loading} label={messages.signUpDayInputLabel} id=\"birthday-date-input\" name=\"birthdayDate\" />\n </>\n )\n}\n\nexport const FollowerAuthenticationForm = () => {\n const {\n state,\n messages,\n locationOptions,\n onActionButtonClick,\n loading,\n showV2,\n showSubscribeEmail,\n showSubscribeSms,\n } = useFollowerAuthenticationDialogContext()\n const classes = useStyles()\n\n // sign-up form state\n const formRef = useRef<HTMLFormElement>(null)\n const [formValidity, setFormValidity] = useState(false)\n const [showNameErrorText, setShowNameErrorText] = useState<boolean | undefined>()\n const [showPhoneErrorText, setShowPhoneErrorText] = useState<boolean | undefined>()\n const [showEmailErrorText, setShowEmailErrorText] = useState<boolean | undefined>()\n const [showLocationErrorText, setShowLocationErrorText] = useState<boolean | undefined>()\n const [signUpNameValue, setSignUpNameValue] = useState(state.context.name || '')\n const [signUpPhoneValue, setSignUpPhoneValue] = useState(state.context.phone || '')\n const [signUpEmailValue, setSignUpEmailValue] = useState(state.context.email || '')\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'name':\n const isNameValid = fieldValue.length > 0\n setSignUpNameValue(fieldValue)\n setShowNameErrorText(!isNameValid)\n break\n case 'phone':\n const isPhoneValid = validatePhoneNumber(fieldValue)\n setSignUpPhoneValue(fieldValue)\n setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0)\n break\n case 'email':\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setSignUpEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n case 'location':\n setShowLocationErrorText(!fieldValue)\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n setSignUpNameValue(state.context.name || '')\n setSignUpPhoneValue(state.context.phone || '')\n setSignUpEmailValue(state.context.email || '')\n }, [state.context.name, state.context.phone, state.context.email])\n\n useEffect(() => {\n // Validate pre-filled values (only in signUp state)\n if (state.value === 'signUp') {\n if (signUpPhoneValue) {\n const isPhoneValid = validatePhoneNumber(signUpPhoneValue)\n setShowPhoneErrorText(!isPhoneValid)\n }\n if (signUpEmailValue) {\n const emailField = formRef.current?.elements.namedItem('email') as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setShowEmailErrorText(!isEmailValid)\n }\n }\n\n const hasValidName = Boolean(signUpNameValue) && !showNameErrorText\n const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText\n const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText\n\n const locationField = formRef.current?.elements.namedItem('location') as HTMLInputElement\n const hasValidLocation = locationField ? Boolean(locationField.value) : true\n\n const hasValidContact = showV2 ? hasValidName && hasValidPhone && hasValidEmail : hasValidPhone || hasValidEmail\n setFormValidity(hasValidContact && hasValidLocation)\n }, [\n showV2,\n state.value,\n signUpPhoneValue,\n signUpEmailValue,\n showPhoneErrorText,\n showEmailErrorText,\n showLocationErrorText,\n signUpNameValue,\n showNameErrorText,\n ])\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const form = e.target as HTMLFormElement\n const formData = new FormData(form)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n if (state.value === 'signUp') {\n values.subscribeEmail = String(formData.has('subscribeEmail'))\n values.subscribeSms = String(formData.has('subscribeSms'))\n }\n onActionButtonClick('submit-form', values)\n }\n const formProps = {\n key: state.value,\n id: 'follower-authentication-form',\n className: classes.form,\n onSubmit: handleSubmit,\n }\n switch (state.value) {\n case 'initial':\n return (\n <form {...formProps}>\n <Box alignSelf=\"stretch\" display=\"flex\" flexDirection=\"column\" width=\"100%\">\n <TextField disabled={loading} label={messages.initialInputLabel} id=\"identifier-input\" name=\"identifier\" />\n {messages.smsAccessCodeDisclaimer}\n </Box>\n <Button disabled={loading} type=\"submit\">\n {messages.initialCtaButtonLabel}\n </Button>\n </form>\n )\n case 'signUp':\n return (\n <form\n ref={formRef}\n {...formProps}\n onInvalid={(e) => {\n e.preventDefault()\n }}\n >\n <TextField\n disabled={loading}\n label={messages.signUpPhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n inputProps={{\n required: showV2 || !signUpEmailValue,\n }}\n defaultValue={state.context.phone}\n />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n id=\"name-input\"\n name=\"name\"\n onChange={checkFieldValidity}\n error={showNameErrorText}\n inputProps={{ required: true }}\n defaultValue={state.context.name}\n />\n <TextField\n disabled={loading}\n label={messages.signUpEmailInputLabel}\n id=\"email-input\"\n name=\"email\"\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n onChange={checkFieldValidity}\n inputProps={{\n required: showV2 || !signUpPhoneValue,\n type: 'email',\n }}\n defaultValue={state.context.email}\n />\n <LocationAndBirthday\n checkFieldValidity={checkFieldValidity}\n classes={classes}\n loading={loading}\n locationOptions={locationOptions}\n messages={messages}\n showLocationErrorText={showLocationErrorText}\n showV2={showV2}\n />\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"flex-start\" gridGap={2} width=\"100%\">\n {showSubscribeEmail && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-email\" name=\"subscribeEmail\" disabled={loading} color=\"primary\" />}\n label={\n <Typography className={classes.checkboxLabel}>{messages.subscribeEmailCheckboxLabel}</Typography>\n }\n />\n )}\n {showSubscribeSms && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-sms\" name=\"subscribeSms\" disabled={loading} color=\"primary\" />}\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeSmsCheckboxLabel}</Typography>}\n />\n )}\n </Box>\n <FollowerAuthenticationPrivacyPolicy />\n <Button disabled={loading || !formValidity} type=\"submit\">\n {messages.signUp}\n </Button>\n </form>\n )\n case 'emailFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.emailFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'emailAuthCode':\n return (\n <form {...formProps}>\n <TextField disabled={loading} label={messages.emailAuthCodeInputLabel} id=\"code-input\" name=\"code\" />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'emailMagicLinkSent':\n return (\n <Button\n disabled={loading}\n onClick={() => {\n onActionButtonClick('close')\n }}\n >\n {messages.emailMagicLinkSentCtaButtonLabel}\n </Button>\n )\n case 'indirectUserFound': {\n const isEmail = Boolean(state.context.email)\n const isPhone = Boolean(state.context.phone)\n if (!isEmail && !isPhone) return null\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={isEmail ? messages.emailFoundInputLabel : messages.phoneFoundInputLabel}\n id={isEmail ? 'email-input' : 'phone-input'}\n name={isEmail ? 'email' : 'phone'}\n value={isEmail ? state.context.email : state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n }\n case 'emailPasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phoneFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.phoneFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'phoneAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneAuthCodeInputLabel}\n id=\"code-input\"\n name=\"code\"\n autoComplete=\"one-time-code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phonePasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'requirePhone':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.requirePhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.requirePhoneCtaButtonLabel}\n </Button>\n </form>\n )\n case 'completeProfile':\n return <FollowerAuthenticationUserForm />\n case 'confirmPendingEmail':\n return (\n <form {...formProps}>\n <TextField disabled={loading} label={messages.emailAuthCodeInputLabel} id=\"code-input\" name=\"code\" />\n <Button disabled={loading} type=\"submit\">\n {messages.confirmPendingEmailCtaButtonLabel}\n </Button>\n </form>\n )\n case 'welcome':\n return null\n default:\n return null\n }\n}\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,WAAW;AAC5B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,OAAO,EAAE,EAAE;AACX,QAA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AAQ,CAAC,iCAAiC,CACpC,CACJ;AAEX,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,IAAI;AACb,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;;;;"}
|
|
1
|
+
{"version":3,"file":"FollowerAuthenticationForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, ReactNode, useEffect, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Button, Checkbox, FormControlLabel, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\nimport { FollowerAuthenticationUserForm } from './FollowerAuthenticationUserForm'\nimport { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy'\nimport { validatePhoneNumber } from './phoneValidation'\nimport { renderSelectValue } from '../../util/selectDisplay'\n\nconst useStyles = makeStyles({\n checkboxLabel: {\n '& > a': {\n textDecoration: 'underline',\n },\n fontSize: '0.75rem',\n },\n form: {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gridGap: 16,\n width: '100%',\n },\n label: {\n alignSelf: 'start',\n fontSize: '0.85rem',\n },\n})\n\ntype LocationAndBirthdayProps = {\n checkFieldValidity: ChangeEventHandler<HTMLInputElement>\n classes: { label: string }\n loading: boolean\n locationOptions: { label: string; value: string }[]\n messages: Record<MessageKey, ReactNode>\n showLocationErrorText: boolean | undefined\n showV2: boolean | undefined\n}\n\nfunction LocationAndBirthday({\n checkFieldValidity,\n classes,\n loading,\n locationOptions,\n messages,\n showLocationErrorText,\n showV2,\n}: LocationAndBirthdayProps) {\n const locationItems = locationOptions.map((locationOption) => (\n <MenuItem data-cy={'option'} key={locationOption.value} value={locationOption.value}>\n {locationOption.label}\n </MenuItem>\n ))\n\n const locationSelect = (\n <TextField\n disabled={loading}\n select\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n id=\"location-input\"\n inputProps={{ required: true }}\n name=\"location\"\n SelectProps={{ displayEmpty: true, renderValue: renderSelectValue(locationItems) }}\n >\n {locationItems}\n </TextField>\n )\n\n if (showV2) {\n return (\n <>\n <Box display=\"flex\" flexDirection=\"column\" gridGap={4} style={{ width: '100%' }}>\n <Typography className={classes.label}>{messages.signUpBirthdaySectionLabel}</Typography>\n <Box display=\"flex\" gridGap={16}>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n style={{ flex: 1 }}\n />\n <TextField\n disabled={loading}\n label={messages.signUpDayInputLabel}\n id=\"birthday-date-input\"\n name=\"birthdayDate\"\n style={{ flex: 1 }}\n />\n </Box>\n </Box>\n {locationSelect}\n </>\n )\n }\n\n return (\n <>\n {locationSelect}\n <Typography style={{ alignSelf: 'start' }}>{messages.signUpBirthdaySectionLabel}</Typography>\n <TextField\n disabled={loading}\n label={messages.signUpMonthInputLabel}\n id=\"birthday-month-input\"\n name=\"birthdayMonth\"\n />\n <TextField disabled={loading} label={messages.signUpDayInputLabel} id=\"birthday-date-input\" name=\"birthdayDate\" />\n </>\n )\n}\n\nexport const FollowerAuthenticationForm = () => {\n const {\n state,\n messages,\n locationOptions,\n onActionButtonClick,\n loading,\n showV2,\n showSubscribeEmail,\n showSubscribeSms,\n } = useFollowerAuthenticationDialogContext()\n const classes = useStyles()\n\n // sign-up form state\n const formRef = useRef<HTMLFormElement>(null)\n const [formValidity, setFormValidity] = useState(false)\n const [showNameErrorText, setShowNameErrorText] = useState<boolean | undefined>()\n const [showPhoneErrorText, setShowPhoneErrorText] = useState<boolean | undefined>()\n const [showEmailErrorText, setShowEmailErrorText] = useState<boolean | undefined>()\n const [showLocationErrorText, setShowLocationErrorText] = useState<boolean | undefined>()\n const [signUpNameValue, setSignUpNameValue] = useState(state.context.name || '')\n const [signUpPhoneValue, setSignUpPhoneValue] = useState(state.context.phone || '')\n const [signUpEmailValue, setSignUpEmailValue] = useState(state.context.email || '')\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'name':\n const isNameValid = fieldValue.length > 0\n setSignUpNameValue(fieldValue)\n setShowNameErrorText(!isNameValid)\n break\n case 'phone':\n const isPhoneValid = validatePhoneNumber(fieldValue)\n setSignUpPhoneValue(fieldValue)\n setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0)\n break\n case 'email':\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setSignUpEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n case 'location':\n setShowLocationErrorText(!fieldValue)\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n setSignUpNameValue(state.context.name || '')\n setSignUpPhoneValue(state.context.phone || '')\n setSignUpEmailValue(state.context.email || '')\n }, [state.context.name, state.context.phone, state.context.email])\n\n useEffect(() => {\n // Validate pre-filled values (only in signUp state)\n if (state.value === 'signUp') {\n if (signUpPhoneValue) {\n const isPhoneValid = validatePhoneNumber(signUpPhoneValue)\n setShowPhoneErrorText(!isPhoneValid)\n }\n if (signUpEmailValue) {\n const emailField = formRef.current?.elements.namedItem('email') as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setShowEmailErrorText(!isEmailValid)\n }\n }\n\n const hasValidName = Boolean(signUpNameValue) && !showNameErrorText\n const hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText\n const hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText\n\n const locationField = formRef.current?.elements.namedItem('location') as HTMLInputElement\n const hasValidLocation = locationField ? Boolean(locationField.value) : true\n\n const hasValidContact = showV2 ? hasValidName && hasValidPhone && hasValidEmail : hasValidPhone || hasValidEmail\n setFormValidity(hasValidContact && hasValidLocation)\n }, [\n showV2,\n state.value,\n signUpPhoneValue,\n signUpEmailValue,\n showPhoneErrorText,\n showEmailErrorText,\n showLocationErrorText,\n signUpNameValue,\n showNameErrorText,\n ])\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const form = e.target as HTMLFormElement\n const formData = new FormData(form)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n if (state.value === 'signUp') {\n values.subscribeEmail = String(formData.has('subscribeEmail'))\n values.subscribeSms = String(formData.has('subscribeSms'))\n }\n onActionButtonClick('submit-form', values)\n }\n const formProps = {\n key: state.value,\n id: 'follower-authentication-form',\n className: classes.form,\n onSubmit: handleSubmit,\n }\n switch (state.value) {\n case 'initial':\n return (\n <form {...formProps}>\n <Box alignSelf=\"stretch\" display=\"flex\" flexDirection=\"column\" width=\"100%\">\n <TextField disabled={loading} label={messages.initialInputLabel} id=\"identifier-input\" name=\"identifier\" />\n {messages.smsAccessCodeDisclaimer}\n </Box>\n <Button disabled={loading} type=\"submit\">\n {messages.initialCtaButtonLabel}\n </Button>\n </form>\n )\n case 'signUp':\n return (\n <form\n ref={formRef}\n {...formProps}\n onInvalid={(e) => {\n e.preventDefault()\n }}\n >\n <TextField\n disabled={loading}\n label={messages.signUpPhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n inputProps={{\n required: showV2 || !signUpEmailValue,\n }}\n defaultValue={state.context.phone}\n />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n id=\"name-input\"\n name=\"name\"\n onChange={checkFieldValidity}\n error={showNameErrorText}\n inputProps={{ required: true }}\n defaultValue={state.context.name}\n />\n <TextField\n disabled={loading}\n label={messages.signUpEmailInputLabel}\n id=\"email-input\"\n name=\"email\"\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n onChange={checkFieldValidity}\n inputProps={{\n required: showV2 || !signUpPhoneValue,\n type: 'email',\n }}\n defaultValue={state.context.email}\n />\n <LocationAndBirthday\n checkFieldValidity={checkFieldValidity}\n classes={classes}\n loading={loading}\n locationOptions={locationOptions}\n messages={messages}\n showLocationErrorText={showLocationErrorText}\n showV2={showV2}\n />\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"flex-start\" gridGap={2} width=\"100%\">\n {showSubscribeEmail && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-email\" name=\"subscribeEmail\" disabled={loading} color=\"primary\" />}\n label={\n <Typography className={classes.checkboxLabel}>{messages.subscribeEmailCheckboxLabel}</Typography>\n }\n />\n )}\n {showSubscribeSms && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={<Checkbox id=\"subscribe-sms\" name=\"subscribeSms\" disabled={loading} color=\"primary\" />}\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeSmsCheckboxLabel}</Typography>}\n />\n )}\n </Box>\n <FollowerAuthenticationPrivacyPolicy />\n <Button disabled={loading || !formValidity} type=\"submit\">\n {messages.signUp}\n </Button>\n </form>\n )\n case 'emailFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.emailFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'emailAuthCode':\n return (\n <form {...formProps}>\n <TextField disabled={loading} label={messages.emailAuthCodeInputLabel} id=\"code-input\" name=\"code\" />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'emailMagicLinkSent':\n return (\n <Button\n disabled={loading}\n onClick={() => {\n onActionButtonClick('close')\n }}\n >\n {messages.emailMagicLinkSentCtaButtonLabel}\n </Button>\n )\n case 'indirectUserFound': {\n const isEmail = Boolean(state.context.email)\n const isPhone = Boolean(state.context.phone)\n if (!isEmail && !isPhone) return null\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={isEmail ? messages.emailFoundInputLabel : messages.phoneFoundInputLabel}\n id={isEmail ? 'email-input' : 'phone-input'}\n name={isEmail ? 'email' : 'phone'}\n value={isEmail ? state.context.email : state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.indirectUserFoundCtaButtonLabel}\n </Button>\n </form>\n )\n }\n case 'emailPasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.emailFoundInputLabel}\n id=\"email-input\"\n name=\"email\"\n value={state.context.email}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phoneFound':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.phoneFoundCtaButtonLabel}\n </Button>\n </form>\n )\n case 'phoneAuthCode':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneAuthCodeInputLabel}\n id=\"code-input\"\n name=\"code\"\n autoComplete=\"one-time-code\"\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'phonePasswordSignIn':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.phoneFoundInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n InputLabelProps={{ shrink: true }}\n />\n <TextField\n disabled={loading}\n label={messages.passwordInputLabel}\n id=\"password-input\"\n name=\"password\"\n inputProps={{ type: 'password' }}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.signIn}\n </Button>\n </form>\n )\n case 'requirePhone':\n return (\n <form {...formProps}>\n <TextField\n disabled={loading}\n label={messages.requirePhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n value={state.context.phone}\n />\n <Button disabled={loading} type=\"submit\">\n {messages.requirePhoneCtaButtonLabel}\n </Button>\n </form>\n )\n case 'completeProfile':\n return <FollowerAuthenticationUserForm />\n case 'confirmPendingEmail':\n return (\n <form {...formProps}>\n <TextField disabled={loading} label={messages.emailAuthCodeInputLabel} id=\"code-input\" name=\"code\" />\n <Button disabled={loading} type=\"submit\">\n {messages.confirmPendingEmailCtaButtonLabel}\n </Button>\n </form>\n )\n case 'welcome':\n return null\n default:\n return null\n }\n}\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,WAAW;AAC5B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE,OAAO;AAClB,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACF,CAAA,CAAC;AAYF,SAAS,mBAAmB,CAAC,EAC3B,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,eAAe,EACf,QAAQ,EACR,qBAAqB,EACrB,MAAM,GACmB,EAAA;AACzB,IAAA,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,MACvD,KAAC,CAAA,aAAA,CAAA,QAAQ,eAAU,QAAQ,EAAE,GAAG,EAAE,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAA,EAChF,cAAc,CAAC,KAAK,CACZ,CACZ,CAAC;AAEF,IAAA,MAAM,cAAc,IAClB,KAAA,CAAA,aAAA,C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,iCAAU,SAAS,EAAA;gBACjB,KAAC,CAAA,aAAA,CAAA,SAAS,EACR,EAAA,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,QAAQ,CAAC,sBAAsB,EACtC,EAAE,EAAC,aAAa,EAChB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAC1B,CAAA;AACF,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAA,EACrC,QAAQ,CAAC,0BAA0B,CAC7B,CACJ;AAEX,QAAA,KAAK,iBAAiB;YACpB,OAAO,KAAA,CAAA,aAAA,CAAC,8BAA8B,EAAA,IAAA,CAAG;AAC3C,QAAA,KAAK,qBAAqB;YACxB,QACE,iCAAU,SAAS,EAAA;AACjB,gBAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAC,EAAA,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,uBAAuB,EAAE,EAAE,EAAC,YAAY,EAAC,IAAI,EAAC,MAAM,EAAG,CAAA;AACrG,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAA,EACrC,QAAQ,CAAC,iCAAiC,CACpC,CACJ;AAEX,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,IAAI;AACb,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;;;;"}
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { useFollowerAuthenticationDialogContext } from './context.js';
|
|
3
3
|
import { Box, Typography } from '@material-ui/core';
|
|
4
4
|
|
|
5
|
-
const FollowerAuthenticationTitle = () => {
|
|
5
|
+
const FollowerAuthenticationTitle = ({ id }) => {
|
|
6
6
|
const { state, messages } = useFollowerAuthenticationDialogContext();
|
|
7
7
|
const title = messages[`${state.value}Title`];
|
|
8
8
|
return (React.createElement(Box, null,
|
|
9
|
-
React.createElement(Typography, { variant: "h1", align: "center" }, title)));
|
|
9
|
+
React.createElement(Typography, { variant: "h1", align: "center", id: id }, title)));
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export { FollowerAuthenticationTitle };
|
package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowerAuthenticationTitle.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\n\nexport const FollowerAuthenticationTitle = () => {\n const { state, messages } = useFollowerAuthenticationDialogContext()\n const title = messages[`${state.value}Title` as MessageKey]\n return (\n <Box>\n <Typography variant=\"h1\" align=\"center\">\n {title}\n </Typography>\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"FollowerAuthenticationTitle.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.tsx"],"sourcesContent":["import React from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Typography } from '@material-ui/core'\nimport { MessageKey } from './FollowerAuthenticationDialogProps'\n\nexport const FollowerAuthenticationTitle = ({ id }: { id?: string }) => {\n const { state, messages } = useFollowerAuthenticationDialogContext()\n const title = messages[`${state.value}Title` as MessageKey]\n return (\n <Box>\n <Typography variant=\"h1\" align=\"center\" id={id}>\n {title}\n </Typography>\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;MAKa,2BAA2B,GAAG,CAAC,EAAE,EAAE,EAAmB,KAAI;IACrE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,sCAAsC,EAAE;IACpE,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAA,EAAG,KAAK,CAAC,KAAK,CAAqB,KAAA,CAAA,CAAC;IAC3D,QACE,oBAAC,GAAG,EAAA,IAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAC,EAAA,OAAO,EAAC,IAAI,EAAC,KAAK,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,EAAA,EAC3C,KAAK,CACK,CACT;AAEV;;;;"}
|
|
@@ -4,6 +4,7 @@ import { makeStyles, TextField, MenuItem, Box, FormControlLabel, Typography, Che
|
|
|
4
4
|
import { Divider } from '../Divider/Divider.js';
|
|
5
5
|
import { formatPhoneNumber, validatePhoneNumber } from './phoneValidation.js';
|
|
6
6
|
import { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy.js';
|
|
7
|
+
import { renderSelectValue } from '../../util/selectDisplay.js';
|
|
7
8
|
|
|
8
9
|
const getDaysInMonth = (month) => {
|
|
9
10
|
const m = parseInt(month, 10);
|
|
@@ -48,8 +49,9 @@ const useStyles = makeStyles((theme) => ({
|
|
|
48
49
|
pickerField: {
|
|
49
50
|
flex: 1,
|
|
50
51
|
},
|
|
51
|
-
// Heard
|
|
52
|
-
|
|
52
|
+
// Heard as part of a field name without being seen. The visible equivalents are
|
|
53
|
+
// either aria-hidden, like the section heading, or the required asterisk MUI draws.
|
|
54
|
+
visuallyHidden: {
|
|
53
55
|
border: 0,
|
|
54
56
|
clip: 'rect(0 0 0 0)',
|
|
55
57
|
height: 1,
|
|
@@ -61,14 +63,23 @@ const useStyles = makeStyles((theme) => ({
|
|
|
61
63
|
width: 1,
|
|
62
64
|
},
|
|
63
65
|
}));
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
|
|
66
|
+
// Popup button, matching the checkout quantity select. aria-expanded stays present
|
|
67
|
+
// while closed so VoiceOver announces collapsed; MUI would otherwise omit it until
|
|
68
|
+
// the list opens. A button cannot take aria-required, so the required state rides
|
|
69
|
+
// along in the field name instead.
|
|
70
|
+
const SelectField = ({ required = false, id, SelectProps, children, label, ...textFieldProps }) => {
|
|
71
|
+
const classes = useStyles();
|
|
72
|
+
const { messages } = useFollowerAuthenticationDialogContext();
|
|
67
73
|
const [open, setOpen] = useState(false);
|
|
68
74
|
const listboxId = `${id}-listbox`;
|
|
69
|
-
return (React.createElement(TextField, { ...textFieldProps, id: id, select: true, required: required,
|
|
75
|
+
return (React.createElement(TextField, { ...textFieldProps, id: id, select: true, required: required, label: required ? (React.createElement(React.Fragment, null,
|
|
76
|
+
label,
|
|
77
|
+
React.createElement("span", { className: classes.visuallyHidden },
|
|
78
|
+
" ",
|
|
79
|
+
messages.requiredFieldLabel ?? 'required'))) : (label), SelectProps: {
|
|
70
80
|
...SelectProps,
|
|
71
|
-
|
|
81
|
+
displayEmpty: true,
|
|
82
|
+
renderValue: renderSelectValue(children),
|
|
72
83
|
onOpen: (event) => {
|
|
73
84
|
setOpen(true);
|
|
74
85
|
SelectProps?.onOpen?.(event);
|
|
@@ -88,12 +99,9 @@ const SelectField = ({ required = false, id, SelectProps, children, ...textField
|
|
|
88
99
|
},
|
|
89
100
|
SelectDisplayProps: {
|
|
90
101
|
...SelectProps?.SelectDisplayProps,
|
|
91
|
-
role: 'combobox',
|
|
92
|
-
'aria-autocomplete': 'none',
|
|
93
|
-
'aria-expanded': open,
|
|
94
102
|
'aria-controls': listboxId,
|
|
103
|
+
'aria-expanded': open,
|
|
95
104
|
'aria-haspopup': 'listbox',
|
|
96
|
-
'aria-required': required ? true : undefined,
|
|
97
105
|
},
|
|
98
106
|
} }, children));
|
|
99
107
|
};
|
|
@@ -101,7 +109,7 @@ const MonthDayPicker = ({ sectionLabel, monthLabel, dayLabel, monthId, dayId, mo
|
|
|
101
109
|
const classes = useStyles();
|
|
102
110
|
const dayOptions = useMemo(() => Array.from({ length: getDaysInMonth(monthValue) }, (_, i) => ({ label: String(i + 1), value: String(i + 1) })), [monthValue]);
|
|
103
111
|
const fieldLabel = (label) => (React.createElement(React.Fragment, null,
|
|
104
|
-
React.createElement("span", { className: classes.
|
|
112
|
+
React.createElement("span", { className: classes.visuallyHidden },
|
|
105
113
|
sectionLabel,
|
|
106
114
|
" "),
|
|
107
115
|
label));
|
package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowerAuthenticationUserForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Button, Checkbox, FormControlLabel, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\nimport { Divider } from '../Divider'\nimport { validatePhoneNumber, formatPhoneNumber } from './phoneValidation'\nimport { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy'\n\nconst getDaysInMonth = (month: string): number => {\n const m = parseInt(month, 10)\n if (!m) return 31\n // Allow 29 for Feb to support leap year birthdays/anniversaries\n const days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n return days[m - 1]\n}\n\nconst useStyles = makeStyles((theme) => ({\n checkboxLabel: {\n '& > a': {\n textDecoration: 'underline',\n },\n fontSize: '0.75rem',\n },\n form: {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gridGap: 16,\n width: '100%',\n },\n sectionLabel: {\n alignSelf: 'start',\n fontSize: '0.75rem',\n },\n divider: {\n width: '100%',\n },\n pickerContainer: {\n display: 'flex',\n flexDirection: 'column',\n gridGap: theme.spacing(1),\n width: '100%',\n },\n pickerFieldsRow: {\n display: 'flex',\n gridGap: theme.spacing(2),\n width: '100%',\n },\n pickerField: {\n flex: 1,\n },\n // Heard only as part of the field name. The visible section heading is aria-hidden.\n groupName: {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: 1,\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: 1,\n },\n}))\n\ntype SelectFieldProps = Omit<React.ComponentProps<typeof TextField>, 'select'> & {\n id: string\n}\n\n// MUI 4 draws a select as role=\"button\", and that role cannot be required.\n// The visible control is a combobox so aria-required is valid and announced.\nconst SelectField = ({ required = false, id, SelectProps, children, ...textFieldProps }: SelectFieldProps) => {\n const [open, setOpen] = useState(false)\n const listboxId = `${id}-listbox`\n\n return (\n <TextField\n {...textFieldProps}\n id={id}\n select\n required={required}\n SelectProps={{\n ...SelectProps,\n open,\n onOpen: (event) => {\n setOpen(true)\n SelectProps?.onOpen?.(event)\n },\n onClose: (event) => {\n setOpen(false)\n SelectProps?.onClose?.(event)\n },\n MenuProps: {\n ...SelectProps?.MenuProps,\n // Keeps the listbox in the DOM so aria-controls always resolves.\n keepMounted: true,\n MenuListProps: {\n ...SelectProps?.MenuProps?.MenuListProps,\n id: listboxId,\n },\n },\n SelectDisplayProps: {\n ...SelectProps?.SelectDisplayProps,\n role: 'combobox',\n 'aria-autocomplete': 'none',\n 'aria-expanded': open,\n 'aria-controls': listboxId,\n 'aria-haspopup': 'listbox',\n 'aria-required': required ? true : undefined,\n },\n }}\n >\n {children}\n </TextField>\n )\n}\n\ntype MonthDayPickerProps = {\n sectionLabel: ReactNode\n monthLabel: ReactNode\n dayLabel: ReactNode\n monthId: string\n dayId: string\n monthName: string\n dayName: string\n monthValue: string\n dayValue: string\n onMonthChange: (value: string) => void\n onDayChange: (value: string) => void\n required: boolean\n disabled: boolean\n monthOptions: { label: ReactNode; value: string }[]\n}\n\nconst MonthDayPicker = ({\n sectionLabel,\n monthLabel,\n dayLabel,\n monthId,\n dayId,\n monthName,\n dayName,\n monthValue,\n dayValue,\n onMonthChange,\n onDayChange,\n required,\n disabled,\n monthOptions,\n}: MonthDayPickerProps) => {\n const classes = useStyles()\n const dayOptions = useMemo(\n () =>\n Array.from({ length: getDaysInMonth(monthValue) }, (_, i) => ({ label: String(i + 1), value: String(i + 1) })),\n [monthValue],\n )\n const fieldLabel = (label: ReactNode) => (\n <>\n <span className={classes.groupName}>{sectionLabel} </span>\n {label}\n </>\n )\n\n return (\n <Box className={classes.pickerContainer}>\n <Typography aria-hidden=\"true\" className={classes.sectionLabel}>\n {sectionLabel}\n </Typography>\n <Box className={classes.pickerFieldsRow}>\n <SelectField\n disabled={disabled}\n label={fieldLabel(monthLabel)}\n id={monthId}\n name={monthName}\n value={monthValue}\n onChange={(e) => {\n const newMonth = e.target.value\n onMonthChange(newMonth)\n if (dayValue && parseInt(dayValue, 10) > getDaysInMonth(newMonth)) {\n onDayChange('')\n }\n }}\n required={required || Boolean(dayValue)}\n className={classes.pickerField}\n >\n {monthOptions.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n <SelectField\n disabled={disabled}\n label={fieldLabel(dayLabel)}\n id={dayId}\n name={dayName}\n value={dayValue}\n onChange={(e) => onDayChange(e.target.value)}\n required={required || Boolean(monthValue)}\n className={classes.pickerField}\n >\n {dayOptions.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n </Box>\n </Box>\n )\n}\n\nexport const FollowerAuthenticationUserForm = () => {\n const {\n state,\n messages,\n locationOptions,\n onActionButtonClick,\n loading,\n signInMethod,\n signUpSetting,\n showSubscribeEmail,\n showSubscribeSms,\n subscribeEmail,\n subscribeSms,\n } = useFollowerAuthenticationDialogContext()\n\n const showPhone = signUpSetting?.phone?.enabled !== false\n const phoneRequired = signUpSetting?.phone?.required ?? false\n const showBirthday = signUpSetting?.birthday?.enabled !== false\n const birthdayRequired = signUpSetting?.birthday?.required ?? false\n const showWeddingAnniversary = signUpSetting?.weddingAnniversary?.enabled !== false\n const weddingAnniversaryRequired = signUpSetting?.weddingAnniversary?.required ?? false\n\n const emailIsLocked = signInMethod !== undefined ? signInMethod === 'email' : Boolean(state.context.email)\n const phoneIsLocked = Boolean(state.context.phone)\n\n const classes = useStyles()\n const formRef = useRef<HTMLFormElement>(null)\n\n const [showNameErrorText, setShowNameErrorText] = useState(false)\n const [showEmailErrorText, setShowEmailErrorText] = useState(false)\n const [showPhoneErrorText, setShowPhoneErrorText] = useState(false)\n const [showLocationErrorText, setShowLocationErrorText] = useState(false)\n\n const [nameValue, setNameValue] = useState(state.context.name || '')\n const [emailValue, setEmailValue] = useState(state.context.email || '')\n const [phoneValue, setPhoneValue] = useState(formatPhoneNumber(state.context.phone || ''))\n const [locationValue, setLocationValue] = useState(\n state.context.favoriteLocationId ? String(state.context.favoriteLocationId) : '',\n )\n const [selectedBirthMonth, setSelectedBirthMonth] = useState(\n state.context.birthMonth ? String(state.context.birthMonth) : '',\n )\n const [selectedBirthDay, setSelectedBirthDay] = useState(state.context.birthDay ? String(state.context.birthDay) : '')\n const [selectedWeddingMonth, setSelectedWeddingMonth] = useState(\n state.context.weddingMonth ? String(state.context.weddingMonth) : '',\n )\n const [selectedWeddingDay, setSelectedWeddingDay] = useState(\n state.context.weddingDay ? String(state.context.weddingDay) : '',\n )\n const [subscribeEmailChecked, setSubscribeEmailChecked] = useState(Boolean(subscribeEmail))\n const [subscribeSmsChecked, setSubscribeSmsChecked] = useState(Boolean(subscribeSms))\n\n useEffect(() => {\n setSubscribeEmailChecked(Boolean(subscribeEmail))\n }, [subscribeEmail])\n\n useEffect(() => {\n setSubscribeSmsChecked(Boolean(subscribeSms))\n }, [subscribeSms])\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'name': {\n setNameValue(fieldValue)\n setShowNameErrorText(fieldValue.length === 0)\n break\n }\n case 'email': {\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n }\n case 'phone': {\n const formatted = formatPhoneNumber(fieldValue)\n setPhoneValue(formatted)\n setShowPhoneErrorText(formatted.length > 0 && !validatePhoneNumber(formatted))\n break\n }\n case 'location': {\n setLocationValue(fieldValue)\n setShowLocationErrorText(!fieldValue)\n break\n }\n default:\n break\n }\n }\n\n const isFormValid = useMemo(() => {\n const hasValidName = Boolean(nameValue) && !showNameErrorText\n const hasValidEmail = emailIsLocked ? Boolean(state.context.email) : Boolean(emailValue) && !showEmailErrorText\n const hasValidPhone = showPhone\n ? phoneIsLocked\n ? Boolean(state.context.phone)\n : phoneRequired\n ? validatePhoneNumber(phoneValue)\n : !phoneValue || validatePhoneNumber(phoneValue)\n : true\n const hasValidLocation = locationOptions.length > 0 ? Boolean(locationValue) : true\n // A partial date (only month or only day) requires completing the pair\n const hasValidBirthday =\n !showBirthday ||\n (birthdayRequired || selectedBirthMonth || selectedBirthDay\n ? Boolean(selectedBirthMonth) && Boolean(selectedBirthDay)\n : true)\n const hasValidWeddingAnniversary =\n !showWeddingAnniversary ||\n (weddingAnniversaryRequired || selectedWeddingMonth || selectedWeddingDay\n ? Boolean(selectedWeddingMonth) && Boolean(selectedWeddingDay)\n : true)\n return (\n hasValidName &&\n hasValidEmail &&\n hasValidPhone &&\n hasValidLocation &&\n hasValidBirthday &&\n hasValidWeddingAnniversary\n )\n }, [\n nameValue,\n emailValue,\n phoneValue,\n emailIsLocked,\n phoneIsLocked,\n state.context.email,\n state.context.phone,\n locationValue,\n locationOptions.length,\n showNameErrorText,\n showEmailErrorText,\n showPhone,\n phoneRequired,\n showBirthday,\n birthdayRequired,\n selectedBirthMonth,\n selectedBirthDay,\n showWeddingAnniversary,\n weddingAnniversaryRequired,\n selectedWeddingMonth,\n selectedWeddingDay,\n ])\n\n const monthOptions = useMemo(\n () => [\n { label: messages.signUpMonthJanuary, value: '1' },\n { label: messages.signUpMonthFebruary, value: '2' },\n { label: messages.signUpMonthMarch, value: '3' },\n { label: messages.signUpMonthApril, value: '4' },\n { label: messages.signUpMonthMay, value: '5' },\n { label: messages.signUpMonthJune, value: '6' },\n { label: messages.signUpMonthJuly, value: '7' },\n { label: messages.signUpMonthAugust, value: '8' },\n { label: messages.signUpMonthSeptember, value: '9' },\n { label: messages.signUpMonthOctober, value: '10' },\n { label: messages.signUpMonthNovember, value: '11' },\n { label: messages.signUpMonthDecember, value: '12' },\n ],\n [messages],\n )\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const formData = new FormData(e.target as HTMLFormElement)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n // Disabled fields are excluded from FormData — restore the locked identifier from context\n if (emailIsLocked && !values.email && state.context.email) values.email = state.context.email\n if (phoneIsLocked && !values.phone && state.context.phone) values.phone = state.context.phone\n // Strip display formatting so the submitted value is consistent with the disabled-field path\n if (values.phone) {\n values.phone = values.phone.replace(/[^\\d+]/g, '')\n }\n if (showSubscribeEmail) {\n values.subscribeEmail = String(formData.has('subscribeEmail'))\n }\n if (showSubscribeSms) {\n values.subscribeSms = String(formData.has('subscribeSms'))\n }\n onActionButtonClick('submit-form', values)\n }\n\n return (\n <form\n ref={formRef}\n id=\"follower-authentication-user-form\"\n className={classes.form}\n onSubmit={handleSubmit}\n onInvalid={(e) => e.preventDefault()}\n >\n <TextField\n disabled={loading || emailIsLocked}\n label={messages.signUpEmailInputLabel}\n id=\"email-input\"\n name=\"email\"\n onChange={checkFieldValidity}\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n inputProps={{ type: 'email' }}\n required={!emailIsLocked}\n value={emailValue}\n fullWidth\n />\n <Divider className={classes.divider} />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n id=\"name-input\"\n name=\"name\"\n onChange={checkFieldValidity}\n error={showNameErrorText}\n helperText={showNameErrorText && messages.signUpNameErrorText}\n required\n value={nameValue}\n fullWidth\n />\n {showPhone && (\n <TextField\n disabled={loading || phoneIsLocked}\n label={messages.signUpPhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n required={phoneRequired && !phoneIsLocked}\n value={phoneValue}\n fullWidth\n />\n )}\n {locationOptions.length > 0 && (\n <SelectField\n disabled={loading}\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n id=\"location-input\"\n name=\"location\"\n value={locationValue}\n required\n fullWidth\n >\n {locationOptions.map((option) => (\n <MenuItem data-cy=\"option\" key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n )}\n {(showBirthday || showWeddingAnniversary) && <Divider className={classes.divider} />}\n {showBirthday && (\n <MonthDayPicker\n sectionLabel={messages.signUpBirthdaySectionLabel}\n monthLabel={messages.signUpMonthInputLabel}\n dayLabel={messages.signUpDayInputLabel}\n monthId=\"birthday-month-input\"\n dayId=\"birthday-date-input\"\n monthName=\"birthMonth\"\n dayName=\"birthDay\"\n monthValue={selectedBirthMonth}\n dayValue={selectedBirthDay}\n onMonthChange={setSelectedBirthMonth}\n onDayChange={setSelectedBirthDay}\n required={birthdayRequired}\n disabled={loading}\n monthOptions={monthOptions}\n />\n )}\n {showWeddingAnniversary && (\n <MonthDayPicker\n sectionLabel={messages.signUpWeddingAnniversarySectionLabel}\n monthLabel={messages.signUpMonthInputLabel}\n dayLabel={messages.signUpDayInputLabel}\n monthId=\"wedding-month-input\"\n dayId=\"wedding-date-input\"\n monthName=\"weddingMonth\"\n dayName=\"weddingDay\"\n monthValue={selectedWeddingMonth}\n dayValue={selectedWeddingDay}\n onMonthChange={setSelectedWeddingMonth}\n onDayChange={setSelectedWeddingDay}\n required={weddingAnniversaryRequired}\n disabled={loading}\n monthOptions={monthOptions}\n />\n )}\n {(showSubscribeEmail || showSubscribeSms) && (\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"flex-start\" gridGap={2} width=\"100%\">\n {showSubscribeEmail && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={\n <Checkbox\n id=\"subscribe-email\"\n name=\"subscribeEmail\"\n disabled={loading}\n color=\"primary\"\n checked={subscribeEmailChecked}\n onChange={(e) => setSubscribeEmailChecked(e.target.checked)}\n />\n }\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeEmailCheckboxLabel}</Typography>}\n />\n )}\n {showSubscribeSms && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={\n <Checkbox\n id=\"subscribe-sms\"\n name=\"subscribeSms\"\n disabled={loading}\n color=\"primary\"\n checked={subscribeSmsChecked}\n onChange={(e) => setSubscribeSmsChecked(e.target.checked)}\n />\n }\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeSmsCheckboxLabel}</Typography>}\n />\n )}\n </Box>\n )}\n <FollowerAuthenticationPrivacyPolicy />\n <Button disabled={loading || !isFormValid} type=\"submit\">\n {messages.completeProfileCtaButtonLabel}\n </Button>\n </form>\n )\n}\n"],"names":[],"mappings":";;;;;;;AAOA,MAAM,cAAc,GAAG,CAAC,KAAa,KAAY;IAC/C,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;AAC7B,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,EAAE;;IAEjB,MAAM,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC7D,IAAA,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACvC,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,WAAW;AAC5B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,QAA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,OAAO,EACjB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACzD,CAAA,EAEJ,KAAK,EAAE,oBAAC,UAAU,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,aAAa,EAAG,EAAA,QAAQ,CAAC,yBAAyB,CAAc,EACtG,CAAA,CACH,CACG,CACP;AACD,QAAA,KAAA,CAAA,aAAA,CAAC,mCAAmC,EAAG,IAAA,CAAA;AACvC,QAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,EAAC,QAAQ,IACrD,QAAQ,CAAC,6BAA6B,CAChC,CACJ;AAEX;;;;"}
|
|
1
|
+
{"version":3,"file":"FollowerAuthenticationUserForm.js","sources":["../../../../src/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.tsx"],"sourcesContent":["import React, { ChangeEventHandler, ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { useFollowerAuthenticationDialogContext } from './context'\nimport { Box, Button, Checkbox, FormControlLabel, makeStyles, MenuItem, TextField, Typography } from '@material-ui/core'\nimport { Divider } from '../Divider'\nimport { validatePhoneNumber, formatPhoneNumber } from './phoneValidation'\nimport { FollowerAuthenticationPrivacyPolicy } from './FollowerAuthenticationPrivacyPolicy'\nimport { renderSelectValue } from '../../util/selectDisplay'\n\nconst getDaysInMonth = (month: string): number => {\n const m = parseInt(month, 10)\n if (!m) return 31\n // Allow 29 for Feb to support leap year birthdays/anniversaries\n const days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n return days[m - 1]\n}\n\nconst useStyles = makeStyles((theme) => ({\n checkboxLabel: {\n '& > a': {\n textDecoration: 'underline',\n },\n fontSize: '0.75rem',\n },\n form: {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gridGap: 16,\n width: '100%',\n },\n sectionLabel: {\n alignSelf: 'start',\n fontSize: '0.75rem',\n },\n divider: {\n width: '100%',\n },\n pickerContainer: {\n display: 'flex',\n flexDirection: 'column',\n gridGap: theme.spacing(1),\n width: '100%',\n },\n pickerFieldsRow: {\n display: 'flex',\n gridGap: theme.spacing(2),\n width: '100%',\n },\n pickerField: {\n flex: 1,\n },\n // Heard as part of a field name without being seen. The visible equivalents are\n // either aria-hidden, like the section heading, or the required asterisk MUI draws.\n visuallyHidden: {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: 1,\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: 1,\n },\n}))\n\ntype SelectFieldProps = Omit<React.ComponentProps<typeof TextField>, 'select'> & {\n id: string\n}\n\n// Popup button, matching the checkout quantity select. aria-expanded stays present\n// while closed so VoiceOver announces collapsed; MUI would otherwise omit it until\n// the list opens. A button cannot take aria-required, so the required state rides\n// along in the field name instead.\nconst SelectField = ({ required = false, id, SelectProps, children, label, ...textFieldProps }: SelectFieldProps) => {\n const classes = useStyles()\n const { messages } = useFollowerAuthenticationDialogContext()\n const [open, setOpen] = useState(false)\n const listboxId = `${id}-listbox`\n\n return (\n <TextField\n {...textFieldProps}\n id={id}\n select\n required={required}\n label={\n required ? (\n <>\n {label}\n <span className={classes.visuallyHidden}> {messages.requiredFieldLabel ?? 'required'}</span>\n </>\n ) : (\n label\n )\n }\n SelectProps={{\n ...SelectProps,\n displayEmpty: true,\n renderValue: renderSelectValue(children),\n onOpen: (event) => {\n setOpen(true)\n SelectProps?.onOpen?.(event)\n },\n onClose: (event) => {\n setOpen(false)\n SelectProps?.onClose?.(event)\n },\n MenuProps: {\n ...SelectProps?.MenuProps,\n // Keeps the listbox in the DOM so aria-controls always resolves.\n keepMounted: true,\n MenuListProps: {\n ...SelectProps?.MenuProps?.MenuListProps,\n id: listboxId,\n },\n },\n SelectDisplayProps: {\n ...SelectProps?.SelectDisplayProps,\n 'aria-controls': listboxId,\n 'aria-expanded': open,\n 'aria-haspopup': 'listbox',\n },\n }}\n >\n {children}\n </TextField>\n )\n}\n\ntype MonthDayPickerProps = {\n sectionLabel: ReactNode\n monthLabel: ReactNode\n dayLabel: ReactNode\n monthId: string\n dayId: string\n monthName: string\n dayName: string\n monthValue: string\n dayValue: string\n onMonthChange: (value: string) => void\n onDayChange: (value: string) => void\n required: boolean\n disabled: boolean\n monthOptions: { label: ReactNode; value: string }[]\n}\n\nconst MonthDayPicker = ({\n sectionLabel,\n monthLabel,\n dayLabel,\n monthId,\n dayId,\n monthName,\n dayName,\n monthValue,\n dayValue,\n onMonthChange,\n onDayChange,\n required,\n disabled,\n monthOptions,\n}: MonthDayPickerProps) => {\n const classes = useStyles()\n const dayOptions = useMemo(\n () =>\n Array.from({ length: getDaysInMonth(monthValue) }, (_, i) => ({ label: String(i + 1), value: String(i + 1) })),\n [monthValue],\n )\n const fieldLabel = (label: ReactNode) => (\n <>\n <span className={classes.visuallyHidden}>{sectionLabel} </span>\n {label}\n </>\n )\n\n return (\n <Box className={classes.pickerContainer}>\n <Typography aria-hidden=\"true\" className={classes.sectionLabel}>\n {sectionLabel}\n </Typography>\n <Box className={classes.pickerFieldsRow}>\n <SelectField\n disabled={disabled}\n label={fieldLabel(monthLabel)}\n id={monthId}\n name={monthName}\n value={monthValue}\n onChange={(e) => {\n const newMonth = e.target.value\n onMonthChange(newMonth)\n if (dayValue && parseInt(dayValue, 10) > getDaysInMonth(newMonth)) {\n onDayChange('')\n }\n }}\n required={required || Boolean(dayValue)}\n className={classes.pickerField}\n >\n {monthOptions.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n <SelectField\n disabled={disabled}\n label={fieldLabel(dayLabel)}\n id={dayId}\n name={dayName}\n value={dayValue}\n onChange={(e) => onDayChange(e.target.value)}\n required={required || Boolean(monthValue)}\n className={classes.pickerField}\n >\n {dayOptions.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n </Box>\n </Box>\n )\n}\n\nexport const FollowerAuthenticationUserForm = () => {\n const {\n state,\n messages,\n locationOptions,\n onActionButtonClick,\n loading,\n signInMethod,\n signUpSetting,\n showSubscribeEmail,\n showSubscribeSms,\n subscribeEmail,\n subscribeSms,\n } = useFollowerAuthenticationDialogContext()\n\n const showPhone = signUpSetting?.phone?.enabled !== false\n const phoneRequired = signUpSetting?.phone?.required ?? false\n const showBirthday = signUpSetting?.birthday?.enabled !== false\n const birthdayRequired = signUpSetting?.birthday?.required ?? false\n const showWeddingAnniversary = signUpSetting?.weddingAnniversary?.enabled !== false\n const weddingAnniversaryRequired = signUpSetting?.weddingAnniversary?.required ?? false\n\n const emailIsLocked = signInMethod !== undefined ? signInMethod === 'email' : Boolean(state.context.email)\n const phoneIsLocked = Boolean(state.context.phone)\n\n const classes = useStyles()\n const formRef = useRef<HTMLFormElement>(null)\n\n const [showNameErrorText, setShowNameErrorText] = useState(false)\n const [showEmailErrorText, setShowEmailErrorText] = useState(false)\n const [showPhoneErrorText, setShowPhoneErrorText] = useState(false)\n const [showLocationErrorText, setShowLocationErrorText] = useState(false)\n\n const [nameValue, setNameValue] = useState(state.context.name || '')\n const [emailValue, setEmailValue] = useState(state.context.email || '')\n const [phoneValue, setPhoneValue] = useState(formatPhoneNumber(state.context.phone || ''))\n const [locationValue, setLocationValue] = useState(\n state.context.favoriteLocationId ? String(state.context.favoriteLocationId) : '',\n )\n const [selectedBirthMonth, setSelectedBirthMonth] = useState(\n state.context.birthMonth ? String(state.context.birthMonth) : '',\n )\n const [selectedBirthDay, setSelectedBirthDay] = useState(state.context.birthDay ? String(state.context.birthDay) : '')\n const [selectedWeddingMonth, setSelectedWeddingMonth] = useState(\n state.context.weddingMonth ? String(state.context.weddingMonth) : '',\n )\n const [selectedWeddingDay, setSelectedWeddingDay] = useState(\n state.context.weddingDay ? String(state.context.weddingDay) : '',\n )\n const [subscribeEmailChecked, setSubscribeEmailChecked] = useState(Boolean(subscribeEmail))\n const [subscribeSmsChecked, setSubscribeSmsChecked] = useState(Boolean(subscribeSms))\n\n useEffect(() => {\n setSubscribeEmailChecked(Boolean(subscribeEmail))\n }, [subscribeEmail])\n\n useEffect(() => {\n setSubscribeSmsChecked(Boolean(subscribeSms))\n }, [subscribeSms])\n\n const checkFieldValidity: ChangeEventHandler<HTMLInputElement> = (e) => {\n const fieldName = e.target.name\n const fieldValue = e.target.value\n\n switch (fieldName) {\n case 'name': {\n setNameValue(fieldValue)\n setShowNameErrorText(fieldValue.length === 0)\n break\n }\n case 'email': {\n const emailField = formRef.current?.elements.namedItem(fieldName) as HTMLInputElement\n const isEmailValid = emailField?.validity.valid ?? false\n setEmailValue(fieldValue)\n setShowEmailErrorText(!isEmailValid && fieldValue.length > 0)\n break\n }\n case 'phone': {\n const formatted = formatPhoneNumber(fieldValue)\n setPhoneValue(formatted)\n setShowPhoneErrorText(formatted.length > 0 && !validatePhoneNumber(formatted))\n break\n }\n case 'location': {\n setLocationValue(fieldValue)\n setShowLocationErrorText(!fieldValue)\n break\n }\n default:\n break\n }\n }\n\n const isFormValid = useMemo(() => {\n const hasValidName = Boolean(nameValue) && !showNameErrorText\n const hasValidEmail = emailIsLocked ? Boolean(state.context.email) : Boolean(emailValue) && !showEmailErrorText\n const hasValidPhone = showPhone\n ? phoneIsLocked\n ? Boolean(state.context.phone)\n : phoneRequired\n ? validatePhoneNumber(phoneValue)\n : !phoneValue || validatePhoneNumber(phoneValue)\n : true\n const hasValidLocation = locationOptions.length > 0 ? Boolean(locationValue) : true\n // A partial date (only month or only day) requires completing the pair\n const hasValidBirthday =\n !showBirthday ||\n (birthdayRequired || selectedBirthMonth || selectedBirthDay\n ? Boolean(selectedBirthMonth) && Boolean(selectedBirthDay)\n : true)\n const hasValidWeddingAnniversary =\n !showWeddingAnniversary ||\n (weddingAnniversaryRequired || selectedWeddingMonth || selectedWeddingDay\n ? Boolean(selectedWeddingMonth) && Boolean(selectedWeddingDay)\n : true)\n return (\n hasValidName &&\n hasValidEmail &&\n hasValidPhone &&\n hasValidLocation &&\n hasValidBirthday &&\n hasValidWeddingAnniversary\n )\n }, [\n nameValue,\n emailValue,\n phoneValue,\n emailIsLocked,\n phoneIsLocked,\n state.context.email,\n state.context.phone,\n locationValue,\n locationOptions.length,\n showNameErrorText,\n showEmailErrorText,\n showPhone,\n phoneRequired,\n showBirthday,\n birthdayRequired,\n selectedBirthMonth,\n selectedBirthDay,\n showWeddingAnniversary,\n weddingAnniversaryRequired,\n selectedWeddingMonth,\n selectedWeddingDay,\n ])\n\n const monthOptions = useMemo(\n () => [\n { label: messages.signUpMonthJanuary, value: '1' },\n { label: messages.signUpMonthFebruary, value: '2' },\n { label: messages.signUpMonthMarch, value: '3' },\n { label: messages.signUpMonthApril, value: '4' },\n { label: messages.signUpMonthMay, value: '5' },\n { label: messages.signUpMonthJune, value: '6' },\n { label: messages.signUpMonthJuly, value: '7' },\n { label: messages.signUpMonthAugust, value: '8' },\n { label: messages.signUpMonthSeptember, value: '9' },\n { label: messages.signUpMonthOctober, value: '10' },\n { label: messages.signUpMonthNovember, value: '11' },\n { label: messages.signUpMonthDecember, value: '12' },\n ],\n [messages],\n )\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const formData = new FormData(e.target as HTMLFormElement)\n const values = Object.fromEntries(formData.entries()) as Record<string, string>\n // Disabled fields are excluded from FormData — restore the locked identifier from context\n if (emailIsLocked && !values.email && state.context.email) values.email = state.context.email\n if (phoneIsLocked && !values.phone && state.context.phone) values.phone = state.context.phone\n // Strip display formatting so the submitted value is consistent with the disabled-field path\n if (values.phone) {\n values.phone = values.phone.replace(/[^\\d+]/g, '')\n }\n if (showSubscribeEmail) {\n values.subscribeEmail = String(formData.has('subscribeEmail'))\n }\n if (showSubscribeSms) {\n values.subscribeSms = String(formData.has('subscribeSms'))\n }\n onActionButtonClick('submit-form', values)\n }\n\n return (\n <form\n ref={formRef}\n id=\"follower-authentication-user-form\"\n className={classes.form}\n onSubmit={handleSubmit}\n onInvalid={(e) => e.preventDefault()}\n >\n <TextField\n disabled={loading || emailIsLocked}\n label={messages.signUpEmailInputLabel}\n id=\"email-input\"\n name=\"email\"\n onChange={checkFieldValidity}\n error={showEmailErrorText}\n helperText={showEmailErrorText && messages.signUpEmailErrorText}\n inputProps={{ type: 'email' }}\n required={!emailIsLocked}\n value={emailValue}\n fullWidth\n />\n <Divider className={classes.divider} />\n <TextField\n disabled={loading}\n label={messages.signUpNameInputLabel}\n id=\"name-input\"\n name=\"name\"\n onChange={checkFieldValidity}\n error={showNameErrorText}\n helperText={showNameErrorText && messages.signUpNameErrorText}\n required\n value={nameValue}\n fullWidth\n />\n {showPhone && (\n <TextField\n disabled={loading || phoneIsLocked}\n label={messages.signUpPhoneInputLabel}\n id=\"phone-input\"\n name=\"phone\"\n onChange={checkFieldValidity}\n error={showPhoneErrorText}\n helperText={showPhoneErrorText && messages.signUpPhoneErrorText}\n required={phoneRequired && !phoneIsLocked}\n value={phoneValue}\n fullWidth\n />\n )}\n {locationOptions.length > 0 && (\n <SelectField\n disabled={loading}\n onChange={checkFieldValidity}\n label={messages.signUpLocationInputLabel}\n error={showLocationErrorText}\n helperText={showLocationErrorText && messages.signUpLocationErrorText}\n id=\"location-input\"\n name=\"location\"\n value={locationValue}\n required\n fullWidth\n >\n {locationOptions.map((option) => (\n <MenuItem data-cy=\"option\" key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SelectField>\n )}\n {(showBirthday || showWeddingAnniversary) && <Divider className={classes.divider} />}\n {showBirthday && (\n <MonthDayPicker\n sectionLabel={messages.signUpBirthdaySectionLabel}\n monthLabel={messages.signUpMonthInputLabel}\n dayLabel={messages.signUpDayInputLabel}\n monthId=\"birthday-month-input\"\n dayId=\"birthday-date-input\"\n monthName=\"birthMonth\"\n dayName=\"birthDay\"\n monthValue={selectedBirthMonth}\n dayValue={selectedBirthDay}\n onMonthChange={setSelectedBirthMonth}\n onDayChange={setSelectedBirthDay}\n required={birthdayRequired}\n disabled={loading}\n monthOptions={monthOptions}\n />\n )}\n {showWeddingAnniversary && (\n <MonthDayPicker\n sectionLabel={messages.signUpWeddingAnniversarySectionLabel}\n monthLabel={messages.signUpMonthInputLabel}\n dayLabel={messages.signUpDayInputLabel}\n monthId=\"wedding-month-input\"\n dayId=\"wedding-date-input\"\n monthName=\"weddingMonth\"\n dayName=\"weddingDay\"\n monthValue={selectedWeddingMonth}\n dayValue={selectedWeddingDay}\n onMonthChange={setSelectedWeddingMonth}\n onDayChange={setSelectedWeddingDay}\n required={weddingAnniversaryRequired}\n disabled={loading}\n monthOptions={monthOptions}\n />\n )}\n {(showSubscribeEmail || showSubscribeSms) && (\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"flex-start\" gridGap={2} width=\"100%\">\n {showSubscribeEmail && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={\n <Checkbox\n id=\"subscribe-email\"\n name=\"subscribeEmail\"\n disabled={loading}\n color=\"primary\"\n checked={subscribeEmailChecked}\n onChange={(e) => setSubscribeEmailChecked(e.target.checked)}\n />\n }\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeEmailCheckboxLabel}</Typography>}\n />\n )}\n {showSubscribeSms && (\n <FormControlLabel\n style={{ alignItems: 'flex-start' }}\n control={\n <Checkbox\n id=\"subscribe-sms\"\n name=\"subscribeSms\"\n disabled={loading}\n color=\"primary\"\n checked={subscribeSmsChecked}\n onChange={(e) => setSubscribeSmsChecked(e.target.checked)}\n />\n }\n label={<Typography className={classes.checkboxLabel}>{messages.subscribeSmsCheckboxLabel}</Typography>}\n />\n )}\n </Box>\n )}\n <FollowerAuthenticationPrivacyPolicy />\n <Button disabled={loading || !isFormValid} type=\"submit\">\n {messages.completeProfileCtaButtonLabel}\n </Button>\n </form>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAQA,MAAM,cAAc,GAAG,CAAC,KAAa,KAAY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AAC,mCAAmC,EAAG,IAAA,CAAA;AACvC,QAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,QAAQ,EAAE,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,EAAC,QAAQ,IACrD,QAAQ,CAAC,6BAA6B,CAChC,CACJ;AAEX;;;;"}
|
|
@@ -9,19 +9,16 @@ const Icon = ({ className, color = 'inherit', icon, size = 'inherit', ...restPro
|
|
|
9
9
|
restProps['aria-hidden'] = true;
|
|
10
10
|
}
|
|
11
11
|
const classes = useIconStyles({ color, size });
|
|
12
|
-
let isValid = true;
|
|
13
12
|
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
14
|
-
|
|
13
|
+
return null;
|
|
15
14
|
}
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
: null;
|
|
15
|
+
return createElement(icon, {
|
|
16
|
+
className: classNames([classes.root, iconStaticClassName, className]),
|
|
17
|
+
color,
|
|
18
|
+
width: undefined,
|
|
19
|
+
height: undefined,
|
|
20
|
+
...restProps,
|
|
21
|
+
});
|
|
25
22
|
};
|
|
26
23
|
Icon.displayName = 'Icon';
|
|
27
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { createElement, FunctionComponent } from 'react'\nimport { IconProps } from './IconProps'\nimport { useIconStyles } from './IconStyles'\n\nexport const iconStaticClassName = 'pop-icon'\nexport const Icon: FunctionComponent<IconProps> = ({\n className,\n color = 'inherit',\n icon,\n size = 'inherit',\n ...restProps\n}) => {\n const hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label'])\n if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {\n restProps['aria-hidden'] = true\n }\n const classes = useIconStyles({ color, size })\n
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { createElement, FunctionComponent } from 'react'\nimport { IconProps } from './IconProps'\nimport { useIconStyles } from './IconStyles'\n\nexport const iconStaticClassName = 'pop-icon'\nexport const Icon: FunctionComponent<IconProps> = ({\n className,\n color = 'inherit',\n icon,\n size = 'inherit',\n ...restProps\n}) => {\n const hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label'])\n if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {\n restProps['aria-hidden'] = true\n }\n const classes = useIconStyles({ color, size })\n if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {\n return null\n }\n return createElement(icon, {\n className: classNames([classes.root, iconStaticClassName, className]),\n color,\n width: undefined,\n height: undefined,\n ...restProps,\n })\n}\n\nIcon.displayName = 'Icon'\n"],"names":[],"mappings":";;;;AAKO,MAAM,mBAAmB,GAAG;MACtB,IAAI,GAAiC,CAAC,EACjD,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,IAAI,EACJ,IAAI,GAAG,SAAS,EAChB,GAAG,SAAS,EACb,KAAI;AACH,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;IAC3F,IAAI,CAAC,iBAAiB,IAAI,SAAS,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE;AAChE,QAAA,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI;;IAEjC,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC9C,IAAA,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC,EAAE;AACnE,QAAA,OAAO,IAAI;;IAEb,OAAO,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,SAAS,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;QACrE,KAAK;AACL,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,GAAG,SAAS;AACb,KAAA,CAAC;AACJ;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
|
|
@@ -2,13 +2,18 @@ import { makeStyles } from '@material-ui/core';
|
|
|
2
2
|
|
|
3
3
|
const useIconStyles = makeStyles(({ spacing, palette }) => {
|
|
4
4
|
const getFontSize = ({ size }) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
medium:
|
|
9
|
-
|
|
10
|
-
'
|
|
11
|
-
|
|
5
|
+
switch (size) {
|
|
6
|
+
case 'small':
|
|
7
|
+
return spacing(1.5);
|
|
8
|
+
case 'medium':
|
|
9
|
+
return spacing(2);
|
|
10
|
+
case 'large':
|
|
11
|
+
return spacing(2.5);
|
|
12
|
+
case 'extra-large':
|
|
13
|
+
return spacing(3);
|
|
14
|
+
default:
|
|
15
|
+
return 'inherit';
|
|
16
|
+
}
|
|
12
17
|
};
|
|
13
18
|
const getColor = (props) => {
|
|
14
19
|
const semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|