@taxbit/react-sdk 2.2.0-beta.1 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/src/contexts/QuestionnaireStep/useQuestionnaireStepContext.d.ts +3 -0
- package/dist/src/test/StepWrapper.d.ts +11 -0
- package/dist/src/test/Wrapper.d.ts +19 -1
- package/dist/src/test/getWrapper.d.ts +5 -3
- package/dist/src/test/renderWithWrapper.d.ts +3 -0
- package/dist/src/ui/CheckBox/__tests__/CheckBox.test.d.ts +1 -0
- package/dist/src/ui/DateOfBirthInput/__tests__/DateOfBirthInput.test.d.ts +1 -1
- package/dist/src/ui/FormattedInput/__tests__/FormattedInput.test.d.ts +1 -0
- package/dist/src/ui/PasswordInput/__tests__/PasswordInput.test.d.ts +1 -0
- package/dist/src/ui/PhoneNumberInput/__tests__/PhoneNumberInput.test.d.ts +1 -0
- package/dist/src/ui/Select/__tests__/Select.test.d.ts +1 -0
- package/dist/src/ui/TextArea/__tests__/TextArea.test.d.ts +1 -0
- package/dist/src/ui/index.d.ts +1 -0
- package/dist/src/ui/useAriaAttributes.d.ts +10 -0
- package/dist/src/utils/getErrorMessageId.d.ts +3 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/wizard/RowInput/ErrorRow/__tests__/ErrorRow.test.d.ts +1 -0
- package/dist/taxbit-react-sdk.js +2293 -2270
- package/dist/taxbit-react-sdk.umd.cjs +1 -1
- package/package.json +1 -1
- /package/dist/src/{ui/TextArea/__tests__/TextInput.test.d.ts → components/ErrorMessage/__tests__/ErrorMessage.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -346,6 +346,10 @@ type QuestionnaireType = 'DPS' | 'W-FORM' | 'SELF-CERT';
|
|
|
346
346
|
|
|
347
347
|
## Changelog
|
|
348
348
|
|
|
349
|
+
### Version 2.2.0-beta.2
|
|
350
|
+
|
|
351
|
+
1. Bug fix, hiding email field for non-AU residents.
|
|
352
|
+
|
|
349
353
|
### Version 2.2.0-beta.1
|
|
350
354
|
|
|
351
355
|
1. Updating TaxDocumentationStatus type to include issues and treatyClaimStatus.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { useQuestionnaireStep } from './useQuestionnaireStep.ts';
|
|
2
|
+
|
|
3
|
+
export type QuestionnaireStepContextValue = ReturnType<typeof useQuestionnaireStep>;
|
|
1
4
|
export declare const useQuestionnaireStepContext: () => {
|
|
2
5
|
getBadgeKey: (key: import('../../types/TaxDocumentation.ts').TaxDocumentationKey) => import('../../hooks/index.ts').UsTinValidationStatus | undefined;
|
|
3
6
|
getLocalAddressTitle: (data: import('../../types/TaxDocumentation.ts').TaxDocumentation) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QuestionnaireStepContextValue } from 'contexts/QuestionnaireStep/useQuestionnaireStepContext';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper for unit testing questionnaire components that combines a real value from the
|
|
6
|
+
* `useQuestionnaireStep` hook with the provided context value overrides.
|
|
7
|
+
*/
|
|
8
|
+
export declare const StepWrapper: ({ contextValue, children, }: {
|
|
9
|
+
contextValue: Partial<QuestionnaireStepContextValue>;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => React.JSX.Element;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import { ClientTaxDocumentation } from '@taxbit/utilities';
|
|
2
|
+
import { QuestionnaireStepContextValue } from 'contexts';
|
|
2
3
|
import { default as React } from 'react';
|
|
3
4
|
import { QuestionnaireProp } from '../types';
|
|
4
5
|
|
|
5
|
-
export
|
|
6
|
+
export type WrapperProps = React.PropsWithChildren<{
|
|
7
|
+
/**
|
|
8
|
+
* Initial data for the questionnaire.
|
|
9
|
+
*/
|
|
6
10
|
initialData?: ClientTaxDocumentation;
|
|
11
|
+
/**
|
|
12
|
+
* The type of questionnaire to render. Defaults to 'W-FORM'.
|
|
13
|
+
*/
|
|
7
14
|
questionnaire?: QuestionnaireProp;
|
|
15
|
+
/**
|
|
16
|
+
* Overrides for the context value of the `QuestionnaireStepProvider`. When provided, these
|
|
17
|
+
* overrides will be combined with the real output of a `useQuestionnaireStep` hook to produce
|
|
18
|
+
* a complete context value. When not provided, an actual provider with complete stateful data
|
|
19
|
+
* will be rendered.
|
|
20
|
+
*/
|
|
21
|
+
contextValue?: Partial<QuestionnaireStepContextValue>;
|
|
8
22
|
}>;
|
|
23
|
+
/**
|
|
24
|
+
* A test wrapper for unit testing questionnaire components.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Wrapper: React.FC<WrapperProps>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ClientTaxDocumentation } from '@taxbit/utilities';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { WrapperProps } from './Wrapper';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* A helper function to create a test wrapper for unit testing questionnaire components.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getWrapper: (initialData?: WrapperProps["initialData"], questionnaire?: WrapperProps["questionnaire"], contextValue?: WrapperProps["contextValue"]) => ({ children }: React.PropsWithChildren) => React.ReactNode | Promise<React.ReactNode>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WrapperProps } from './Wrapper';
|
|
2
|
+
|
|
3
|
+
export declare const renderWithWrapper: ({ contextValue, children, initialData, questionnaire, }: WrapperProps) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/src/ui/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TaxDocumentationKey } from '../types/TaxDocumentation';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook that returns any aria attributes needed to properly set up the given
|
|
5
|
+
* field for assistive technologies.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useAriaAttributes: (fieldName: TaxDocumentationKey) => {
|
|
8
|
+
'aria-invalid': boolean;
|
|
9
|
+
'aria-describedby': string | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|