@trackunit/react-form-wizard 1.17.23-alpha-192bcb42ded.0 → 1.17.25
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
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:
|
|
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:
|
|
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.25",
|
|
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.87
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "1.11.87
|
|
12
|
-
"@trackunit/react-components": "1.20.
|
|
13
|
-
"@trackunit/i18n-library-translation": "1.15.18
|
|
10
|
+
"@trackunit/shared-utils": "1.13.87",
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "1.11.87",
|
|
12
|
+
"@trackunit/react-components": "1.20.18",
|
|
13
|
+
"@trackunit/i18n-library-translation": "1.15.18"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=24.x",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { RegisteredRouter } from "@tanstack/react-router";
|
|
2
|
-
import { RoutePaths } from "@tanstack/router-core";
|
|
1
|
+
import { RegisteredRouter, RouteIds } from "@tanstack/react-router";
|
|
3
2
|
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
4
3
|
import { MappedOmit } from "@trackunit/shared-utils";
|
|
5
4
|
import { ReactNode } from "react";
|
|
@@ -33,8 +32,7 @@ export type StepComponentProps<TFullSchemaHook extends () => AnyZodObject, TStep
|
|
|
33
32
|
export interface FromWizardComponentProps<TFullSchema extends AnyZodObject, TComponentStepDefinitions extends StepDefinitions<TFullSchema>> extends MappedOmit<UseFormWizardProps<TFullSchema, TComponentStepDefinitions>, "steps">, CommonProps, Refable<HTMLDivElement> {
|
|
34
33
|
steps: TComponentStepDefinitions;
|
|
35
34
|
}
|
|
36
|
-
type
|
|
37
|
-
export type StringWithStepKey<TPath> = [TPath] extends [never] ? StepPathString : string extends TPath ? StepPathString : TPath extends StepPathString ? TPath : never;
|
|
35
|
+
export type StringWithStepKey<TPath> = TPath extends `${infer _Prefix}/$stepPath` ? TPath : never;
|
|
38
36
|
/**
|
|
39
37
|
* The main props interface for the useFormWizard hook.
|
|
40
38
|
* This interface contains the full configuration needed
|
|
@@ -44,7 +42,7 @@ export interface UseFormWizardProps<TFullSchema extends SomeZodObject, TStepDefi
|
|
|
44
42
|
fullFormSchema: TFullSchema;
|
|
45
43
|
lastStepPrimaryActionLabel: string;
|
|
46
44
|
onCancel?: (stepKey: string) => void;
|
|
47
|
-
basePath: StringWithStepKey<`${
|
|
45
|
+
basePath: StringWithStepKey<`${RouteIds<RegisteredRouter["routeTree"]>}`>;
|
|
48
46
|
steps: TStepDefinitions;
|
|
49
47
|
isEdit?: boolean;
|
|
50
48
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { RegisteredRouter } from "@tanstack/react-router";
|
|
2
|
-
import { RoutePaths } from "@tanstack/router-core";
|
|
1
|
+
import { RegisteredRouter, RouteIds } from "@tanstack/react-router";
|
|
3
2
|
import { CommonProps } from "@trackunit/react-components";
|
|
4
3
|
import { MouseEventHandler } from "react";
|
|
5
4
|
import { StepState, StringWithStepKey } from "../FormWizard/useFormWizard";
|
|
@@ -7,7 +6,7 @@ interface FormWizardSidebarStepProps extends CommonProps {
|
|
|
7
6
|
state: StepState;
|
|
8
7
|
stepNumber?: number;
|
|
9
8
|
title: string;
|
|
10
|
-
basePath: StringWithStepKey<`${
|
|
9
|
+
basePath: StringWithStepKey<`${RouteIds<RegisteredRouter["routeTree"]>}`>;
|
|
11
10
|
subTitle?: string;
|
|
12
11
|
path: string;
|
|
13
12
|
onClickNavigate: MouseEventHandler<HTMLElement>;
|