@connextar/house 0.3.0 → 0.5.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.
Files changed (58) hide show
  1. package/README.md +242 -6
  2. package/dist/setup-guide/bits.d.ts +89 -0
  3. package/dist/setup-guide/bits.d.ts.map +1 -0
  4. package/dist/setup-guide/bits.js +134 -0
  5. package/dist/setup-guide/bits.js.map +1 -0
  6. package/dist/setup-guide/card.d.ts +33 -0
  7. package/dist/setup-guide/card.d.ts.map +1 -0
  8. package/dist/setup-guide/card.js +56 -0
  9. package/dist/setup-guide/card.js.map +1 -0
  10. package/dist/setup-guide/class-names.d.ts +68 -0
  11. package/dist/setup-guide/class-names.d.ts.map +1 -0
  12. package/dist/setup-guide/class-names.js +63 -0
  13. package/dist/setup-guide/class-names.js.map +1 -0
  14. package/dist/setup-guide/context.d.ts +89 -0
  15. package/dist/setup-guide/context.d.ts.map +1 -0
  16. package/dist/setup-guide/context.js +124 -0
  17. package/dist/setup-guide/context.js.map +1 -0
  18. package/dist/setup-guide/guide.d.ts +159 -0
  19. package/dist/setup-guide/guide.d.ts.map +1 -0
  20. package/dist/setup-guide/guide.js +128 -0
  21. package/dist/setup-guide/guide.js.map +1 -0
  22. package/dist/setup-guide/index.d.ts +27 -0
  23. package/dist/setup-guide/index.d.ts.map +1 -0
  24. package/dist/setup-guide/index.js +27 -0
  25. package/dist/setup-guide/index.js.map +1 -0
  26. package/dist/setup-guide/launcher.d.ts +38 -0
  27. package/dist/setup-guide/launcher.d.ts.map +1 -0
  28. package/dist/setup-guide/launcher.js +60 -0
  29. package/dist/setup-guide/launcher.js.map +1 -0
  30. package/dist/setup-guide/strip.d.ts +21 -0
  31. package/dist/setup-guide/strip.d.ts.map +1 -0
  32. package/dist/setup-guide/strip.js +42 -0
  33. package/dist/setup-guide/strip.js.map +1 -0
  34. package/dist/wizard/index.d.ts +26 -0
  35. package/dist/wizard/index.d.ts.map +1 -0
  36. package/dist/wizard/index.js +26 -0
  37. package/dist/wizard/index.js.map +1 -0
  38. package/dist/wizard/invalid.d.ts +91 -0
  39. package/dist/wizard/invalid.d.ts.map +1 -0
  40. package/dist/wizard/invalid.js +121 -0
  41. package/dist/wizard/invalid.js.map +1 -0
  42. package/dist/wizard/react-hook-form-index.d.ts +12 -0
  43. package/dist/wizard/react-hook-form-index.d.ts.map +1 -0
  44. package/dist/wizard/react-hook-form-index.js +12 -0
  45. package/dist/wizard/react-hook-form-index.js.map +1 -0
  46. package/dist/wizard/rhf-adapter.d.ts +32 -0
  47. package/dist/wizard/rhf-adapter.d.ts.map +1 -0
  48. package/dist/wizard/rhf-adapter.js +58 -0
  49. package/dist/wizard/rhf-adapter.js.map +1 -0
  50. package/dist/wizard/rules.d.ts +92 -0
  51. package/dist/wizard/rules.d.ts.map +1 -0
  52. package/dist/wizard/rules.js +105 -0
  53. package/dist/wizard/rules.js.map +1 -0
  54. package/dist/wizard/wizard.d.ts +127 -0
  55. package/dist/wizard/wizard.d.ts.map +1 -0
  56. package/dist/wizard/wizard.js +195 -0
  57. package/dist/wizard/wizard.js.map +1 -0
  58. package/package.json +19 -2
