@trackunit/react-form-wizard 1.14.8 → 1.15.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 CHANGED
@@ -209,7 +209,7 @@ const cvaFormWizardHeader = cssClassVarianceUtilities.cvaMerge([
209
209
  * In most cases you should not be using this component directly, but rather use the FormWizard component.
210
210
  */
211
211
  const FormWizardHeader = ({ title, description, className, "data-testid": dataTestId, }) => {
212
- return (jsxRuntime.jsxs("div", { className: cvaFormWizardHeader({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(reactComponents.Heading, { variant: "secondary", children: title }), description ? (jsxRuntime.jsx(reactComponents.Heading, { subtle: true, variant: "subtitle", children: description })) : null] }));
212
+ return (jsxRuntime.jsxs("div", { className: cvaFormWizardHeader({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(reactComponents.Heading, { variant: "secondary", children: title }), description !== undefined ? (jsxRuntime.jsx(reactComponents.Heading, { subtle: true, variant: "subtitle", children: description })) : null] }));
213
213
  };
214
214
 
215
215
  const cvaFormWizardComponentContainer = cssClassVarianceUtilities.cvaMerge(["p-responsive-space", "overflow-y-auto", "bg-neutral-50"]);
@@ -474,7 +474,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
474
474
  initialFullFormState);
475
475
  // If URL does not match a key from the schema, navigate to the first step
476
476
  const firstSchemaKey = String(sharedUtils.objectKeys(fullFormSchema.shape)[0]);
477
- const keyToCheck = subStepPath ? `${stepPath}/${subStepPath}` : stepPath;
477
+ const keyToCheck = Boolean(subStepPath) ? `${stepPath}/${subStepPath}` : stepPath;
478
478
  // Move navigation to useEffect to avoid setState during render
479
479
  react.useEffect(() => {
480
480
  if (fullFormSchema.shape[keyToCheck] === undefined) {
@@ -491,7 +491,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
491
491
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
492
492
  return typeof obj.shouldRender === "function";
493
493
  }, []);
494
- const currentVisibleStepKey = subStepPath ? `${stepPath}/${subStepPath}` : stepPath;
494
+ const currentVisibleStepKey = subStepPath !== undefined ? `${stepPath}/${subStepPath}` : stepPath;
495
495
  const currentVisibleStepIndex = react.useMemo(() => sharedUtils.objectKeys(steps)
496
496
  .filter(key => {
497
497
  const step = steps[key];
@@ -543,7 +543,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
543
543
  stepNumber: isSubStep ? undefined : rootSteps.indexOf(key) + 1,
544
544
  title,
545
545
  onClickNavigate: () => {
546
- if (previousStepKey) {
546
+ if (previousStepKey !== undefined) {
547
547
  const previousStepForm = stepForms[previousStepKey];
548
548
  setFullFormState(prev => ({
549
549
  ...prev,
package/index.esm.js CHANGED
@@ -207,7 +207,7 @@ const cvaFormWizardHeader = cvaMerge([
207
207
  * In most cases you should not be using this component directly, but rather use the FormWizard component.
208
208
  */
209
209
  const FormWizardHeader = ({ title, description, className, "data-testid": dataTestId, }) => {
210
- return (jsxs("div", { className: cvaFormWizardHeader({ className }), "data-testid": dataTestId, children: [jsx(Heading, { variant: "secondary", children: title }), description ? (jsx(Heading, { subtle: true, variant: "subtitle", children: description })) : null] }));
210
+ return (jsxs("div", { className: cvaFormWizardHeader({ className }), "data-testid": dataTestId, children: [jsx(Heading, { variant: "secondary", children: title }), description !== undefined ? (jsx(Heading, { subtle: true, variant: "subtitle", children: description })) : null] }));
211
211
  };
212
212
 
213
213
  const cvaFormWizardComponentContainer = cvaMerge(["p-responsive-space", "overflow-y-auto", "bg-neutral-50"]);
@@ -472,7 +472,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
472
472
  initialFullFormState);
473
473
  // If URL does not match a key from the schema, navigate to the first step
474
474
  const firstSchemaKey = String(objectKeys(fullFormSchema.shape)[0]);
475
- const keyToCheck = subStepPath ? `${stepPath}/${subStepPath}` : stepPath;
475
+ const keyToCheck = Boolean(subStepPath) ? `${stepPath}/${subStepPath}` : stepPath;
476
476
  // Move navigation to useEffect to avoid setState during render
477
477
  useEffect(() => {
478
478
  if (fullFormSchema.shape[keyToCheck] === undefined) {
@@ -489,7 +489,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
489
489
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
490
490
  return typeof obj.shouldRender === "function";
491
491
  }, []);
492
- const currentVisibleStepKey = subStepPath ? `${stepPath}/${subStepPath}` : stepPath;
492
+ const currentVisibleStepKey = subStepPath !== undefined ? `${stepPath}/${subStepPath}` : stepPath;
493
493
  const currentVisibleStepIndex = useMemo(() => objectKeys(steps)
494
494
  .filter(key => {
495
495
  const step = steps[key];
@@ -541,7 +541,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
541
541
  stepNumber: isSubStep ? undefined : rootSteps.indexOf(key) + 1,
542
542
  title,
543
543
  onClickNavigate: () => {
544
- if (previousStepKey) {
544
+ if (previousStepKey !== undefined) {
545
545
  const previousStepForm = stepForms[previousStepKey];
546
546
  setFullFormState(prev => ({
547
547
  ...prev,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-wizard",
3
- "version": "1.14.8",
3
+ "version": "1.15.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -10,10 +10,10 @@
10
10
  "react-hook-form": "7.62.0",
11
11
  "@tanstack/react-router": "1.114.29",
12
12
  "@tanstack/router-core": "1.114.29",
13
- "@trackunit/shared-utils": "1.13.67",
14
- "@trackunit/css-class-variance-utilities": "1.11.67",
15
- "@trackunit/react-components": "1.18.8",
16
- "@trackunit/i18n-library-translation": "1.12.58"
13
+ "@trackunit/shared-utils": "1.13.68",
14
+ "@trackunit/css-class-variance-utilities": "1.11.68",
15
+ "@trackunit/react-components": "1.18.9",
16
+ "@trackunit/i18n-library-translation": "1.13.0"
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=24.x",