@homefile/components-v2 2.51.3 → 2.51.5

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.
@@ -865,7 +865,8 @@
865
865
  "instagram": "Instagram",
866
866
  "twitter": "Twitter/X",
867
867
  "linkedin": "Linkedin",
868
- "tiktok": "TikTok"
868
+ "tiktok": "TikTok",
869
+ "youtube": "YouTube"
869
870
  }
870
871
  },
871
872
  "success": {
@@ -1 +1,2 @@
1
- export declare const PartnerWizardStepCta: () => import("react/jsx-runtime").JSX.Element;
1
+ import { PartnerWizardStepCtaI } from '../../../interfaces';
2
+ export declare const PartnerWizardStepCta: ({ value, onChange, errors, isDisabled, }: PartnerWizardStepCtaI) => import("react/jsx-runtime").JSX.Element;
@@ -6,12 +6,21 @@ import { Box, Flex, Text } from '@chakra-ui/react';
6
6
  import { TextInput } from '../../../components';
7
7
  import { PartnerWizardStepLayout } from './PartnerWizardStepLayout';
8
8
  const STEP_KEY = 'partner.wizardSteps.cta';
9
- export const PartnerWizardStepCta = () => {
10
- const [primaryAction, setPrimaryAction] = useState('');
11
- const [secondaryAction, setSecondaryAction] = useState('');
12
- const [leadEmail, setLeadEmail] = useState('');
13
- const [crmName, setCrmName] = useState('');
9
+ const buildDefaultValue = () => ({
10
+ primaryActionButton: '',
11
+ secondaryActionButton: '',
12
+ leadSubmissionEmail: '',
13
+ crmName: '',
14
+ });
15
+ export const PartnerWizardStepCta = ({ value, onChange, errors, isDisabled = false, }) => {
16
+ const [internalValue, setInternalValue] = useState(buildDefaultValue);
17
+ const currentValue = value !== null && value !== void 0 ? value : internalValue;
18
+ const handleChange = (next) => {
19
+ if (!value)
20
+ setInternalValue(next);
21
+ onChange === null || onChange === void 0 ? void 0 : onChange(next);
22
+ };
14
23
  return (_jsxs(PartnerWizardStepLayout, { title: t(`${STEP_KEY}.title`), contentFullWidth: true, subtitle: _jsx(Trans, { i18nKey: `${STEP_KEY}.subtitle`, components: {
15
24
  bold: _jsx(Text, { as: "span", fontWeight: "bold" }),
16
- } }), children: [_jsxs(Flex, { gap: "base", direction: { base: 'column', md: 'row' }, children: [_jsxs(Box, { flex: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.primaryActionLabel`) }), _jsx(TextInput, { showLabel: false, id: "partnerWizardPrimaryAction", placeholder: t(`${STEP_KEY}.primaryActionPlaceholder`), value: primaryAction, handleChange: (event) => setPrimaryAction(event.target.value) })] }), _jsxs(Box, { flex: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.secondaryActionLabel`) }), _jsx(TextInput, { showLabel: false, id: "partnerWizardSecondaryAction", placeholder: t(`${STEP_KEY}.secondaryActionPlaceholder`), value: secondaryAction, handleChange: (event) => setSecondaryAction(event.target.value) })] })] }), _jsxs(Box, { bg: "lightBlue.12", p: "base", borderRadius: "sm", children: [_jsx(Text, { mb: "1", children: t(`${STEP_KEY}.leadSubmissionTitle`) }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", mb: "2", children: t(`${STEP_KEY}.leadEmailLabel`) }), _jsx(TextInput, { id: "partnerWizardLeadEmail", placeholder: t(`${STEP_KEY}.leadEmailPlaceholder`), value: leadEmail, handleChange: (event) => setLeadEmail(event.target.value) }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", mt: "3", mb: "2", children: t(`${STEP_KEY}.crmLabel`) }), _jsx(TextInput, { id: "partnerWizardCrmName", placeholder: t(`${STEP_KEY}.crmPlaceholder`), value: crmName, handleChange: (event) => setCrmName(event.target.value) })] })] }));
25
+ } }), children: [_jsxs(Flex, { gap: "base", direction: { base: 'column', md: 'row' }, children: [_jsxs(Box, { flex: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.primaryActionLabel`) }), _jsx(TextInput, { showLabel: false, id: "partnerWizardPrimaryAction", placeholder: t(`${STEP_KEY}.primaryActionPlaceholder`), value: currentValue.primaryActionButton, handleChange: (event) => handleChange(Object.assign(Object.assign({}, currentValue), { primaryActionButton: event.target.value })), errorMessage: errors === null || errors === void 0 ? void 0 : errors.primaryActionButton, isDisabled: isDisabled })] }), _jsxs(Box, { flex: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.secondaryActionLabel`) }), _jsx(TextInput, { showLabel: false, id: "partnerWizardSecondaryAction", placeholder: t(`${STEP_KEY}.secondaryActionPlaceholder`), value: currentValue.secondaryActionButton, handleChange: (event) => handleChange(Object.assign(Object.assign({}, currentValue), { secondaryActionButton: event.target.value })), isDisabled: isDisabled })] })] }), _jsxs(Box, { bg: "lightBlue.12", p: "base", borderRadius: "sm", children: [_jsx(Text, { mb: "1", children: t(`${STEP_KEY}.leadSubmissionTitle`) }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", mb: "2", children: t(`${STEP_KEY}.leadEmailLabel`) }), _jsx(TextInput, { id: "partnerWizardLeadEmail", placeholder: t(`${STEP_KEY}.leadEmailPlaceholder`), value: currentValue.leadSubmissionEmail, handleChange: (event) => handleChange(Object.assign(Object.assign({}, currentValue), { leadSubmissionEmail: event.target.value })), errorMessage: errors === null || errors === void 0 ? void 0 : errors.leadSubmissionEmail, isDisabled: isDisabled }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", mt: "3", mb: "2", children: t(`${STEP_KEY}.crmLabel`) }), _jsx(TextInput, { id: "partnerWizardCrmName", placeholder: t(`${STEP_KEY}.crmPlaceholder`), value: currentValue.crmName, handleChange: (event) => handleChange(Object.assign(Object.assign({}, currentValue), { crmName: event.target.value })), isDisabled: isDisabled })] })] }));
17
26
  };
