@npm_leadtech/legal-lib-components 7.98.0 → 7.99.0

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.
@@ -3,6 +3,6 @@ import { ContactBarWrapperStyled, ContactBarWrapperText, ScheduleWrapper } from
3
3
  import { IconWeb } from '../../../../images/componentsSvg/IconWeb';
4
4
  import { WideInfoBar } from '../../atoms/WideInfoBar';
5
5
  export const InfoBarFooter = ({ sitePhone, siteSchedule, securityText, guaranteeText, securityIconBlack, guaranteeIconGrey, isJonSnow = false, isAnonymousPayment = false }) => {
6
- return (_jsx(WideInfoBar, { children: _jsxs(_Fragment, { children: [_jsxs(ContactBarWrapperStyled, { className: `${(isJonSnow || isAnonymousPayment) && 'hidden'}`, children: [sitePhone && _jsx(IconWeb, {}), _jsxs(ScheduleWrapper, { children: [_jsxs("div", { className: 'is-mobile', children: [sitePhone && (_jsxs(_Fragment, { children: [_jsx("a", { className: 'phone', href: `tel:${sitePhone}`, children: _jsx("strong", { children: sitePhone }) }), ' - '] })), siteSchedule] }), _jsx("div", { className: 'no-mobile', children: sitePhone ? (_jsxs(_Fragment, { children: [_jsx("strong", { children: sitePhone }), " - ", siteSchedule] })) : (siteSchedule) })] })] }), _jsxs(ContactBarWrapperStyled, { children: [_jsx("img", { src: securityIconBlack, alt: 'security-icon' }), _jsx(ContactBarWrapperText, { children: securityText })] }), _jsxs(ContactBarWrapperStyled, { children: [_jsx("img", { src: guaranteeIconGrey, alt: 'guarantee-icon' }), _jsx(ContactBarWrapperText, { children: guaranteeText })] })] }) }));
6
+ return (_jsx(WideInfoBar, { children: _jsxs(_Fragment, { children: [_jsxs(ContactBarWrapperStyled, { className: `${(isJonSnow || isAnonymousPayment || (!sitePhone && !siteSchedule)) && 'hidden'}`, children: [sitePhone && _jsx(IconWeb, {}), _jsxs(ScheduleWrapper, { children: [_jsxs("div", { className: 'is-mobile', children: [sitePhone && (_jsxs(_Fragment, { children: [_jsx("a", { className: 'phone', href: `tel:${sitePhone}`, children: _jsx("strong", { children: sitePhone }) }), ' - '] })), siteSchedule ? `${siteSchedule}` : ''] }), _jsx("div", { className: 'no-mobile', children: sitePhone ? (_jsxs(_Fragment, { children: [_jsx("strong", { children: sitePhone }), " ", siteSchedule ? `- ${siteSchedule}` : ''] })) : siteSchedule ? (`${siteSchedule}`) : ('') })] })] }), _jsxs(ContactBarWrapperStyled, { children: [_jsx("img", { src: securityIconBlack, alt: 'security-icon' }), _jsx(ContactBarWrapperText, { children: securityText })] }), _jsxs(ContactBarWrapperStyled, { children: [_jsx("img", { src: guaranteeIconGrey, alt: 'guarantee-icon' }), _jsx(ContactBarWrapperText, { children: guaranteeText })] })] }) }));
7
7
  };
8
8
  export default InfoBarFooter;
