Skip to main content

@krakentech/blueprint-onboarding

12.1.2

Patch Changes

  • 2018507: Add explicit return type to API handler to fix Next.js type validation

12.1.1

Patch Changes

  • 2567a7c: New bundling strategy for better performance

    • Unbundle mode Packages are now bundled using tsdown's unbundle mode. This mode drastically reduces the number of generated file compared to the glob-filtered entries we used before, and prevented proper tree-shaking.

    • Automatic package.json exports tsdown is now responsible for generating the package.json exports, main, module, and types fields. This ensures packages follow best practices.

12.1.0

Minor Changes

  • f28134a: next-wizard: Add dynamic cookie splitting to increase the storage capacity.

12.0.1

Patch Changes

  • cfe6f66: Removed coral, coral-formik, and icons packages from peer dependencies.

    This change should not affect consuming applications, as all projects using this package are already importing components and types directly from Coral (e.g.: Stepper, type StepperProps).

12.0.0

Major Changes

11.0.0

Major Changes

  • 96c4eb3: The cookies-next dependency was updated to v6.1.0 as a first step toward App Router support.

    Key changes

    • Server-side utility functions from cookies-next are now asynchronous.

    Migration guide

    • @krakentech/blueprint-auth

    The getSessionData function is now asynchronous.

    - const session = getSessionData()
    + const session = await getSessionData()

    The sessionHandler API route handler is now asynchronous.

    The getAuthCookies, getRefreshToken, getSecureCookie, removeAllCookies, removeAuthCookies, removeSecureCookies, and setSecureCookie utility functions returned from createAuthCookieUtils are now asynchronous.

      const {
    getAuthCookies
    getRefreshToken
    getSecureCookie
    removeAllCookies
    removeAuthCookies
    removeSecureCookies
    setSecureCookie
    } = createAuthCookieUtils({ req, res })

    - const cookies = getAuthCookies()
    + const cookies = await getAuthCookies()

    - const accessToken = getSecureCookie("access")
    + const accessToken = await getSecureCookie("access")

    - removeAllCookies()
    + await removeAllCookies()

    - removeAuthCookies()
    + await removeAuthCookies()

    - removeSecureCookies()
    + await removeSecureCookies(["access", "refresh"])

    - setSecureCookie({ key: "access", value: "foo" })
    + await setSecureCookie({ key: "access", value: "foo" })
    • @krakentech/blueprint-onboarding

    The deleteCookieOnServer utility function returned by createNextWizard is now asynchronous.

    - deleteCookieOnServer()
    + await deleteCookieOnServer()

Minor Changes

  • 63447ac: Allow Next 15 and React 19 as peer dependencies.

    The minimum required versions are still the same:

    • next@14.2.25
    • react@18.2.0
    • react-dom@18.2.0.
    • @types/react@18.3.23

10.0.1

Patch Changes

  • 8f195fc: Set files: ["dist"]

10.0.0

Major Changes

  • 2496075: Move legacy wizard client-side code into a dedicated /client submodule.

    ⚠️ This change requires updating imports:

    From:

    import { createWizard } from "@krakentech/blueprint-onboarding";

    To:

    import { createWizard } from "@krakentech/blueprint-onboarding/client";

9.3.0

Minor Changes

  • 6343863: Turn the package into an ES Module. This includes:

    • Adding "type": "module" to the package.json
    • Updating the exports field to include both ESM and CommonJS versions
    • Ensuring all imports and exports are compatible with ESM

    It shouldn't break any existing functionality, as the CommonJS version is still available for compatibility.

9.2.1

Patch Changes

  • 971dd01: # Enable tree-shaking of blueprint packages

    The blueprint packages are now code-split and tagged as side-effect free. Bundlers such as Webpack are able to perform tree-shaking and only include necessary code in application bundles.

9.2.0