@@ -1 +1,2 @@
1
- export declare const PartnerWizardStepServiceZones: () => import("react/jsx-runtime").JSX.Element;
1
+ import { PartnerWizardStepServiceZonesI } from '../../../interfaces';
2
+ export declare const PartnerWizardStepServiceZones: ({ value, onChange, errorMessage, isDisabled, }: PartnerWizardStepServiceZonesI) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,13 @@ import { useState } from 'react';
3
3
  import { t } from 'i18next';
4
4
  import { TextAreaInput } from '../../../components';
5
5
  import { PartnerWizardStepLayout } from './PartnerWizardStepLayout';
6
- export const PartnerWizardStepServiceZones = () => {
7
- const [serviceZones, setServiceZones] = useState('');
8
- return (_jsx(PartnerWizardStepLayout, { title: t('partner.wizardSteps.serviceZones.title'), subtitle: t('partner.wizardSteps.serviceZones.subtitle'), contentFullWidth: true, children: _jsx(TextAreaInput, { id: "partnerWizardServiceZones", placeholder: t('partner.wizardSteps.serviceZones.placeholder'), value: serviceZones, onChange: (event) => setServiceZones(event.target.value), minH: "260px", resize: "none" }) }));
6
+ export const PartnerWizardStepServiceZones = ({ value, onChange, errorMessage, isDisabled = false, }) => {
7
+ const [internalValue, setInternalValue] = useState('');
8
+ const currentValue = value !== null && value !== void 0 ? value : internalValue;
9
+ const handleChange = (next) => {
10
+ if (value === undefined)
11
+ setInternalValue(next);
12
+ onChange === null || onChange === void 0 ? void 0 : onChange(next);
13
+ };
14
+ return (_jsx(PartnerWizardStepLayout, { title: t('partner.wizardSteps.serviceZones.title'), subtitle: t('partner.wizardSteps.serviceZones.subtitle'), contentFullWidth: true, children: _jsx(TextAreaInput, { id: "partnerWizardServiceZones", placeholder: t('partner.wizardSteps.serviceZones.placeholder'), value: currentValue, onChange: (event) => handleChange(event.target.value), errorMessage: errorMessage, isDisabled: isDisabled, minH: "260px", resize: "none" }) }));
9
15
  };
@@ -1 +1,2 @@
1
- export declare const PartnerWizardStepSocial: () => import("react/jsx-runtime").JSX.Element;
1
+ import { PartnerWizardStepSocialI } from '../../../interfaces';
2
+ export declare const PartnerWizardStepSocial: ({ value, onChange, errorMessage, isDisabled, }: PartnerWizardStepSocialI) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,33 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { t } from 'i18next';
4
+ import { Text } from '@chakra-ui/react';
4
5
  import { TextInput } from '../../../components';
5
6
  import { PartnerWizardStepLayout } from './PartnerWizardStepLayout';
6
7
  const STEP_KEY = 'partner.wizardSteps.social';
7
- const SOCIAL_FIELDS = ['facebook', 'instagram', 'twitter', 'linkedin', 'tiktok'];
8
- export const PartnerWizardStepSocial = () => {
9
- const [socialLinks, setSocialLinks] = useState(Array(SOCIAL_FIELDS.length).fill(''));
10
- const handleSocialLinkChange = (index, value) => {
11
- setSocialLinks((currentSocialLinks) => {
12
- const updatedSocialLinks = [...currentSocialLinks];
13
- updatedSocialLinks[index] = value;
14
- return updatedSocialLinks;
15
- });
8
+ const SOCIAL_FIELDS = [
9
+ 'facebook',
10
+ 'instagram',
11
+ 'youtube',
12
+ 'twitter',
13
+ 'linkedin',
14
+ 'tiktok',
15
+ ];
16
+ const buildDefaultValue = () => ({
17
+ facebook: '',
18
+ instagram: '',
19
+ youtube: '',
20
+ twitter: '',
21
+ linkedin: '',
22
+ tiktok: '',
23
+ });
24
+ export const PartnerWizardStepSocial = ({ value, onChange, errorMessage, isDisabled = false, }) => {
25
+ const [internalValue, setInternalValue] = useState(buildDefaultValue);
26
+ const currentValue = value !== null && value !== void 0 ? value : internalValue;
27
+ const handleChange = (next) => {
28
+ if (!value)
29
+ setInternalValue(next);
30
+ onChange === null || onChange === void 0 ? void 0 : onChange(next);
16
31
  };
17
- return (_jsx(PartnerWizardStepLayout, { title: t(`${STEP_KEY}.title`), subtitle: t(`${STEP_KEY}.subtitle`), contentSpacing: "3", contentFullWidth: true, children: socialLinks.map((socialLink, index) => {
18
- const field = SOCIAL_FIELDS[index];
19
- return (_jsx(TextInput, { id: `partnerWizardSocial-${field}`, placeholder: t(`${STEP_KEY}.placeholder.${field}`), value: socialLink, handleChange: (event) => handleSocialLinkChange(index, event.target.value) }, `partnerWizardSocial-${field}`));
20
- }) }));
32
+ return (_jsxs(PartnerWizardStepLayout, { title: t(`${STEP_KEY}.title`), subtitle: t(`${STEP_KEY}.subtitle`), contentSpacing: "3", contentFullWidth: true, children: [SOCIAL_FIELDS.map((field) => (_jsx(TextInput, { id: `partnerWizardSocial-${field}`, placeholder: t(`${STEP_KEY}.placeholder.${field}`), value: currentValue[field], handleChange: (event) => handleChange(Object.assign(Object.assign({}, currentValue), { [field]: event.target.value })), isDisabled: isDisabled }, `partnerWizardSocial-${field}`))), errorMessage && (_jsx(Text, { variant: "error", my: "1", children: errorMessage }))] }));
21
33
  };
@@ -0,0 +1,15 @@
1
+ export type PartnerWizardStepCtaValue = {
2
+ primaryActionButton: string;
3
+ secondaryActionButton: string;
4
+ leadSubmissionEmail: string;
5
+ crmName: string;
6
+ };
7
+ export interface PartnerWizardStepCtaI {
8
+ value?: PartnerWizardStepCtaValue;
9
+ onChange?: (value: PartnerWizardStepCtaValue) => void;
10
+ errors?: {
11
+ primaryActionButton?: string;
12
+ leadSubmissionEmail?: string;
13
+ };
14
+ isDisabled?: boolean;
15
+ }
@@ -0,0 +1,6 @@
1
+ export interface PartnerWizardStepServiceZonesI {
2
+ value?: string;
3
+ onChange?: (value: string) => void;
4
+ errorMessage?: string;
5
+ isDisabled?: boolean;
6
+ }
@@ -0,0 +1,14 @@
1
+ export type PartnerWizardStepSocialValue = {
2
+ facebook: string;
3
+ instagram: string;
4
+ youtube: string;
5
+ twitter: string;
6
+ linkedin: string;
7
+ tiktok: string;
8
+ };
9
+ export interface PartnerWizardStepSocialI {
10
+ value?: PartnerWizardStepSocialValue;
11
+ onChange?: (value: PartnerWizardStepSocialValue) => void;
12
+ errorMessage?: string;
13
+ isDisabled?: boolean;
14
+ }
@@ -20,3 +20,6 @@ export * from './ShortPartnerTile.interface';
20
20
  export * from './PartnerWizardSteps.interface';
21
21
  export * from './PartnerWizardStepServicesSelect.interface';
22
22
  export * from './PartnerWizardStepBrand.interface';
23
+ export * from './PartnerWizardStepServiceZones.interface';
24
+ export * from './PartnerWizardStepCta.interface';
25
+ export * from './PartnerWizardStepSocial.interface';
@@ -20,3 +20,6 @@ export * from './ShortPartnerTile.interface';
20
20
  export * from './PartnerWizardSteps.interface';
21
21
  export * from './PartnerWizardStepServicesSelect.interface';
22
22
  export * from './PartnerWizardStepBrand.interface';
23
+ export * from './PartnerWizardStepServiceZones.interface';
24
+ export * from './PartnerWizardStepCta.interface';
25
+ export * from './PartnerWizardStepSocial.interface';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.51.3",
3
+ "version": "2.51.5",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",