@@ -17,7 +17,9 @@ export const InfoBarFooter: React.FC<InfoBarFooterProps> = ({
17
17
  return (
18
18
  <WideInfoBar>
19
19
  <>
20
- <ContactBarWrapperStyled className={`${(isJonSnow || isAnonymousPayment) && 'hidden'}`}>
20
+ <ContactBarWrapperStyled
21
+ className={`${(isJonSnow || isAnonymousPayment || (!sitePhone && !siteSchedule)) && 'hidden'}`}
22
+ >
21
23
  {sitePhone && <IconWeb />}
22
24
  <ScheduleWrapper>
23
25
  <div className='is-mobile'>
@@ -29,15 +31,17 @@ export const InfoBarFooter: React.FC<InfoBarFooterProps> = ({
29
31
  {' - '}
30
32
  </>
31
33
  )}
32
- {siteSchedule}
34
+ {siteSchedule ? `${siteSchedule}` : ''}
33
35
  </div>
34
36
  <div className='no-mobile'>
35
37
  {sitePhone ? (
36
38
  <>
37
- <strong>{sitePhone}</strong> - {siteSchedule}
39
+ <strong>{sitePhone}</strong> {siteSchedule ? `- ${siteSchedule}` : ''}
38
40
  </>
41
+ ) : siteSchedule ? (
42
+ `${siteSchedule}`
39
43
  ) : (
40
- siteSchedule
44
+ ''
41
45
  )}
42
46
  </div>
43
47
  </ScheduleWrapper>
@@ -1,6 +1,6 @@
1
1
  export interface InfoBarFooterProps {
2
- sitePhone: string;
3
- siteSchedule: string;
2
+ sitePhone?: string;
3
+ siteSchedule?: string;
4
4
  securityText: string;
5
5
  guaranteeText: string;
6
6
  securityIconBlack: string;
@@ -1,6 +1,6 @@
1
1
  export interface InfoBarFooterProps {
2
- sitePhone: string
3
- siteSchedule: string
2
+ sitePhone?: string
3
+ siteSchedule?: string
4
4
  securityText: string
5
5
  guaranteeText: string
6
6
  securityIconBlack: string
@@ -36,6 +36,13 @@ export const Wizard = ({ children, isHashEnabled = false, classNames }) => {
36
36
  };
37
37
  const footer = getSpecificComponentByDisplayName(FOOTER);
38
38
  const header = getSpecificComponentByDisplayName(HEADER);
39
- const memoizedNavigationControls = useMemo(() => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step]);
39
+ const memoizedNavigationControls = useMemo(() => ({
40
+ goToStepByIndex,
41
+ nextStep,
42
+ previousStep,
43
+ setStepByHash,
44
+ currentStep: step,
45
+ totalSteps: filteredChilds.length
46
+ }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step, filteredChilds.length]);
40
47
  return (_jsxs(WizardContext.Provider, { value: memoizedNavigationControls, children: [header, _jsxs("div", { className: classNames, children: [currentStep, footer] })] }));
41
48
  };
@@ -48,8 +48,15 @@ export const Wizard: React.FC<WizardProps> = ({ children, isHashEnabled = false,
48
48
  const header = getSpecificComponentByDisplayName(HEADER)
49
49
 
50
50
  const memoizedNavigationControls = useMemo(
51
- () => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }),
52
- [goToStepByIndex, nextStep, previousStep, setStepByHash, step]
51
+ () => ({
52
+ goToStepByIndex,
53
+ nextStep,
54
+ previousStep,
55
+ setStepByHash,
56
+ currentStep: step,
57
+ totalSteps: filteredChilds.length
58
+ }),
59
+ [goToStepByIndex, nextStep, previousStep, setStepByHash, step, filteredChilds.length]
53
60
  )
54
61
 
55
62
  return (
@@ -4,6 +4,7 @@ interface WizardContextInterFace {
4
4
  goToStepByIndex: (step: number) => void;
5
5
  setStepByHash: (hash: string) => void;
6
6
  currentStep: number;
7
+ totalSteps: number;
7
8
  }
8
9
  export declare const WizardContext: import("react").Context<WizardContextInterFace>;
9
10
  export {};
@@ -4,5 +4,6 @@ export const WizardContext = createContext({
4
4
  nextStep: () => { },
5
5
  goToStepByIndex: () => { },
6
6
  setStepByHash: () => { },
7
- currentStep: 0
7
+ currentStep: 0,
8
+ totalSteps: 0
8
9
  });
@@ -6,6 +6,7 @@ interface WizardContextInterFace {
6
6
  goToStepByIndex: (step: number) => void
7
7
  setStepByHash: (hash: string) => void
8
8
  currentStep: number
9
+ totalSteps: number
9
10
  }
10
11
 
11
12
  export const WizardContext = createContext<WizardContextInterFace>({
@@ -13,5 +14,6 @@ export const WizardContext = createContext<WizardContextInterFace>({
13
14
  nextStep: () => {},
14
15
  goToStepByIndex: () => {},
15
16
  setStepByHash: () => {},
16
- currentStep: 0
17
+ currentStep: 0,
18
+ totalSteps: 0
17
19
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.98.0",
3
+ "version": "7.99.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",