@trackunit/react-form-wizard 1.17.12 → 1.17.14-alpha-c57027e60fa.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.
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/package.json +5 -5
- package/src/FormWizard/FormWizard.variants.d.ts +3 -3
- package/src/FormWizard/useFormWizard.d.ts +5 -3
- package/src/FormWizardFooter/FormWizardFooter.variants.d.ts +2 -2
- package/src/FormWizardHeader/FormWizardHeader.variants.d.ts +1 -1
- package/src/FormWizardSidebar/FormWizardSidebar.variants.d.ts +2 -2
- package/src/FormWizardSidebarStep/FormWizardSidebarStep.d.ts +3 -2
- package/src/FormWizardSidebarStep/FormWizardSidebarStep.variants.d.ts +8 -8
- package/src/FormWizardStepWrapper/FormWizardStepWrapper.variants.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -171,7 +171,7 @@ const getStateIcon = (state) => {
|
|
|
171
171
|
*/
|
|
172
172
|
const FormWizardSidebarStep = ({ stepNumber, state, basePath, title, subTitle, path, "data-testid": dataTestId, onClickNavigate, isSubStep = false, }) => {
|
|
173
173
|
const stateIcon = getStateIcon(state);
|
|
174
|
-
return (jsxRuntime.jsx(reactRouter.Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId ?? `form-wizard-sidebar-step-${path}`, onClick: onClickNavigate, params: prev => ({ ...prev, stepPath: path }), search: prev => ({ ...prev }), to: basePath, children: jsxRuntime.jsxs("div", { className: cvaSectionHeaderContainer({ state }), children: [jsxRuntime.jsx("div", { className: cvaStepNumberContainer(), children: stateIcon ?? (jsxRuntime.jsx("span", { className: cvaStepNumber({ state, isSubStep }), "data-testid": isSubStep ? `form-wizard-sidebar-substep` : `form-wizard-sidebar-step-number-${stepNumber}`, children: stepNumber })) }), jsxRuntime.jsxs("div", { className: cvaTitleAndDescription(), children: [jsxRuntime.jsx("h3", { className: cvaHeader(), children: title }), subTitle ? jsxRuntime.jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
174
|
+
return (jsxRuntime.jsx(reactRouter.Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId ?? `form-wizard-sidebar-step-${path}`, onClick: onClickNavigate, params: (prev) => ({ ...prev, stepPath: path }), search: (prev) => ({ ...prev }), to: basePath, children: jsxRuntime.jsxs("div", { className: cvaSectionHeaderContainer({ state }), children: [jsxRuntime.jsx("div", { className: cvaStepNumberContainer(), children: stateIcon ?? (jsxRuntime.jsx("span", { className: cvaStepNumber({ state, isSubStep }), "data-testid": isSubStep ? `form-wizard-sidebar-substep` : `form-wizard-sidebar-step-number-${stepNumber}`, children: stepNumber })) }), jsxRuntime.jsxs("div", { className: cvaTitleAndDescription(), children: [jsxRuntime.jsx("h3", { className: cvaHeader(), children: title }), subTitle ? jsxRuntime.jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
const cvaFooterContainer = cssClassVarianceUtilities.cvaMerge([
|
package/index.esm.js
CHANGED
|
@@ -169,7 +169,7 @@ const getStateIcon = (state) => {
|
|
|
169
169
|
*/
|
|
170
170
|
const FormWizardSidebarStep = ({ stepNumber, state, basePath, title, subTitle, path, "data-testid": dataTestId, onClickNavigate, isSubStep = false, }) => {
|
|
171
171
|
const stateIcon = getStateIcon(state);
|
|
172
|
-
return (jsx(Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId ?? `form-wizard-sidebar-step-${path}`, onClick: onClickNavigate, params: prev => ({ ...prev, stepPath: path }), search: prev => ({ ...prev }), to: basePath, children: jsxs("div", { className: cvaSectionHeaderContainer({ state }), children: [jsx("div", { className: cvaStepNumberContainer(), children: stateIcon ?? (jsx("span", { className: cvaStepNumber({ state, isSubStep }), "data-testid": isSubStep ? `form-wizard-sidebar-substep` : `form-wizard-sidebar-step-number-${stepNumber}`, children: stepNumber })) }), jsxs("div", { className: cvaTitleAndDescription(), children: [jsx("h3", { className: cvaHeader(), children: title }), subTitle ? jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
172
|
+
return (jsx(Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId ?? `form-wizard-sidebar-step-${path}`, onClick: onClickNavigate, params: (prev) => ({ ...prev, stepPath: path }), search: (prev) => ({ ...prev }), to: basePath, children: jsxs("div", { className: cvaSectionHeaderContainer({ state }), children: [jsx("div", { className: cvaStepNumberContainer(), children: stateIcon ?? (jsx("span", { className: cvaStepNumber({ state, isSubStep }), "data-testid": isSubStep ? `form-wizard-sidebar-substep` : `form-wizard-sidebar-step-number-${stepNumber}`, children: stepNumber })) }), jsxs("div", { className: cvaTitleAndDescription(), children: [jsx("h3", { className: cvaHeader(), children: title }), subTitle ? jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
const cvaFooterContainer = cvaMerge([
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-wizard",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.14-alpha-c57027e60fa.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"zod": "^3.23.8",
|
|
8
8
|
"@hookform/resolvers": "^3.3.4",
|
|
9
9
|
"@tanstack/router-core": "1.114.29",
|
|
10
|
-
"@trackunit/shared-utils": "1.13.
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "1.11.
|
|
12
|
-
"@trackunit/react-components": "1.20.
|
|
13
|
-
"@trackunit/i18n-library-translation": "1.15.
|
|
10
|
+
"@trackunit/shared-utils": "1.13.84-alpha-c57027e60fa.0",
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "1.11.84-alpha-c57027e60fa.0",
|
|
12
|
+
"@trackunit/react-components": "1.20.12-alpha-c57027e60fa.0",
|
|
13
|
+
"@trackunit/i18n-library-translation": "1.15.13-alpha-c57027e60fa.0"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=24.x",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const cvaFormWizardContainer: (props?: import("class-variance-authority/
|
|
2
|
-
export declare const cvaFormWizardLayout: (props?: import("class-variance-authority/
|
|
3
|
-
export declare const cvaStepContainer: (props?: import("class-variance-authority/
|
|
1
|
+
export declare const cvaFormWizardContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaFormWizardLayout: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const cvaStepContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RegisteredRouter
|
|
1
|
+
import { RegisteredRouter } from "@tanstack/react-router";
|
|
2
|
+
import { RoutePaths } from "@tanstack/router-core";
|
|
2
3
|
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
3
4
|
import { MappedOmit } from "@trackunit/shared-utils";
|
|
4
5
|
import { ReactNode } from "react";
|
|
@@ -32,7 +33,8 @@ export type StepComponentProps<TFullSchemaHook extends () => AnyZodObject, TStep
|
|
|
32
33
|
export interface FromWizardComponentProps<TFullSchema extends AnyZodObject, TComponentStepDefinitions extends StepDefinitions<TFullSchema>> extends MappedOmit<UseFormWizardProps<TFullSchema, TComponentStepDefinitions>, "steps">, CommonProps, Refable<HTMLDivElement> {
|
|
33
34
|
steps: TComponentStepDefinitions;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
type StepPathString = `${string}/$stepPath`;
|
|
37
|
+
export type StringWithStepKey<TPath> = [TPath] extends [never] ? StepPathString : string extends TPath ? StepPathString : TPath extends StepPathString ? TPath : never;
|
|
36
38
|
/**
|
|
37
39
|
* The main props interface for the useFormWizard hook.
|
|
38
40
|
* This interface contains the full configuration needed
|
|
@@ -42,7 +44,7 @@ export interface UseFormWizardProps<TFullSchema extends SomeZodObject, TStepDefi
|
|
|
42
44
|
fullFormSchema: TFullSchema;
|
|
43
45
|
lastStepPrimaryActionLabel: string;
|
|
44
46
|
onCancel?: (stepKey: string) => void;
|
|
45
|
-
basePath: StringWithStepKey<`${
|
|
47
|
+
basePath: StringWithStepKey<`${RoutePaths<RegisteredRouter["routeTree"]>}`>;
|
|
46
48
|
steps: TStepDefinitions;
|
|
47
49
|
isEdit?: boolean;
|
|
48
50
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const cvaFooterContainer: (props?: import("class-variance-authority/
|
|
2
|
-
export declare const cvaNavigationContainer: (props?: import("class-variance-authority/
|
|
1
|
+
export declare const cvaFooterContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaNavigationContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const cvaFormWizardHeader: (props?: import("class-variance-authority/
|
|
1
|
+
export declare const cvaFormWizardHeader: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const cvaFillSection: (props?: import("class-variance-authority/
|
|
2
|
-
export declare const cvaSidebar: (props?: import("class-variance-authority/
|
|
1
|
+
export declare const cvaFillSection: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaSidebar: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RegisteredRouter
|
|
1
|
+
import { RegisteredRouter } from "@tanstack/react-router";
|
|
2
|
+
import { RoutePaths } from "@tanstack/router-core";
|
|
2
3
|
import { CommonProps } from "@trackunit/react-components";
|
|
3
4
|
import { MouseEventHandler } from "react";
|
|
4
5
|
import { StepState, StringWithStepKey } from "../FormWizard/useFormWizard";
|
|
@@ -6,7 +7,7 @@ interface FormWizardSidebarStepProps extends CommonProps {
|
|
|
6
7
|
state: StepState;
|
|
7
8
|
stepNumber?: number;
|
|
8
9
|
title: string;
|
|
9
|
-
basePath: StringWithStepKey<`${
|
|
10
|
+
basePath: StringWithStepKey<`${RoutePaths<RegisteredRouter["routeTree"]>}`>;
|
|
10
11
|
subTitle?: string;
|
|
11
12
|
path: string;
|
|
12
13
|
onClickNavigate: MouseEventHandler<HTMLElement>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export declare const cvaFormWizardSidebarStep: (props?: ({
|
|
2
2
|
state?: "ready" | "active" | "done" | "invalid" | "disabled" | null | undefined;
|
|
3
3
|
isSubStep?: boolean | null | undefined;
|
|
4
|
-
} & import("class-variance-authority/
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const cvaSectionHeaderContainer: (props?: ({
|
|
6
6
|
state?: "ready" | "active" | "done" | "invalid" | "disabled" | null | undefined;
|
|
7
|
-
cursor?: "
|
|
8
|
-
} & import("class-variance-authority/
|
|
9
|
-
export declare const cvaHeader: (props?: import("class-variance-authority/
|
|
10
|
-
export declare const cvaSubtitle: (props?: import("class-variance-authority/
|
|
11
|
-
export declare const cvaStepNumberContainer: (props?: import("class-variance-authority/
|
|
7
|
+
cursor?: "withCursor" | "default" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const cvaHeader: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const cvaSubtitle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const cvaStepNumberContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
12
|
export declare const cvaStepNumber: (props?: ({
|
|
13
13
|
state?: "ready" | "active" | "done" | "invalid" | "disabled" | null | undefined;
|
|
14
14
|
isSubStep?: boolean | null | undefined;
|
|
15
|
-
} & import("class-variance-authority/
|
|
16
|
-
export declare const cvaTitleAndDescription: (props?: import("class-variance-authority/
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
export declare const cvaTitleAndDescription: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const cvaFormWizardComponentContainer: (props?: import("class-variance-authority/
|
|
2
|
-
export declare const cvaFormWizardComponentStepForm: (props?: import("class-variance-authority/
|
|
1
|
+
export declare const cvaFormWizardComponentContainer: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaFormWizardComponentStepForm: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|