@npm_leadtech/legal-lib-components 7.94.0 → 7.95.1

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.
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from '../../atoms/Button';
3
3
  import { SignerStatusItem } from '../../atoms/SignerStatusItem';
4
4
  import { SignersStatusTooltipContentStyled } from './SignersStatusTooltipContent.styled';
5
- export const SignersStatusTooltipContent = ({ title = 'Signers Status', signers, manageRequestsLabel, onManageRequestsClick, manageRequestsDataQa = 'manage_requests_button', givenClass = '' }) => {
6
- return (_jsxs(SignersStatusTooltipContentStyled, { className: `signers-status-tooltip-content ${givenClass}`.trim(), children: [_jsx("h3", { children: title }), _jsx("ul", { className: 'signers-status-tooltip-content__signers', children: signers.map((signer, index) => (_jsx(SignerStatusItem, { status: signer.status, children: signer.children }, `${signer.status}-${index}`))) }), _jsx("div", { className: 'signers-status-tooltip-content__button', children: _jsx(Button, { noLink: true, color: 'tertiary', givenClass: 'underline-button', label: manageRequestsLabel, dataQa: manageRequestsDataQa, onClick: onManageRequestsClick }) })] }));
5
+ export const SignersStatusTooltipContent = ({ title = 'Signers Status', signers, linkLabel, linkOnClick, linkDataQa = 'manage_requests_button', givenClass = '' }) => {
6
+ const hasLink = linkLabel !== '' && linkOnClick !== undefined;
7
+ return (_jsxs(SignersStatusTooltipContentStyled, { className: `signers-status-tooltip-content ${givenClass}`.trim(), children: [_jsx("h3", { children: title }), _jsx("ul", { className: 'signers-status-tooltip-content__signers', children: signers.map((signer, index) => (_jsx(SignerStatusItem, { status: signer.status, children: signer.children }, `${signer.status}-${index}`))) }), hasLink && (_jsx("div", { className: 'signers-status-tooltip-content__button', children: _jsx(Button, { noLink: true, color: 'tertiary', givenClass: 'underline-button', label: linkLabel, dataQa: linkDataQa, onClick: linkOnClick }) }))] }));
7
8
  };
@@ -8,11 +8,12 @@ import { SignersStatusTooltipContentStyled } from './SignersStatusTooltipContent
8
8
  export const SignersStatusTooltipContent: FC<SignersStatusTooltipContentProps> = ({
9
9
  title = 'Signers Status',
10
10
  signers,
11
- manageRequestsLabel,
12
- onManageRequestsClick,
13
- manageRequestsDataQa = 'manage_requests_button',
11
+ linkLabel,
12
+ linkOnClick,
13
+ linkDataQa = 'manage_requests_button',
14
14
  givenClass = ''
15
15
  }) => {
16
+ const hasLink = linkLabel !== '' && linkOnClick !== undefined
16
17
  return (
17
18
  <SignersStatusTooltipContentStyled className={`signers-status-tooltip-content ${givenClass}`.trim()}>
18
19
  <h3>{title}</h3>
@@ -23,16 +24,18 @@ export const SignersStatusTooltipContent: FC<SignersStatusTooltipContentProps> =
23
24
  </SignerStatusItem>
24
25
  ))}
25
26
  </ul>
26
- <div className='signers-status-tooltip-content__button'>
27
- <Button
28
- noLink
29
- color='tertiary'
30
- givenClass='underline-button'
31
- label={manageRequestsLabel}
32
- dataQa={manageRequestsDataQa}
33
- onClick={onManageRequestsClick}
34
- />
35
- </div>
27
+ {hasLink && (
28
+ <div className='signers-status-tooltip-content__button'>
29
+ <Button
30
+ noLink
31
+ color='tertiary'
32
+ givenClass='underline-button'
33
+ label={linkLabel}
34
+ dataQa={linkDataQa}
35
+ onClick={linkOnClick}
36
+ />
37
+ </div>
38
+ )}
36
39
  </SignersStatusTooltipContentStyled>
37
40
  )
38
41
  }
@@ -2,8 +2,8 @@ import type { SignerStatusItemProps } from '../../atoms/SignerStatusItem/SignerS
2
2
  export interface SignersStatusTooltipContentProps {
3
3
  title?: string;
4
4
  signers: SignerStatusItemProps[];
5
- manageRequestsLabel: string;
6
- onManageRequestsClick: () => void;
7
- manageRequestsDataQa?: string;
5
+ linkLabel: string;
6
+ linkOnClick: () => void;
7
+ linkDataQa?: string;
8
8
  givenClass?: string;
9
9
  }
@@ -3,8 +3,8 @@ import type { SignerStatusItemProps } from '../../atoms/SignerStatusItem/SignerS
3
3
  export interface SignersStatusTooltipContentProps {
4
4
  title?: string
5
5
  signers: SignerStatusItemProps[]
6
- manageRequestsLabel: string
7
- onManageRequestsClick: () => void
8
- manageRequestsDataQa?: string
6
+ linkLabel: string
7
+ linkOnClick: () => void
8
+ linkDataQa?: string
9
9
  givenClass?: string
10
10
  }
@@ -36,13 +36,6 @@ 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(() => ({
40
- goToStepByIndex,
41
- nextStep,
42
- previousStep,
43
- setStepByHash,
44
- currentStep: step,
45
- totalSteps: filteredChilds.length
46
- }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step, filteredChilds.length]);
39
+ const memoizedNavigationControls = useMemo(() => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step]);
47
40
  return (_jsxs(WizardContext.Provider, { value: memoizedNavigationControls, children: [header, _jsxs("div", { className: classNames, children: [currentStep, footer] })] }));
48
41
  };
@@ -48,15 +48,8 @@ export const Wizard: React.FC<WizardProps> = ({ children, isHashEnabled = false,
48
48
  const header = getSpecificComponentByDisplayName(HEADER)
49
49
 
50
50
  const memoizedNavigationControls = useMemo(
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]
51
+ () => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }),
52
+ [goToStepByIndex, nextStep, previousStep, setStepByHash, step]
60
53
  )
61
54
 
62
55
  return (
@@ -4,7 +4,6 @@ interface WizardContextInterFace {
4
4
  goToStepByIndex: (step: number) => void;
5
5
  setStepByHash: (hash: string) => void;
6
6
  currentStep: number;
7
- totalSteps: number;
8
7
  }
9
8
  export declare const WizardContext: import("react").Context<WizardContextInterFace>;
10
9
  export {};
@@ -4,6 +4,5 @@ export const WizardContext = createContext({
4
4
  nextStep: () => { },
5
5
  goToStepByIndex: () => { },
6
6
  setStepByHash: () => { },
7
- currentStep: 0,
8
- totalSteps: 0
7
+ currentStep: 0
9
8
  });
@@ -6,7 +6,6 @@ interface WizardContextInterFace {
6
6
  goToStepByIndex: (step: number) => void
7
7
  setStepByHash: (hash: string) => void
8
8
  currentStep: number
9
- totalSteps: number
10
9
  }
11
10
 
12
11
  export const WizardContext = createContext<WizardContextInterFace>({
@@ -14,6 +13,5 @@ export const WizardContext = createContext<WizardContextInterFace>({
14
13
  nextStep: () => {},
15
14
  goToStepByIndex: () => {},
16
15
  setStepByHash: () => {},
17
- currentStep: 0,
18
- totalSteps: 0
16
+ currentStep: 0
19
17
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.94.0",
3
+ "version": "7.95.1",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",