Minor Changes

  • f0fef09: Next Wizard:

    • Add new handleQueryParams util to streamline initial query param injection.
    • Improve JSDocs.
    • Fix redirection URL build logic for rare edge cases containing special characters in the query params. This can otherwise cause the generated redirect url to mismatch the context.resolvedUrl in cases where it should match. Which then can cause an infinite redirect loop within the query param injection logic.

9.1.1

Patch Changes

  • 24f404c: The getSteps() function now returns a structured clone of steps to prevent mutating the steps config directly.

9.1.0

Minor Changes

  • 94629d0: next-wizard: add getInitialState util which returns a structured clone of the initial state.

9.0.1

Patch Changes

9.0.0

Major Changes

  • 88fb56e: What changed?

    In this release, the way state is handled has been overhauled, there were a lot of renamings and new utils have been added. The state shape is now fully dynamic and doesn't assume the formValues / submittedSteps shape. The serializers are applied on the full state object.

    -    serializeFormValues: (formValues) => ...,
    - deserializeFormValues: (serializedFormValues) => ...,
    - initialValues,
    + serializeState: (state) => ...,
    + deserializeState: (serializedState) => ...,
    + initialState,

    Many utils and props have been renamed to the new state naming convention, such as the cookie api route handler util and config. Here are a few examples of these changes.

    -    setCookieFormDataApiHandlerRoute: '/api/your/path',
    + cookieApiHandlerRoute: '/api/your/path',
    -    getFormCookieApiHandler(...),
    + getCookieStateApiHandler(...),
    -    const cookieFormData = await getCookieFormData(context);
    + const cookieState = await wizard.getCookieStateOnServer(context);

    const isUnlocked = getIsStepUnlocked({
    stepName: OnboardingStep.Details,
    - cookieFormData,
    + submittedSteps: cookieState.submittedSteps,
    + state: cookieState,
    });
        props: {
    - serializedFormValues: serializeFormValues(
    - cookieFormData.formValues
    - ),
    - submittedSteps: cookieFormData.submittedSteps,
    + serializedState: wizard.serializeState(cookieState),
    },
    export default function Page({
    - serializedFormValues,
    - submittedSteps,
    + serializedState,
    }: InferGetServerSidePropsType<typeof getServerSideProps>) {
    - return (
    - <Details
    - serializedFormValues={serializedFormValues}
    - submittedSteps={submittedSteps}
    - />
    - );
    + return <Details serializedState={serializedState} />;
    }

    There is a new getRedirect util which returns the full redirect object to save syntax.

    -    return {
    - redirect: {
    - destination: getRedirectionDestination(cookieFormData),
    - permanent: false,
    - },
    - };
    + return wizard.getRedirect({
    + state: cookieState,
    + submittedSteps: cookieState.submittedSteps,
    + });

    Support for the substep pattern has been removed, so parentName is no longer available. Also, queryParams is removed to query to match the router.push() interface of the NextRouter.

    export type WizardStep<TStepName extends string> = {
    /**
    * Step technical name
    */
    name: TStepName;
    - /**
    - * Parent step title
    - */
    - parentName?: TStepName;
    /**
    * Step route
    */
    pathname: string;
    /**
    * Step query params
    */
    - queryParams?: ParsedUrlQuery;
    + query?: ParsedUrlQuery;
    };

    Any state modification is now separated from the submission logic, which means that the submittedSteps logic has to be handled beforehand as in the example below. The addToSubmittedSteps helper can be used, but any custom logic may be applied. Furthermore, the new utils toNextStep, toPreviousStep and toStep can be used to save some syntax if that is desired.

    onSubmit={async (values) => {
    - const cookieFormData = {
    + const newState: DemoOnboardingState = {
    + ...state,
    formValues: values,
    - submittedSteps,
    + submittedSteps: wizard.addToSubmittedSteps({
    + stepName: OnboardingStep.Quote,
    + submittedSteps: state.submittedSteps,
    + }),
    };

    - await setCookieFormData({
    - stepName: OnboardingStep.Quote,
    - cookieFormData,
    + await wizard.setCookieStateOnClient({
    + state: newState,
    });

    - const nextStep = getNextStep({
    - stepName: OnboardingStep.Quote,
    - cookieFormData,
    - });
    -
    - await router.push({
    - pathname: nextStep.pathname,
    - query: nextStep.queryParams,
    + await wizard.toNextStep({
    + currentStepName: OnboardingStep.Quote,
    + state: newState,
    + router,
    + });
    }}

8.0.0

Major Changes

  • 4c31ca4: Upgrade packages to Coral v23.2.0

7.0.2

Patch Changes

  • 061b700: Fix initialValues reference bug in next-wizard

7.0.1

Patch Changes

  • b0e1a3a: Bump Coral to fix Button's text overlapping container and spill over issues

7.0.0

Major Changes

  • de936a6: Upgrade Coral versions

6.1.3

Patch Changes

  • 4fa4096: Remove unused testing-library dependency

6.1.2

Patch Changes

  • 3804b9d: Improve error handling in getCookieFormData function and fix buffer type error

6.1.1

Patch Changes

  • de0b271: Fix next-wizard entry point configuration

6.1.0

Minor Changes

  • 22d073c: Add new next-wizard with full support for multiple page SSR journeys with state persistance

6.0.0

Major Changes

  • 25621da: Upgrade to Coral 21

5.1.1

Patch Changes

  • 21308c2: Bump @krakentech/icons to v2.6.1

5.1.0

Minor Changes

  • dbf6e15: add defaultFormValues props to WizardProvider

5.0.0

Major Changes

  • 266a83e: Upgrade to Coral 20

4.0.1

Patch Changes

  • 0b7d0a6: WizardRouteGuard: Fix validateStep promise handling which prevented onInvalidStep from being called

4.0.0

Major Changes

  • 98bad06: Upgrade Coral to next major version

    This upgrades the Coral peer dependency from v18 to v19, which involved reworking the responsive props from desktop first to mobile first.

    It's important that your project is using Coral v19 to upgrade past this point if you're using the Consumption components, otherwise your layouts of Graph components won't look right.

3.0.0

Major Changes

  • adac2cf: Revert to Coral 18 to provide more graceful upgrade path.

    We previously released a change to upgrade our components to use Coral 19, however we didn't have a way to provide fixes to older versions and not all projects can upgrade to Coral 19 immediately. This change reverts us back to Coral 18 while we work on a better way to upgrade.

2.0.0

Major Changes

  • efdae3f: The dependency Coral major update to 19.11.1

1.0.0

Major Changes

  • 1eb08bf: Replace the existing route guard mechanism by the new WizardRouteGuard component

0.6.0

Minor Changes

  • 854a8be: Onboarding Wizard: Add resetWizard, resetHistory, and missing documentation

0.5.2

Patch Changes

  • 5d7deb5: fix active step selected for stepper when used for substeps

0.5.1

Patch Changes

  • ae647fb: Add check for step index before using toStep

0.5.0

Minor Changes

  • 3768130: Onboarding: Add transformBeforeHydration prop to WizardFormHydrator to enable transforming form values before they are hydrated in to the form

0.4.1

Patch Changes

  • 2d1ba81: Add tests for form wizard and refactor function to use filtered steps in all cases

0.4.0

Minor Changes

  • 0f32956: Add config option for resuming onboarding mid-journey

0.3.2

Patch Changes

  • e608686: Dynamic routes support for wizard

0.3.1

Patch Changes

  • 30d8d2b: Remove unneccessary dependency

0.3.0

Minor Changes

  • 6370bf4: set form input theme prop as default override from theme

0.2.0

Minor Changes

  • 39e219a: Create Blueprint onboarding advanced formValues state management functions (update/reset/clear)

0.1.1

Patch Changes

  • e3df006: Create Blueprint onboarding package from Coral package

0.1.0

Minor Changes

  • 29978c2: Enable dynamic query params in wizard steps

0.0.1

Patch Changes

  • f342501: New onboarding package with wizard feature