react-wizard-engine 0.1.6 → 0.1.8
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/CHANGELOG.md +12 -0
- package/README.md +2 -5
- package/dist/chunk-RBC55LQI.js +2 -0
- package/dist/chunk-S2FOYHDE.cjs +2 -0
- package/dist/{components-provider-bC3_zfyb.d.cts → components-provider-CDmp3NL9.d.cts} +1 -1
- package/dist/{components-provider-bC3_zfyb.d.ts → components-provider-CDmp3NL9.d.ts} +1 -1
- package/dist/index.cjs +1 -2188
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2188
- package/dist/shadcn/index.cjs +1 -218
- package/dist/shadcn/index.d.cts +2 -2
- package/dist/shadcn/index.d.ts +2 -2
- package/dist/shadcn/index.js +1 -218
- package/package.json +1 -7
- package/dist/chunk-NDYZHURP.js +0 -90
- package/dist/chunk-NDYZHURP.js.map +0 -1
- package/dist/chunk-OV74AMBZ.cjs +0 -90
- package/dist/chunk-OV74AMBZ.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/shadcn/index.cjs.map +0 -1
- package/dist/shadcn/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# react-wizard-engine
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Strip sourcemaps from the published tarball and minify the dist bundle. Remove `repository` / `homepage` / `bugs` metadata fields, and prune GitHub-source links from the README (the repository is now closed-source; the live demo at https://react-wizard-engine.vercel.app/ remains public). Type declarations (`.d.ts`) and `LICENSE` continue to ship.
|
|
8
|
+
|
|
9
|
+
## 0.1.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Add `outline` variant to `IWizardButtonProps` and the `/shadcn` `defaultButton`. `WizardBack` now uses `variant="outline"` (the original shadcn-style "bordered transparent" look), matching what the package shipped with in the perks.loca.us monorepo source.
|
|
14
|
+
|
|
3
15
|
## 0.1.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# react-wizard-engine
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/react-wizard-engine)
|
|
4
|
-
[](https://github.com/knazark/react-wizard-engine/blob/main/LICENSE)
|
|
5
4
|
|
|
6
5
|
Multi-step flow engine for React. Steps, categories, branches. Pluggable strategies, listeners, initializers. Resolver hooks. Async navigation with cancellation. Headless core plus an opinionated Radix + Tailwind styled adapter.
|
|
7
6
|
|
|
@@ -49,8 +48,6 @@ export function SignupWizard() {
|
|
|
49
48
|
}
|
|
50
49
|
```
|
|
51
50
|
|
|
52
|
-
> Runnable Vite example: [`examples/basic/`](https://github.com/knazark/react-wizard-engine/tree/main/examples/basic) — 5 routes (`setup`, `setup-full`, `setup-initializer`, `linear`, `diamond`). `pnpm install && pnpm dev`.
|
|
53
|
-
|
|
54
51
|
## Styled adapter
|
|
55
52
|
|
|
56
53
|
The `/shadcn` subpath ships an opinionated styled `WizardTopBar` and `WizardLayout` built on Radix + Tailwind utility classes that match shadcn defaults.
|
|
@@ -87,7 +84,7 @@ import { Button } from '@/components/ui/button';
|
|
|
87
84
|
- **Category** — a group of steps sharing a header tab.
|
|
88
85
|
- **Branch** — a named path through categories.
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
Full type definitions ship with the package (.d.ts).
|
|
91
88
|
|
|
92
89
|
## Hooks
|
|
93
90
|
|
|
@@ -97,7 +94,7 @@ See `src/core/` for full type definitions.
|
|
|
97
94
|
|
|
98
95
|
## Strategies (pluggable)
|
|
99
96
|
|
|
100
|
-
Compose providers to override strategies/config. Back, visibility, progress, and scroll strategies are all overridable.
|
|
97
|
+
Compose providers to override strategies/config. Back, visibility, progress, and scroll strategies are all overridable. Each strategy class is exported by name from `react-wizard-engine`.
|
|
101
98
|
|
|
102
99
|
```ts
|
|
103
100
|
composeWizardProviders(
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var r=class extends Error{name="WizardError";constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}},c=class extends r{name="WizardInitializationError"},p=class extends r{name="WizardNavigationError"},d=class extends r{name="WizardResolverError"};import{createContext as g,useContext as C}from"react";import{jsx as o}from"react/jsx-runtime";var z=({children:e,className:t,disabled:n,onClick:i,type:a,"aria-label":m})=>o("button",{"aria-label":m,className:t,disabled:n,onClick:i,type:a??"button",children:e}),x=({className:e})=>o("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:o("path",{d:"M10 4 L6 8 L10 12",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})}),s={Button:z,BackArrowIcon:x},l=g(s);function h(e){let{Button:t,BackArrowIcon:n,children:i}=e,a={Button:t??s.Button,BackArrowIcon:n??s.BackArrowIcon};return o(l.Provider,{value:a,children:i})}function k(){return C(l)}import{createContext as W}from"react";var u=W(null);import{useContext as B,useSyncExternalStore as y}from"react";function R(){let e=B(u);if(!e)throw new r("useWizard must be used inside <WizardProvider>");return y(e.subscribe,e.getTreeSnapshot,e.getTreeSnapshot),e}import{clsx as I}from"clsx";import{twMerge as f}from"tailwind-merge";function O(...e){return f(I(...e))}export{r as a,c as b,p as c,d,h as e,k as f,u as g,R as h,O as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2; var _class3; var _class4;"use client";
|
|
2
|
+
var r= (_class =class extends Error{__init() {this.name="WizardError"}constructor(t){super(t);_class.prototype.__init.call(this);,Object.setPrototypeOf(this,new.target.prototype)}}, _class),c= exports.b = (_class2 =class extends r{constructor(...args) { super(...args); _class2.prototype.__init2.call(this); }__init2() {this.name="WizardInitializationError"}}, _class2),p= exports.c = (_class3 =class extends r{constructor(...args2) { super(...args2); _class3.prototype.__init3.call(this); }__init3() {this.name="WizardNavigationError"}}, _class3),d= exports.d = (_class4 =class extends r{constructor(...args3) { super(...args3); _class4.prototype.__init4.call(this); }__init4() {this.name="WizardResolverError"}}, _class4);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var z=({children:e,className:t,disabled:n,onClick:i,type:a,"aria-label":m})=>_jsxruntime.jsx.call(void 0, "button",{"aria-label":m,className:t,disabled:n,onClick:i,type:_nullishCoalesce(a, () => ("button")),children:e}),x=({className:e})=>_jsxruntime.jsx.call(void 0, "svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:_jsxruntime.jsx.call(void 0, "path",{d:"M10 4 L6 8 L10 12",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})}),s={Button:z,BackArrowIcon:x},l=_react.createContext.call(void 0, s);function h(e){let{Button:t,BackArrowIcon:n,children:i}=e,a={Button:_nullishCoalesce(t, () => (s.Button)),BackArrowIcon:_nullishCoalesce(n, () => (s.BackArrowIcon))};return _jsxruntime.jsx.call(void 0, l.Provider,{value:a,children:i})}function k(){return _react.useContext.call(void 0, l)}var u=_react.createContext.call(void 0, null);function R(){let e=_react.useContext.call(void 0, u);if(!e)throw new r("useWizard must be used inside <WizardProvider>");return _react.useSyncExternalStore.call(void 0, e.subscribe,e.getTreeSnapshot,e.getTreeSnapshot),e}var _clsx = require('clsx');var _tailwindmerge = require('tailwind-merge');function O(...e){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, ...e))}exports.a = r; exports.b = c; exports.c = p; exports.d = d; exports.e = h; exports.f = k; exports.g = u; exports.h = R; exports.i = O;
|