@rightkit/onboarding 0.0.0-stage → 0.1.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/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +14 -2
- package/dist/Onboarding.d.ts +3 -0
- package/dist/Onboarding.js +98 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/steps.d.ts +16 -0
- package/dist/steps.js +71 -0
- package/dist/types.d.ts +98 -0
- package/dist/types.js +1 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/onboarding.css +37 -0
- package/package.json +54 -3
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Adrian D'souza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @rightkit/onboarding
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
First-run onboarding framework for Right Suite apps: a legal agreement gate first, then ordered steps (permissions, model download, licence/trial, plus app-defined steps) with progress, skip and resume.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Onboarding } from "@rightkit/onboarding";
|
|
7
|
+
import "@rightkit/onboarding/onboarding.css";
|
|
8
|
+
|
|
9
|
+
<Onboarding settings={settings} legal={legal} permissions={permissions} models={models} license={license}
|
|
10
|
+
onComplete={finish} onSkip={later} />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- `settings` is a `SettingsBackend`; progress is stored under the `onboarding.state` key.
|
|
14
|
+
- The agreement is enforced whenever `legalAccepted` is not persisted as `true`, regardless of the saved step index.
|
|
15
|
+
- `onComplete` and `onSkip` run only after the state was saved. A rejected save is shown in an alert and neither callback runs.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OnboardingProps } from "./types.js";
|
|
2
|
+
export declare function onboardingStateKey(): string;
|
|
3
|
+
export declare function Onboarding({ settings, legal, steps, permissions, models, license, onComplete, onSkip, className }: OnboardingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { LegalGate } from "@rightkit/legal-ui";
|
|
4
|
+
import { Button } from "@rightkit/app-shell/react";
|
|
5
|
+
import { cx } from "./ui.js";
|
|
6
|
+
import { licenseStep, modelsStep, permissionsStep } from "./steps.js";
|
|
7
|
+
const KEY = "onboarding.state";
|
|
8
|
+
const INITIAL = { version: 1, currentStep: 0, completed: [], skipped: false, legalAccepted: false };
|
|
9
|
+
function readState(value) {
|
|
10
|
+
if (!value || typeof value !== "object")
|
|
11
|
+
return INITIAL;
|
|
12
|
+
const candidate = value;
|
|
13
|
+
return {
|
|
14
|
+
version: 1,
|
|
15
|
+
currentStep: typeof candidate.currentStep === "number" && candidate.currentStep >= 0 ? Math.floor(candidate.currentStep) : 0,
|
|
16
|
+
completed: Array.isArray(candidate.completed) ? candidate.completed.filter((x) => typeof x === "string") : [],
|
|
17
|
+
skipped: candidate.skipped === true,
|
|
18
|
+
legalAccepted: candidate.legalAccepted === true,
|
|
19
|
+
eligibilityBasis: candidate.eligibilityBasis === "individual" || candidate.eligibilityBasis === "enterprise" ? candidate.eligibilityBasis : undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function onboardingStateKey() { return KEY; }
|
|
23
|
+
export function Onboarding({ settings, legal, steps = [], permissions, models, license, onComplete, onSkip, className }) {
|
|
24
|
+
const [state, setState] = useState(null);
|
|
25
|
+
const [saving, setSaving] = useState(false);
|
|
26
|
+
const [error, setError] = useState(null);
|
|
27
|
+
/** Persists a patch; throws when the settings backend rejects it. */
|
|
28
|
+
const persist = useCallback(async (patch) => {
|
|
29
|
+
setSaving(true);
|
|
30
|
+
setError(null);
|
|
31
|
+
const next = { ...(state ?? INITIAL), ...patch };
|
|
32
|
+
try {
|
|
33
|
+
const snap = await settings.patch({ [KEY]: next });
|
|
34
|
+
setState(readState(snap.values[KEY]));
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setSaving(false);
|
|
42
|
+
}
|
|
43
|
+
}, [settings, state]);
|
|
44
|
+
/** Like `persist` but reports success as a boolean; the failure is already visible via `error`. */
|
|
45
|
+
const save = useCallback(async (patch) => {
|
|
46
|
+
try {
|
|
47
|
+
await persist(patch);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}, [persist]);
|
|
54
|
+
const saveStep = useCallback(async (patch) => { await save(patch); }, [save]);
|
|
55
|
+
useEffect(() => { let live = true; void settings.load().then((snapshot) => { if (live)
|
|
56
|
+
setState(readState(snapshot.values[KEY])); }, (e) => { if (live)
|
|
57
|
+
setError(e instanceof Error ? e.message : String(e)); }); return () => { live = false; }; }, [settings]);
|
|
58
|
+
const builtins = useMemo(() => [
|
|
59
|
+
{ id: "legal", label: "Agreement", title: "Review agreement", skippable: false, render: () => null },
|
|
60
|
+
...(permissions ? [permissionsStep(permissions)] : []),
|
|
61
|
+
...(models ? [modelsStep(models)] : []),
|
|
62
|
+
...(license ? [licenseStep(license)] : []),
|
|
63
|
+
...steps,
|
|
64
|
+
], [license, models, permissions, steps]);
|
|
65
|
+
const activeState = state ?? INITIAL;
|
|
66
|
+
// The agreement gate does not depend on the saved step: until it is accepted, the active step is the first.
|
|
67
|
+
const index = activeState.legalAccepted ? Math.min(activeState.currentStep, builtins.length - 1) : 0;
|
|
68
|
+
const active = builtins[index];
|
|
69
|
+
const context = { state: activeState, settings, setState: saveStep, permissions, models, license };
|
|
70
|
+
const runCallback = async (callback) => {
|
|
71
|
+
try {
|
|
72
|
+
await callback?.();
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const markAndMove = async (nextIndex, completedId) => {
|
|
79
|
+
const completed = completedId && !activeState.completed.includes(completedId) ? [...activeState.completed, completedId] : activeState.completed;
|
|
80
|
+
if (nextIndex >= builtins.length) {
|
|
81
|
+
if (await save({ completed, currentStep: Math.max(0, builtins.length - 1), skipped: false }))
|
|
82
|
+
await runCallback(onComplete);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
await save({ completed, currentStep: nextIndex, skipped: false });
|
|
86
|
+
};
|
|
87
|
+
if (error && !state)
|
|
88
|
+
return _jsxs("div", { className: cx("rk-onboarding", className), children: [_jsx("p", { className: "rk-onboarding__error", role: "alert", children: error }), _jsx(Button, { onClick: () => window.location.reload(), children: "Retry" })] });
|
|
89
|
+
if (!state || !active)
|
|
90
|
+
return _jsx("div", { className: cx("rk-onboarding", className), "aria-busy": "true", children: _jsx("p", { className: "rk-onboarding__muted", children: "Loading setup\u2026" }) });
|
|
91
|
+
if (!activeState.legalAccepted) {
|
|
92
|
+
return _jsx("div", { className: cx("rk-onboarding rk-onboarding--legal", className), "data-testid": "onboarding-legal", children: _jsx(LegalGate, { ...legal, variant: "first-run", onQuit: () => void legal.onQuit?.(), onAgree: async ({ eligibilityBasis }) => { await persist({ legalAccepted: true, eligibilityBasis, completed: ["legal"], currentStep: builtins.length > 1 ? 1 : 0 }); if (builtins.length === 1)
|
|
93
|
+
await onComplete(); } }) });
|
|
94
|
+
}
|
|
95
|
+
const body = active.render(context);
|
|
96
|
+
return _jsxs("main", { className: cx("rk-onboarding", className), "data-testid": "onboarding", "data-step-id": active.id, children: [_jsxs("aside", { className: "rk-onboarding__rail", children: [_jsx("div", { className: "rk-onboarding__brand", children: legal.appName }), _jsx("nav", { "aria-label": "Setup progress", children: builtins.map((step, i) => _jsxs("button", { type: "button", className: cx("rk-onboarding__step", i === index && "is-active", activeState.completed.includes(step.id) && "is-done"), "aria-current": i === index ? "step" : undefined, onClick: () => { if (i > 0 || activeState.legalAccepted)
|
|
97
|
+
void save({ currentStep: i }); }, children: [_jsx("span", { children: activeState.completed.includes(step.id) ? "✓" : i + 1 }), step.label] }, step.id)) })] }), _jsxs("section", { className: "rk-onboarding__main", children: [_jsxs("header", { children: [_jsxs("p", { className: "rk-onboarding__eyebrow", children: ["Step ", index + 1, " of ", builtins.length] }), _jsx("h1", { children: active.title }), active.description ? _jsx("p", { className: "rk-onboarding__description", children: active.description }) : null] }), _jsx("div", { className: "rk-onboarding__content", children: body }), error ? _jsx("p", { className: "rk-onboarding__error", role: "alert", children: error }) : null, _jsxs("footer", { children: [_jsx(Button, { variant: "ghost", disabled: saving, onClick: () => { void save({ currentStep: index, skipped: true }).then((ok) => ok ? runCallback(onSkip) : undefined); }, children: "Set up later" }), _jsx("span", {}), _jsx(Button, { variant: "secondary", disabled: index === 0 || saving, onClick: () => void save({ currentStep: index - 1 }), children: "Back" }), _jsx(Button, { variant: "primary", disabled: saving, onClick: () => void markAndMove(index + 1, active.id), children: index === builtins.length - 1 ? "Finish setup" : "Continue" })] })] })] });
|
|
98
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/steps.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LicenseBackend, ModelsBackend, OnboardingStep, PermissionsBackend } from "./types.js";
|
|
2
|
+
export declare function permissionsStep(backend: PermissionsBackend, options?: {
|
|
3
|
+
label?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}): OnboardingStep;
|
|
7
|
+
export declare function modelsStep(backend: ModelsBackend, options?: {
|
|
8
|
+
label?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}): OnboardingStep;
|
|
12
|
+
export declare function licenseStep(backend: LicenseBackend, options?: {
|
|
13
|
+
label?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}): OnboardingStep;
|
package/dist/steps.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { Button, Input, Badge } from "@rightkit/app-shell/react";
|
|
4
|
+
function ProgressBar({ value, label }) {
|
|
5
|
+
const pct = Math.max(0, Math.min(1, value));
|
|
6
|
+
return _jsx("div", { className: "rk-onboarding__progress", role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(pct * 100), children: _jsx("i", { style: { width: `${pct * 100}%` } }) });
|
|
7
|
+
}
|
|
8
|
+
const formatBytes = (n) => {
|
|
9
|
+
if (n === undefined)
|
|
10
|
+
return "";
|
|
11
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
12
|
+
let value = n;
|
|
13
|
+
let unit = 0;
|
|
14
|
+
while (value >= 1000 && unit < units.length - 1) {
|
|
15
|
+
value /= 1000;
|
|
16
|
+
unit += 1;
|
|
17
|
+
}
|
|
18
|
+
return `${value >= 100 || unit === 0 ? Math.round(value) : value.toFixed(1)} ${units[unit]}`;
|
|
19
|
+
};
|
|
20
|
+
const permissionTone = (state) => state === "ready" ? "ok" : state === "denied" || state === "restricted" ? "bad" : state === "needed" ? "warn" : "neutral";
|
|
21
|
+
function PermissionsBody({ backend }) {
|
|
22
|
+
const [items, setItems] = useState([]);
|
|
23
|
+
const [busy, setBusy] = useState(null);
|
|
24
|
+
const [error, setError] = useState(null);
|
|
25
|
+
const reload = useCallback(() => backend.list().then(setItems, (e) => setError(e instanceof Error ? e.message : String(e))), [backend]);
|
|
26
|
+
useEffect(() => void reload(), [reload]);
|
|
27
|
+
return (_jsxs("div", { className: "rk-onboarding__card", "data-testid": "onboarding-permissions", children: [error ? _jsx("p", { className: "rk-onboarding__error", role: "alert", children: error }) : null, items.length === 0 && !error ? _jsx("p", { className: "rk-onboarding__muted", children: "Checking permissions\u2026" }) : null, items.map((item) => (_jsxs("div", { className: "rk-onboarding__row", "data-permission-id": item.id, children: [_jsxs("div", { children: [_jsx("strong", { children: item.label }), _jsx("p", { children: item.description ?? item.detail })] }), _jsxs("div", { className: "rk-onboarding__row-actions", children: [_jsx(Badge, { tone: permissionTone(item.state), children: item.state }), item.state === "needed" || item.state === "denied" ? (_jsx(Button, { size: "sm", variant: "secondary", disabled: busy === item.id, onClick: () => { setBusy(item.id); setError(null); void backend.request(item.id).then((next) => setItems((current) => current.map((x) => x.id === next.id ? next : x)), (e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setBusy(null)); }, children: item.state === "denied" ? "Try again" : "Allow" })) : null] })] }, item.id)))] }));
|
|
28
|
+
}
|
|
29
|
+
export function permissionsStep(backend, options = {}) {
|
|
30
|
+
return { id: "permissions", label: options.label ?? "Permissions", title: options.title ?? "Allow what this app needs", description: options.description ?? "You can change these permissions later in System Settings.", skippable: true, render: () => _jsx(PermissionsBody, { backend: backend }) };
|
|
31
|
+
}
|
|
32
|
+
function ModelsBody({ backend }) {
|
|
33
|
+
const [models, setModels] = useState([]);
|
|
34
|
+
const [busy, setBusy] = useState(null);
|
|
35
|
+
const [error, setError] = useState(null);
|
|
36
|
+
const reload = useCallback(() => backend.list().then(setModels, (e) => setError(e instanceof Error ? e.message : String(e))), [backend]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
void reload();
|
|
39
|
+
if (!backend.subscribe)
|
|
40
|
+
return;
|
|
41
|
+
let off;
|
|
42
|
+
void backend.subscribe((entry) => setModels((current) => current.some((m) => m.id === entry.id) ? current.map((m) => m.id === entry.id ? entry : m) : [...current, entry])).then((unsubscribe) => { off = unsubscribe; });
|
|
43
|
+
return () => off?.();
|
|
44
|
+
}, [backend, reload]);
|
|
45
|
+
const action = (model) => {
|
|
46
|
+
setBusy(model.id);
|
|
47
|
+
setError(null);
|
|
48
|
+
const request = model.state === "downloading" || model.state === "verifying" ? backend.cancel(model.id) : backend.install(model.id);
|
|
49
|
+
void request.then(reload, (e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setBusy(null));
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs("div", { className: "rk-onboarding__card", "data-testid": "onboarding-models", children: [error ? _jsx("p", { className: "rk-onboarding__error", role: "alert", children: error }) : null, models.map((model) => {
|
|
52
|
+
const progress = model.progress ?? (model.state === "installed" ? 1 : 0);
|
|
53
|
+
return _jsxs("div", { className: "rk-onboarding__row", "data-model-id": model.id, children: [_jsxs("div", { className: "rk-onboarding__grow", children: [_jsx("strong", { children: model.label }), _jsxs("p", { children: [model.description ?? "", model.sizeBytes ? ` · ${formatBytes(model.sizeBytes)}` : ""] }), model.state === "downloading" || model.state === "verifying" ? _jsx(ProgressBar, { value: progress, label: `${model.label} download` }) : null] }), _jsxs("div", { className: "rk-onboarding__row-actions", children: [_jsx(Badge, { tone: model.state === "installed" ? "ok" : model.state === "error" ? "bad" : "neutral", children: model.state }), model.state !== "installed" && model.state !== "error" ? _jsx(Button, { size: "sm", variant: "secondary", disabled: busy === model.id, onClick: () => action(model), children: model.state === "downloading" || model.state === "verifying" ? "Pause" : "Download" }) : model.state === "error" ? _jsx(Button, { size: "sm", variant: "secondary", disabled: busy === model.id, onClick: () => action(model), children: "Retry" }) : null] })] }, model.id);
|
|
54
|
+
}), models.length === 0 && !error ? _jsx("p", { className: "rk-onboarding__muted", children: "No models available." }) : null] }));
|
|
55
|
+
}
|
|
56
|
+
export function modelsStep(backend, options = {}) {
|
|
57
|
+
return { id: "models", label: options.label ?? "Models", title: options.title ?? "Choose local models", description: options.description ?? "Downloads are verified before a model is activated.", skippable: true, render: () => _jsx(ModelsBody, { backend: backend }) };
|
|
58
|
+
}
|
|
59
|
+
function LicenseBody({ backend }) {
|
|
60
|
+
const [state, setState] = useState({ status: "none" });
|
|
61
|
+
const [key, setKey] = useState("");
|
|
62
|
+
const [busy, setBusy] = useState(false);
|
|
63
|
+
const [error, setError] = useState(null);
|
|
64
|
+
useEffect(() => void backend.load().then(setState, (e) => setError(e instanceof Error ? e.message : String(e))), [backend]);
|
|
65
|
+
const run = (fn) => { setBusy(true); setError(null); void fn().then(setState, (e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setBusy(false)); };
|
|
66
|
+
return _jsxs("div", { className: "rk-onboarding__card", "data-testid": "onboarding-license", children: [_jsxs("div", { className: "rk-onboarding__license-state", children: [_jsx(Badge, { tone: state.status === "active" || state.status === "trial" ? "ok" : state.status === "expired" || state.status === "invalid" ? "bad" : "neutral", children: state.label ?? state.status }), _jsx("span", { children: state.detail ?? "You can continue without a licence." })] }), error ? _jsx("p", { className: "rk-onboarding__error", role: "alert", children: error }) : null, backend.activate ? _jsxs("form", { className: "rk-onboarding__form", onSubmit: (e) => { e.preventDefault(); if (key.trim())
|
|
67
|
+
run(() => backend.activate(key.trim())); }, children: [_jsx(Input, { "aria-label": "Licence key", placeholder: "Licence key", value: key, onChange: (e) => setKey(e.target.value), disabled: busy }), _jsx(Button, { size: "sm", variant: "primary", type: "submit", disabled: busy || !key.trim(), children: "Activate" })] }) : null, _jsxs("div", { className: "rk-onboarding__row-actions", children: [backend.startTrial ? _jsx(Button, { size: "sm", variant: "secondary", disabled: busy, onClick: () => run(() => backend.startTrial()), children: "Start trial" }) : null, backend.purchaseUrl ? _jsx(Button, { size: "sm", variant: "ghost", onClick: () => void backend.openExternal?.(backend.purchaseUrl), children: "View plans" }) : null] })] });
|
|
68
|
+
}
|
|
69
|
+
export function licenseStep(backend, options = {}) {
|
|
70
|
+
return { id: "license", label: options.label ?? "Licence", title: options.title ?? "Choose how you’ll use this app", description: options.description ?? "Activate a licence, start a trial, or continue with the free plan.", skippable: true, render: () => _jsx(LicenseBody, { backend: backend }) };
|
|
71
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { LegalGateDocument, LegalGateProps, LegalGateTheme } from "@rightkit/legal-ui";
|
|
3
|
+
export type SettingsValues = Record<string, unknown>;
|
|
4
|
+
export interface SettingsSnapshot {
|
|
5
|
+
values: SettingsValues;
|
|
6
|
+
revision: number;
|
|
7
|
+
}
|
|
8
|
+
/** Structural port shared with @rightkit/settings-ui and rightkit-settings. */
|
|
9
|
+
export interface SettingsBackend {
|
|
10
|
+
load(): Promise<SettingsSnapshot>;
|
|
11
|
+
patch(patch: SettingsValues, expectedRevision?: number): Promise<SettingsSnapshot>;
|
|
12
|
+
subscribe?(handler: (keys: string[]) => void): Promise<() => void>;
|
|
13
|
+
}
|
|
14
|
+
export type PermissionState = "ready" | "needed" | "waiting" | "denied" | "restricted";
|
|
15
|
+
export interface PermissionStatus {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
state: PermissionState;
|
|
20
|
+
detail?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PermissionsBackend {
|
|
23
|
+
list(): Promise<PermissionStatus[]>;
|
|
24
|
+
request(id: string): Promise<PermissionStatus>;
|
|
25
|
+
}
|
|
26
|
+
export type ModelState = "missing" | "installed" | "downloading" | "verifying" | "error";
|
|
27
|
+
export interface ModelEntry {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
sizeBytes?: number;
|
|
32
|
+
state: ModelState;
|
|
33
|
+
progress?: number;
|
|
34
|
+
error?: {
|
|
35
|
+
code: string;
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface ModelsBackend {
|
|
40
|
+
list(): Promise<ModelEntry[]>;
|
|
41
|
+
install(id: string): Promise<void>;
|
|
42
|
+
cancel(id: string): Promise<void>;
|
|
43
|
+
subscribe?(handler: (entry: ModelEntry) => void): Promise<() => void>;
|
|
44
|
+
}
|
|
45
|
+
export interface LicenseState {
|
|
46
|
+
status: "none" | "trial" | "active" | "expired" | "invalid";
|
|
47
|
+
label?: string;
|
|
48
|
+
detail?: string;
|
|
49
|
+
tier?: string;
|
|
50
|
+
validUntil?: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface LicenseBackend {
|
|
53
|
+
load(): Promise<LicenseState>;
|
|
54
|
+
activate?(key: string): Promise<LicenseState>;
|
|
55
|
+
startTrial?(): Promise<LicenseState>;
|
|
56
|
+
purchaseUrl?: string;
|
|
57
|
+
openExternal?: (url: string) => void | Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export interface PersistedOnboardingState {
|
|
60
|
+
version: 1;
|
|
61
|
+
currentStep: number;
|
|
62
|
+
completed: string[];
|
|
63
|
+
skipped: boolean;
|
|
64
|
+
legalAccepted: boolean;
|
|
65
|
+
eligibilityBasis?: "individual" | "enterprise";
|
|
66
|
+
}
|
|
67
|
+
export interface OnboardingStepContext {
|
|
68
|
+
state: PersistedOnboardingState;
|
|
69
|
+
settings: SettingsBackend;
|
|
70
|
+
setState: (next: Partial<PersistedOnboardingState>) => Promise<void>;
|
|
71
|
+
permissions?: PermissionsBackend;
|
|
72
|
+
models?: ModelsBackend;
|
|
73
|
+
license?: LicenseBackend;
|
|
74
|
+
}
|
|
75
|
+
export interface OnboardingStep {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
title: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
skippable?: boolean;
|
|
81
|
+
render: (context: OnboardingStepContext) => ReactNode;
|
|
82
|
+
}
|
|
83
|
+
export interface LegalStepConfig extends Omit<LegalGateProps, "variant" | "onAgree" | "onQuit"> {
|
|
84
|
+
onQuit?: () => void;
|
|
85
|
+
}
|
|
86
|
+
export interface OnboardingProps {
|
|
87
|
+
settings: SettingsBackend;
|
|
88
|
+
legal: LegalStepConfig;
|
|
89
|
+
/** App-specific steps are appended after built-in steps, in supplied order. */
|
|
90
|
+
steps?: readonly OnboardingStep[];
|
|
91
|
+
permissions?: PermissionsBackend;
|
|
92
|
+
models?: ModelsBackend;
|
|
93
|
+
license?: LicenseBackend;
|
|
94
|
+
onComplete: () => void | Promise<void>;
|
|
95
|
+
onSkip?: () => void | Promise<void>;
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
export type { LegalGateDocument, LegalGateTheme };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cx: (...parts: Array<string | false | null | undefined>) => string;
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const cx = (...parts) => parts.filter(Boolean).join(" ");
|
package/onboarding.css
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* @rightkit/onboarding — uses app-shell tokens and legal-ui's locked light gate. */
|
|
2
|
+
.rk-onboarding { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--plane, #fffcf5); color: var(--ink, #231f1a); font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
|
|
3
|
+
.rk-onboarding *, .rk-onboarding *::before, .rk-onboarding *::after { box-sizing: border-box; }
|
|
4
|
+
.rk-onboarding__rail { display: flex; flex-direction: column; gap: 22px; padding: 28px 14px; background: var(--chrome, #eee9df); border-right: .5px solid var(--hairline, rgba(35,31,26,.11)); }
|
|
5
|
+
.rk-onboarding__brand { padding: 0 10px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
|
|
6
|
+
.rk-onboarding__rail nav { display: grid; gap: 3px; }
|
|
7
|
+
.rk-onboarding__step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2, #6b655c); font: inherit; text-align: left; cursor: pointer; }
|
|
8
|
+
.rk-onboarding__step span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line-strong, rgba(35,31,26,.18)); border-radius: 50%; font-size: 11px; }
|
|
9
|
+
.rk-onboarding__step:hover { background: var(--fill, rgba(35,31,26,.05)); color: var(--ink); }
|
|
10
|
+
.rk-onboarding__step.is-active { background: var(--sel, rgba(35,31,26,.06)); color: var(--ink); font-weight: 600; }
|
|
11
|
+
.rk-onboarding__step.is-done span { border-color: var(--ok, #1e7f3c); color: var(--ok, #1e7f3c); }
|
|
12
|
+
.rk-onboarding__main { display: flex; flex-direction: column; min-width: 0; max-width: 840px; width: 100%; padding: 64px clamp(24px, 7vw, 88px) 32px; }
|
|
13
|
+
.rk-onboarding__main header { max-width: 620px; }
|
|
14
|
+
.rk-onboarding__eyebrow { margin: 0 0 8px; color: var(--accent, #7040c4); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
|
|
15
|
+
.rk-onboarding__main h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.1; letter-spacing: -.025em; }
|
|
16
|
+
.rk-onboarding__description { margin: 10px 0 0; color: var(--ink-2, #6b655c); font-size: 15px; max-width: 58ch; }
|
|
17
|
+
.rk-onboarding__content { flex: 1; padding: 30px 0; }
|
|
18
|
+
.rk-onboarding__card { display: grid; gap: 2px; max-width: 680px; padding: 6px 0; }
|
|
19
|
+
.rk-onboarding__card > p { color: var(--ink-2, #6b655c); }
|
|
20
|
+
.rk-onboarding__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: .5px solid var(--hairline, rgba(35,31,26,.11)); }
|
|
21
|
+
.rk-onboarding__row:last-child { border-bottom: 0; }
|
|
22
|
+
.rk-onboarding__row p { margin: 3px 0 0; color: var(--ink-2, #6b655c); font-size: 12.5px; }
|
|
23
|
+
.rk-onboarding__row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: none; }
|
|
24
|
+
.rk-onboarding__grow { min-width: 0; flex: 1; }
|
|
25
|
+
.rk-onboarding__muted { color: var(--ink-2, #6b655c); }
|
|
26
|
+
.rk-onboarding__error { color: var(--bad, #c4001a); }
|
|
27
|
+
.rk-onboarding__state { color: var(--ink-2, #6b655c); text-transform: capitalize; }
|
|
28
|
+
.rk-onboarding__progress { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--fill-3, rgba(35,31,26,.13)); overflow: hidden; }
|
|
29
|
+
.rk-onboarding__progress i { display: block; height: 100%; background: var(--accent, #7040c4); }
|
|
30
|
+
.rk-onboarding__license-state { display: flex; align-items: center; gap: 10px; margin: 8px 0 18px; }
|
|
31
|
+
.rk-onboarding__license-state small { color: var(--ink-2, #6b655c); }
|
|
32
|
+
.rk-onboarding__form { display: flex; gap: 8px; margin-bottom: 14px; }
|
|
33
|
+
.rk-onboarding__form .rk-input { flex: 1; }
|
|
34
|
+
.rk-onboarding footer { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: .5px solid var(--hairline, rgba(35,31,26,.11)); }
|
|
35
|
+
.rk-onboarding footer span { flex: 1; }
|
|
36
|
+
.rk-onboarding--legal { display: block; }
|
|
37
|
+
@media (max-width: 640px) { .rk-onboarding { grid-template-columns: 1fr; } .rk-onboarding__rail { padding: 18px 12px; border-right: 0; border-bottom: .5px solid var(--hairline, rgba(35,31,26,.11)); } .rk-onboarding__rail nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rk-onboarding__main { padding: 34px 20px 24px; } .rk-onboarding__row { align-items: flex-start; flex-direction: column; gap: 10px; } .rk-onboarding__row-actions { justify-content: flex-start; } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rightkit/onboarding",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "First-run onboarding framework: ordered steps, progress, skip/resume, legal gate first, permissions, model download and licence/trial steps.",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./onboarding.css": "./onboarding.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"onboarding.css",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE-MIT",
|
|
21
|
+
"LICENSE-APACHE"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"*.css"
|
|
25
|
+
],
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@rightkit/app-shell": ">=0.1.0 <1",
|
|
28
|
+
"@rightkit/legal-ui": ">=0.1.0",
|
|
29
|
+
"react": ">=18 <20"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rightkit/app-shell": "0.1.0",
|
|
33
|
+
"@rightkit/legal-ui": "0.1.1",
|
|
34
|
+
"@types/react": "^19.0.0",
|
|
35
|
+
"@types/react-dom": "^19.0.0",
|
|
36
|
+
"react": "^19.0.0",
|
|
37
|
+
"react-dom": "^19.0.0",
|
|
38
|
+
"typescript": "^5.7.0",
|
|
39
|
+
"vite": "^6.0.0",
|
|
40
|
+
"vitest": "^2.1.8"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"registry": "https://registry.npmjs.org",
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/bogusyogi/claude.git",
|
|
49
|
+
"directory": "tools/rightkit/packages/onboarding"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -p tsconfig.json",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
54
|
+
"pretest": "pnpm --filter \"@rightkit/onboarding^...\" run build",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
}
|
|
6
57
|
}
|