@@ -0,0 +1,195 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Check, ChevronLeft, ChevronRight } from "lucide-react";
4
+ import * as React from "react";
5
+ import { cx } from "../internal/cx.js";
6
+ import { ERROR_ATTRIBUTE } from "./invalid.js";
7
+ import { checkStep, firstFailure, isReachable, markerState, nextIndex, percentComplete, previousIndex, } from "./rules.js";
8
+ /** Inputs where Enter is not "I'm done with this field". */
9
+ const NOT_ONE_LINE_FIELDS = new Set([
10
+ "button",
11
+ "checkbox",
12
+ "color",
13
+ "file",
14
+ "hidden",
15
+ "image",
16
+ "radio",
17
+ "range",
18
+ "reset",
19
+ "submit",
20
+ ]);
21
+ /**
22
+ * The house look, on the shared theme tokens. An app without them — MAS keeps
23
+ * its palette in literal classes — replaces the parts it needs through
24
+ * `classNames`, exactly as the guide renderer allows.
25
+ */
26
+ export const WIZARD_CLASS_NAMES = {
27
+ form: "flex flex-col gap-5",
28
+ markers: "flex items-center gap-2",
29
+ markerItem: "flex min-w-0 flex-1 items-center gap-2 last:flex-none sm:last:flex-1",
30
+ marker: "flex min-w-0 items-center gap-2 rounded-lg px-1.5 py-1 text-left transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:flex-1",
31
+ markerLocked: "cursor-not-allowed opacity-60",
32
+ circle: "flex size-6 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",
33
+ circleDone: "border-primary bg-primary text-primary-foreground",
34
+ circleCurrent: "border-2 border-primary text-primary",
35
+ circleUpcoming: "border-border text-muted-foreground",
36
+ markerTitle: "hidden truncate text-sm sm:block",
37
+ markerTitleCurrent: "font-medium text-foreground",
38
+ connector: "h-px flex-1 bg-border sm:w-3 sm:flex-none",
39
+ connectorDone: "bg-primary",
40
+ bar: "h-1.5 w-full overflow-hidden rounded-full bg-muted",
41
+ barFill: "h-full rounded-full bg-primary transition-[width]",
42
+ heading: "text-sm font-medium",
43
+ description: "text-xs text-muted-foreground",
44
+ alert: "rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive",
45
+ panel: "space-y-4",
46
+ footer: "flex items-center justify-between gap-2 border-t border-border pt-4",
47
+ counter: "text-xs tabular-nums text-muted-foreground",
48
+ button: "inline-flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:pointer-events-none disabled:opacity-60",
49
+ backButton: "text-muted-foreground hover:bg-muted hover:text-foreground",
50
+ forwardButton: "bg-primary text-primary-foreground hover:bg-primary/90",
51
+ };
52
+ /**
53
+ * A long form split into steps. The one stepper for every multi-step form in
54
+ * every app — the union of what five of them each learnt the hard way.
55
+ *
56
+ * - **It renders the `<form>` itself,** so nothing reaches `onSubmit`
57
+ * unchecked and so Enter has one place to land. A wizard sitting inside
58
+ * somebody else's form cannot promise either.
59
+ * - **Enter never skips ahead.** Pressing Enter in a one-line field submits the
60
+ * form the browser's way, and before the last step that submission means
61
+ * Continue: this step is checked and, if it passes, the next one opens. Only
62
+ * the last step's Enter submits.
63
+ * - **There is one submit button and its `type` never changes.** PharmaLine put
64
+ * a `type="button"` Continue and a `type="submit"` Create in the same slot;
65
+ * React reused the one DOM node and switched its type mid-click, and Chromium
66
+ * submitted — every booking made from the dashboard skipped Confirm and sent a
67
+ * confirmation nobody chose. jsdom's timing hid it, so the guard here is
68
+ * structural rather than behavioural: one button, always `type="submit"`.
69
+ * - **Steps are checked as you leave them.** `onValidateStep` (or the step's own
70
+ * `validate`) is asked before each advance, and the step stays put if it
71
+ * refuses, saying why when the check gave a message.
72
+ * - **Submitting checks every step, in order, and lands on the first that
73
+ * fails.** Checking only the last one, or none at all, is how a form refuses
74
+ * with the problem on a screen nobody is looking at.
75
+ * - **Continue is never disabled for being incomplete.** A greyed-out button
76
+ * that will not say what is missing is a refusal with no words; it is only
77
+ * disabled while something is actually in flight.
78
+ * - **Visited markers are clickable; steps ahead stay locked** (unless
79
+ * `allReachable`), so the tracker is navigation rather than a way past a step
80
+ * that has never been checked.
81
+ * - **All steps stay mounted,** hidden rather than unmounted: one register, and
82
+ * nothing typed is lost by stepping back to check something.
83
+ *
84
+ * What it deliberately does not do is validate anything itself, or know what a
85
+ * button looks like. The check is a function the host supplies, so
86
+ * react-hook-form, plain state and a form built out of `useState` can all host
87
+ * it; the look is theme-token classes an app replaces through `classNames`.
88
+ */
89
+ export function FormWizard({ steps, onValidateStep, onSubmit, onCancel, submitLabel = "Save", nextLabel = "Continue", cancelLabel = "Cancel", backLabel = "Back", pending = false, allReachable = false, showProgressBar = false, header, className, footerClassName, classNames, "aria-label": ariaLabel, }) {
90
+ const c = { ...WIZARD_CLASS_NAMES, ...classNames };
91
+ const [current, setCurrent] = React.useState(0);
92
+ const [furthest, setFurthest] = React.useState(allReachable ? steps.length - 1 : 0);
93
+ const [checking, setChecking] = React.useState(false);
94
+ const [problem, setProblem] = React.useState(null);
95
+ const inFlight = React.useRef(false);
96
+ const formId = React.useId();
97
+ const step = steps[current];
98
+ const isFirst = current === 0;
99
+ const isLast = current === steps.length - 1;
100
+ const busy = pending || checking;
101
+ function goTo(index) {
102
+ setProblem(null);
103
+ setCurrent(index);
104
+ }
105
+ async function goNext() {
106
+ if (!step)
107
+ return;
108
+ setChecking(true);
109
+ try {
110
+ const result = await checkStep(step, onValidateStep);
111
+ if (!result.ok) {
112
+ setProblem(result.message);
113
+ return;
114
+ }
115
+ }
116
+ finally {
117
+ setChecking(false);
118
+ }
119
+ const next = nextIndex(current, steps.length);
120
+ setProblem(null);
121
+ setCurrent(next);
122
+ setFurthest((seen) => Math.max(seen, next));
123
+ }
124
+ async function submit() {
125
+ setChecking(true);
126
+ try {
127
+ const failure = await firstFailure(steps, onValidateStep);
128
+ if (failure) {
129
+ // Show the step that holds the problem, so its message is on screen.
130
+ setCurrent(failure.index);
131
+ setProblem(failure.message);
132
+ return;
133
+ }
134
+ setProblem(null);
135
+ }
136
+ finally {
137
+ setChecking(false);
138
+ }
139
+ await onSubmit();
140
+ }
141
+ /**
142
+ * Every way of submitting — the footer button, or Enter in a field — comes
143
+ * through here, and before the last step it means Continue. Re-entry is
144
+ * refused rather than queued: a second press is the person saying the first
145
+ * one gave them nothing to look at.
146
+ */
147
+ function handleSubmit(event) {
148
+ event.preventDefault();
149
+ if (busy || inFlight.current)
150
+ return;
151
+ inFlight.current = true;
152
+ void (isLast ? submit() : goNext()).finally(() => {
153
+ inFlight.current = false;
154
+ });
155
+ }
156
+ /**
157
+ * Enter in a one-line field means "go on", whatever the field. Browsers
158
+ * disagree about Enter in some of them — Chromium does nothing on Enter in a
159
+ * date-and-time field — so the form asks for submission itself. A field that
160
+ * handles Enter on its own (and cancels it) is left alone, and so is a
161
+ * textarea, where Enter is a new line.
162
+ */
163
+ function handleKeyDown(event) {
164
+ if (event.key !== "Enter" || event.defaultPrevented || event.nativeEvent.isComposing)
165
+ return;
166
+ const target = event.target;
167
+ if (!(target instanceof HTMLInputElement) || NOT_ONE_LINE_FIELDS.has(target.type))
168
+ return;
169
+ event.preventDefault();
170
+ event.currentTarget.requestSubmit();
171
+ }
172
+ if (!step)
173
+ return null;
174
+ const percent = percentComplete(current, steps.length);
175
+ return (_jsxs("form", { onSubmit: handleSubmit, onKeyDown: handleKeyDown, noValidate: true, "aria-label": ariaLabel, className: cx(c.form, className), children: [header, _jsx("ol", { className: c.markers, "aria-label": "Progress", children: steps.map((s, index) => {
176
+ const state = markerState(index, current);
177
+ const reachable = isReachable(index, furthest);
178
+ return (_jsxs("li", { className: c.markerItem, children: [_jsxs("button", { type: "button", disabled: !reachable || busy, onClick: () => goTo(index), "aria-current": state === "current" ? "step" : undefined, "aria-controls": `${formId}-${s.id}`, "aria-label": `Step ${index + 1}: ${s.title}`, className: cx(c.marker, !reachable && c.markerLocked), children: [_jsx("span", { "aria-hidden": true, className: cx(c.circle, state === "done" && c.circleDone, state === "current" && c.circleCurrent, state === "upcoming" && c.circleUpcoming), children: state === "done" ? _jsx(Check, { className: "size-3.5" }) : index + 1 }), _jsx("span", { "aria-hidden": true, className: cx(c.markerTitle, state === "current" && c.markerTitleCurrent), children: s.title })] }), index < steps.length - 1 ? (_jsx("span", { "aria-hidden": true, className: cx(c.connector, state === "done" && c.connectorDone) })) : null] }, s.id));
179
+ }) }), showProgressBar ? (_jsx("div", { className: c.bar, role: "progressbar", "aria-label": "Form progress", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent, children: _jsx("div", { className: c.barFill, style: { width: `${percent}%` } }) })) : null, _jsxs("div", { children: [_jsx("h3", { className: cx(c.heading, "sm:hidden"), children: step.title }), step.description ? _jsx("p", { className: c.description, children: step.description }) : null] }), problem ? (_jsx("p", { className: c.alert, role: "alert", children: problem })) : null, steps.map((s, index) => (_jsx("section", { id: `${formId}-${s.id}`, hidden: index !== current, "aria-label": s.title, className: c.panel, children: s.content }, s.id))), _jsxs("div", { className: cx(c.footer, footerClassName), children: [isFirst && onCancel ? (_jsx("button", { type: "button", onClick: onCancel, disabled: pending, className: cx(c.button, c.backButton), children: cancelLabel })) : (_jsxs("button", { type: "button", onClick: () => goTo(previousIndex(current)), disabled: isFirst || busy, className: cx(c.button, c.backButton), children: [_jsx(ChevronLeft, { className: "size-4", "aria-hidden": true }), backLabel] })), _jsxs("span", { className: c.counter, "aria-live": "polite", children: ["Step ", current + 1, " of ", steps.length] }), _jsx("button", { type: "submit", disabled: busy, "data-busy": busy ? "true" : undefined, className: cx(c.button, c.forwardButton), children: isLast ? (submitLabel) : (_jsxs(_Fragment, { children: [nextLabel, _jsx(ChevronRight, { className: "size-4", "aria-hidden": true })] })) })] })] }));
180
+ }
181
+ /**
182
+ * A field's error message, marked so the reporter can tell a visible error from
183
+ * a hidden one. An app whose form library draws its own message adds
184
+ * `data-error-for` to that component instead of using this.
185
+ */
186
+ export function FieldError({ name, message, className, }) {
187
+ if (!message)
188
+ return null;
189
+ return (_jsx("p", { [ERROR_ATTRIBUTE]: name, className: className ?? "text-xs text-destructive", children: message }));
190
+ }
191
+ /** A read-only label/value row, for the review step at the end of a wizard. */
192
+ export function ReviewRow({ label, value }) {
193
+ return (_jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-border py-2 last:border-0", children: [_jsx("span", { className: "text-sm text-muted-foreground", children: label }), _jsx("span", { className: "text-right text-sm font-medium", children: value || _jsx("span", { className: "text-muted-foreground", children: "\u2014" }) })] }));
194
+ }
195
+ //# sourceMappingURL=wizard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard.js","sourceRoot":"","sources":["../../src/wizard/wizard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,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FAAkF,aAC/F,eAAM,SAAS,EAAC,+BAA+B,YAAE,KAAK,GAAQ,EAC9D,eAAM,SAAS,EAAC,gCAAgC,YAC7C,KAAK,IAAI,eAAM,SAAS,EAAC,uBAAuB,uBAAS,GACrD,IACH,CACP,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connextar/house",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "The pieces every app we build needs and none of them should own a copy of.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -50,6 +50,18 @@
50
50
  "types": "./dist/ux/navigation-index.d.ts",
51
51
  "default": "./dist/ux/navigation-index.js"
52
52
  },
53
+ "./wizard": {
54
+ "types": "./dist/wizard/index.d.ts",
55
+ "default": "./dist/wizard/index.js"
56
+ },
57
+ "./wizard/react-hook-form": {
58
+ "types": "./dist/wizard/react-hook-form-index.d.ts",
59
+ "default": "./dist/wizard/react-hook-form-index.js"
60
+ },
61
+ "./setup-guide": {
62
+ "types": "./dist/setup-guide/index.d.ts",
63
+ "default": "./dist/setup-guide/index.js"
64
+ },
53
65
  "./editor": {
54
66
  "types": "./dist/editor/index.d.ts",
55
67
  "default": "./dist/editor/index.js"
@@ -85,11 +97,15 @@
85
97
  "peerDependencies": {
86
98
  "next": "^16.0.0",
87
99
  "react": "^19.0.0",
88
- "react-dom": "^19.0.0"
100
+ "react-dom": "^19.0.0",
101
+ "react-hook-form": "^7.60.0"
89
102
  },
90
103
  "peerDependenciesMeta": {
91
104
  "next": {
92
105
  "optional": true
106
+ },
107
+ "react-hook-form": {
108
+ "optional": true
93
109
  }
94
110
  },
95
111
  "devDependencies": {
@@ -106,6 +122,7 @@
106
122
  "prettier": "^3.0.0",
107
123
  "react": "^19.2.8",
108
124
  "react-dom": "^19.2.8",
125
+ "react-hook-form": "^7.68.0",
109
126
  "typescript": "^5.7.0",
110
127
  "typescript-eslint": "^8.69.0",
111
128
  "vitest": "^4.0.0"