kaafil-react-uikit 0.1.0-beta.1
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 +70 -0
- package/LICENSE +21 -0
- package/README.md +187 -0
- package/dist/OfflineFallbackScreen-B5dfaJBN.d.ts +37 -0
- package/dist/OfflineFallbackScreen-Ctm7nBa-.d.cts +37 -0
- package/dist/SessionExpiredScreen-CytQNuak.d.cts +50 -0
- package/dist/SessionExpiredScreen-D8GHyZc3.d.ts +50 -0
- package/dist/admin/index.cjs +23779 -0
- package/dist/admin/index.cjs.map +1 -0
- package/dist/admin/index.d.cts +1157 -0
- package/dist/admin/index.d.ts +1157 -0
- package/dist/admin/index.js +23724 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/chunk-6FPAGGFL.js +6028 -0
- package/dist/chunk-6FPAGGFL.js.map +1 -0
- package/dist/chunk-ACVU55PZ.cjs +294 -0
- package/dist/chunk-ACVU55PZ.cjs.map +1 -0
- package/dist/chunk-EM7JV3D7.cjs +6051 -0
- package/dist/chunk-EM7JV3D7.cjs.map +1 -0
- package/dist/chunk-IIPQ4JNC.js +287 -0
- package/dist/chunk-IIPQ4JNC.js.map +1 -0
- package/dist/chunk-LL243STJ.cjs +2195 -0
- package/dist/chunk-LL243STJ.cjs.map +1 -0
- package/dist/chunk-PJRZCOFF.cjs +958 -0
- package/dist/chunk-PJRZCOFF.cjs.map +1 -0
- package/dist/chunk-PTQ2CJKE.cjs +40 -0
- package/dist/chunk-PTQ2CJKE.cjs.map +1 -0
- package/dist/chunk-PZKXLQSU.js +10 -0
- package/dist/chunk-PZKXLQSU.js.map +1 -0
- package/dist/chunk-QHUDOVKW.cjs +111 -0
- package/dist/chunk-QHUDOVKW.cjs.map +1 -0
- package/dist/chunk-TOBZFADB.cjs +12 -0
- package/dist/chunk-TOBZFADB.cjs.map +1 -0
- package/dist/chunk-UUGMNP27.js +936 -0
- package/dist/chunk-UUGMNP27.js.map +1 -0
- package/dist/chunk-UYJ6LIWP.js +2154 -0
- package/dist/chunk-UYJ6LIWP.js.map +1 -0
- package/dist/chunk-VHTSTUCJ.cjs +346 -0
- package/dist/chunk-VHTSTUCJ.cjs.map +1 -0
- package/dist/chunk-WUAFL77X.js +340 -0
- package/dist/chunk-WUAFL77X.js.map +1 -0
- package/dist/chunk-XI7MK4Y7.js +38 -0
- package/dist/chunk-XI7MK4Y7.js.map +1 -0
- package/dist/chunk-YDGR7JSY.js +107 -0
- package/dist/chunk-YDGR7JSY.js.map +1 -0
- package/dist/core/index.cjs +1254 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1267 -0
- package/dist/core/index.d.ts +1267 -0
- package/dist/core/index.js +995 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/manager/index.cjs +13562 -0
- package/dist/manager/index.cjs.map +1 -0
- package/dist/manager/index.d.cts +1054 -0
- package/dist/manager/index.d.ts +1054 -0
- package/dist/manager/index.js +13518 -0
- package/dist/manager/index.js.map +1 -0
- package/dist/testing/index.cjs +221 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +269 -0
- package/dist/testing/index.d.ts +269 -0
- package/dist/testing/index.js +208 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tokenStyle-CToG5oOS.d.cts +3 -0
- package/dist/tokenStyle-CToG5oOS.d.ts +3 -0
- package/dist/traveller/index.cjs +1799 -0
- package/dist/traveller/index.cjs.map +1 -0
- package/dist/traveller/index.d.cts +58 -0
- package/dist/traveller/index.d.ts +58 -0
- package/dist/traveller/index.js +1789 -0
- package/dist/traveller/index.js.map +1 -0
- package/dist/useAgencyTrip-BUYSIaC2.d.cts +454 -0
- package/dist/useAgencyTrip-BzyJB1D9.d.ts +454 -0
- package/dist/useNotifications-BZW1Z_ur.d.cts +356 -0
- package/dist/useNotifications-D262i5BQ.d.ts +356 -0
- package/dist/useVendors-DXOuZWhZ.d.cts +784 -0
- package/dist/useVendors-DXOuZWhZ.d.ts +784 -0
- package/package.json +95 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `kaafil-react-uikit`.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this package uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
While on `0.x` a minor bump may carry a breaking change; the entry will say so.
|
|
8
|
+
|
|
9
|
+
## [0.1.0-beta.1] — 2026-09-10
|
|
10
|
+
|
|
11
|
+
First published release. Beta: stable enough to build against, not yet
|
|
12
|
+
frozen. Pin an exact version.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Six subpath exports** — `/core`, `/manager`, `/admin`, `/traveller`,
|
|
17
|
+
`/styles`, `/testing`. No bare `.` export.
|
|
18
|
+
- **`/core`** — `KaafilUIKitProvider`, nine shells, 53 hooks, the error
|
|
19
|
+
classifier, a type-keyed registry factory, and an opt-in deep-link module
|
|
20
|
+
(param names, the closing-day blocker table, and pure query-string
|
|
21
|
+
serializers). The only place in the package that imports `kaafil-js`.
|
|
22
|
+
- **`/manager`** — the field family. `KaafilManagerApp`, `ManagerShell`,
|
|
23
|
+
`ManagerFab`, and 20 composites covering Now, the trip tab set, manifest,
|
|
24
|
+
roster, itinerary, pickups, rooming, vehicles, vendors, checklists, forms,
|
|
25
|
+
money, float, close-out, documents, traveller profile, notifications, the
|
|
26
|
+
sync centre and the manager's own profile.
|
|
27
|
+
- **`/admin`** — the desk family. `KaafilAgencyWorkspace`, `AdminShell`, and
|
|
28
|
+
27 composites and flows: the trip workspace and its fifteen panels, plus
|
|
29
|
+
the agency-wide traveller and manager directories, the checklist-template
|
|
30
|
+
and form authoring libraries, journey triggers and agency settings.
|
|
31
|
+
- **`/traveller`** — `KaafilShareView`, one surface driven entirely by the
|
|
32
|
+
share snapshot's own returned sections.
|
|
33
|
+
- **Six system screens** — session expired, not found, locked trip, plan
|
|
34
|
+
locked, offline fallback and boot error. Authored once and re-exported per
|
|
35
|
+
family, each family taking only the screens that make sense for it.
|
|
36
|
+
- **`/styles`** — the compiled token ladder. Opt-in; never auto-injected.
|
|
37
|
+
Everything lands in `@layer kaafil-ui`, with `@layer kaafil-ui-overrides`
|
|
38
|
+
reserved for the host.
|
|
39
|
+
- **`/testing`** — plain-data fixture builders for sessions, capability
|
|
40
|
+
states, sync events and a fake offline engine. Zero test-framework
|
|
41
|
+
dependency.
|
|
42
|
+
- **Per-instance theming** — every exported component accepts a `style` prop
|
|
43
|
+
typed to carry only `--kf-*` custom properties.
|
|
44
|
+
- **English and Hindi** chrome catalogs, shipped in the bundle.
|
|
45
|
+
- **Storybook documentation** — twelve pages, from getting started through
|
|
46
|
+
the hook catalog, offline and sync, deep links and a component index.
|
|
47
|
+
|
|
48
|
+
### Requires
|
|
49
|
+
|
|
50
|
+
- `kaafil-js@^0.1.0-beta.7`. Earlier betas lack the `trip_document` file
|
|
51
|
+
purpose and the `agencyAdmin` grants the desk family reads through, so the
|
|
52
|
+
Bookings, Forms, Documents and Payments panels fail against them before a
|
|
53
|
+
request is even built.
|
|
54
|
+
- `react` and `react-dom` `>=18.2.0 <20.0.0`.
|
|
55
|
+
|
|
56
|
+
### Known gaps
|
|
57
|
+
|
|
58
|
+
Named here so they are not mistaken for defects. Each has a reason:
|
|
59
|
+
|
|
60
|
+
- **No trek board.** `useTreks()` is built and the routes are open; the UI
|
|
61
|
+
is not. The `treks` tab is dropped from the rail rather than shown empty.
|
|
62
|
+
- **No feedback/NPS panel.** `useFeedbackNps()` is built; the panel is not.
|
|
63
|
+
- **No form answer-distribution dashboard.** Its backing read is
|
|
64
|
+
`apiKey`-only, so no browser session can reach it.
|
|
65
|
+
- **No vendor rating.** The entitlement flag exists; the engine has no
|
|
66
|
+
rating model behind it.
|
|
67
|
+
- **`AdminShell` collapses to an icon rail**, not a drawer, below `60rem` of
|
|
68
|
+
its own container.
|
|
69
|
+
|
|
70
|
+
[0.1.0-beta.1]: https://github.com/kaafil/kaafil-react-uikit/releases/tag/v0.1.0-beta.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kaafil
|
|
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
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# kaafil-react-uikit
|
|
2
|
+
|
|
3
|
+
React components for the Kaafil v2 engine, built on the headless
|
|
4
|
+
[`kaafil-js`](https://www.npmjs.com/package/kaafil-js) SDK — designed to be
|
|
5
|
+
dropped into a partner CRM **under that CRM's own brand**.
|
|
6
|
+
|
|
7
|
+
Three persona families ship as one package: **manager** (field, on a phone,
|
|
8
|
+
offline-assumed), **admin** (desk, embedded in your own page), and
|
|
9
|
+
**traveller** (a public share link). Behind all three sits one hook layer,
|
|
10
|
+
so capability gating, offline writes, idempotency, delta sync, conflict
|
|
11
|
+
handling and money/date correctness are implemented exactly once and
|
|
12
|
+
inherited by everything you mount — including your own components.
|
|
13
|
+
|
|
14
|
+
> **Beta.** The API is stable enough to build against and not yet frozen.
|
|
15
|
+
> Pin an exact version.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install kaafil-react-uikit@beta kaafil-js@beta
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`react`, `react-dom` and `kaafil-js` are peer dependencies:
|
|
24
|
+
|
|
25
|
+
| Peer | Range |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `react` / `react-dom` | `>=18.2.0 <20.0.0` |
|
|
28
|
+
| `kaafil-js` | `^0.1.0-beta.7` |
|
|
29
|
+
|
|
30
|
+
## Quick start
|
|
31
|
+
|
|
32
|
+
Mint your tokens however your own backend already authenticates a user —
|
|
33
|
+
your API key never reaches the browser — then hand them to the provider as
|
|
34
|
+
**values**. There is no endpoint for the UIKit to call.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { KaafilUIKitProvider } from 'kaafil-react-uikit/core';
|
|
38
|
+
import { KaafilAgencyWorkspace } from 'kaafil-react-uikit/admin';
|
|
39
|
+
import 'kaafil-react-uikit/styles';
|
|
40
|
+
|
|
41
|
+
export function DeskApp() {
|
|
42
|
+
return (
|
|
43
|
+
<KaafilUIKitProvider
|
|
44
|
+
accessToken={accessToken}
|
|
45
|
+
refreshToken={refreshToken}
|
|
46
|
+
agencyRef={agencyRef}
|
|
47
|
+
onSessionExpired={(kind) => redirectToLogin(kind)}
|
|
48
|
+
>
|
|
49
|
+
<KaafilAgencyWorkspace />
|
|
50
|
+
</KaafilUIKitProvider>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The field surface additionally needs a storage adapter, so the outbox
|
|
56
|
+
survives a reload:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { createIndexedDbStorageAdapter } from 'kaafil-js/client';
|
|
60
|
+
import { KaafilManagerApp } from 'kaafil-react-uikit/manager';
|
|
61
|
+
|
|
62
|
+
<KaafilUIKitProvider
|
|
63
|
+
accessToken={accessToken}
|
|
64
|
+
refreshToken={refreshToken}
|
|
65
|
+
agencyRef={agencyRef}
|
|
66
|
+
storage={createIndexedDbStorageAdapter()}
|
|
67
|
+
onSessionExpired={(kind) => redirectToLogin(kind)}
|
|
68
|
+
>
|
|
69
|
+
<KaafilManagerApp
|
|
70
|
+
onNavigateModule={(key) => router.push(`/trip/${key}`)}
|
|
71
|
+
onLogExpense={() => router.push('/expenses/new')}
|
|
72
|
+
onCollectPayment={() => router.push('/collections/new')}
|
|
73
|
+
onCollectFromGroup={(id) => router.push(`/collections/new?group=${id}`)}
|
|
74
|
+
onVendorSelect={(id) => router.push(`/vendors/${id}`)}
|
|
75
|
+
/>
|
|
76
|
+
</KaafilUIKitProvider>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Passing `shareToken` instead of the token trio opens a traveller session —
|
|
80
|
+
the provider derives the persona from the shape you pass, at the type
|
|
81
|
+
level, so passing both is a compile error rather than a runtime ambiguity.
|
|
82
|
+
|
|
83
|
+
## Subpath exports
|
|
84
|
+
|
|
85
|
+
There is no bare `.` export. Import the one family your product needs, plus
|
|
86
|
+
`/core`, and opt in to `/styles` once.
|
|
87
|
+
|
|
88
|
+
| Subpath | Contains |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `kaafil-react-uikit/core` | Hooks, the provider, the shells, the error classifier, the deep-link helpers. The only place in the package that imports `kaafil-js`. |
|
|
91
|
+
| `kaafil-react-uikit/manager` | The field family — 20 composites plus `KaafilManagerApp`, `ManagerShell`, `ManagerFab`. |
|
|
92
|
+
| `kaafil-react-uikit/admin` | The desk family — 27 composites and flows plus `KaafilAgencyWorkspace` and `AdminShell`. |
|
|
93
|
+
| `kaafil-react-uikit/traveller` | The public family — `KaafilShareView`. |
|
|
94
|
+
| `kaafil-react-uikit/styles` | The compiled CSS. **Opt-in**; never auto-injected. |
|
|
95
|
+
| `kaafil-react-uikit/testing` | Plain-data fixture builders. Zero test-framework dependency. |
|
|
96
|
+
|
|
97
|
+
## Two things to know before you start
|
|
98
|
+
|
|
99
|
+
**The stylesheet is opt-in.** `import 'kaafil-react-uikit/styles'` once,
|
|
100
|
+
where you want it in your cascade. Nothing is injected on your behalf,
|
|
101
|
+
because you own the `@layer` order — everything we ship lives in
|
|
102
|
+
`@layer kaafil-ui`, and your overrides belong in `@layer kaafil-ui-overrides`.
|
|
103
|
+
|
|
104
|
+
**Sections can be legitimately absent.** Not every agency has every module,
|
|
105
|
+
and some modules cannot exist for some trip shapes. Components gate on that
|
|
106
|
+
before rendering rather than throwing, and the three reasons get three
|
|
107
|
+
different treatments — a section that can never apply renders nothing, one
|
|
108
|
+
missing its data says which ingest to connect, one outside the plan says so.
|
|
109
|
+
Don't collapse them into a generic "unavailable".
|
|
110
|
+
|
|
111
|
+
## Customising
|
|
112
|
+
|
|
113
|
+
Seven tiers, shallow to deep in *mechanism*. Most integrations never leave
|
|
114
|
+
the first three.
|
|
115
|
+
|
|
116
|
+
| Tier | You get |
|
|
117
|
+
|---|---|
|
|
118
|
+
| 0 | Mount a whole persona's product in one component. |
|
|
119
|
+
| 1–2 | Behaviour props and `on*` callbacks. Navigation is always a callback — the UIKit ships no router. |
|
|
120
|
+
| 3 | Inject the SDK's own filter/sort params. No parallel filter language. |
|
|
121
|
+
| 4 | `components={{ Name: YourComponent }}` — replace a named part, keep every guarantee. |
|
|
122
|
+
| 5 | Mount the feature composites yourself, in your own layout. |
|
|
123
|
+
| 6 | `/core` hooks — own every pixel, keep the outbox. |
|
|
124
|
+
|
|
125
|
+
CSS is not a rung; it is an independent axis at every tier. Class names
|
|
126
|
+
(`.kf-*`) and custom properties (`--kf-*`) are a **published API**:
|
|
127
|
+
unhashed, BEM, and stable. Twelve semantic tokens are enough for a full
|
|
128
|
+
reskin.
|
|
129
|
+
|
|
130
|
+
```css
|
|
131
|
+
:root {
|
|
132
|
+
--kf-accent: var(--brand-accent);
|
|
133
|
+
--kf-surface-base: var(--brand-surface);
|
|
134
|
+
--kf-text-primary: var(--brand-ink);
|
|
135
|
+
/* …nine more */
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Per-instance overrides go through a typed `style` prop that accepts only
|
|
140
|
+
`--kf-*` keys, so a stray `color: red` is a compile error.
|
|
141
|
+
|
|
142
|
+
## Building your own UI
|
|
143
|
+
|
|
144
|
+
Every hook is exported. They return data, mutations and state — never JSX —
|
|
145
|
+
and everything the components rely on comes with them.
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import { useRooming } from 'kaafil-react-uikit/core';
|
|
149
|
+
|
|
150
|
+
function MyBoard({ tripRef }) {
|
|
151
|
+
const rooming = useRooming(tripRef);
|
|
152
|
+
|
|
153
|
+
if (rooming.status === 'loading') return <MySpinner />;
|
|
154
|
+
if (rooming.status === 'dark') return <MyLocked reason={rooming.reason} />;
|
|
155
|
+
if (rooming.status === 'error') return <MyError error={rooming.error} />;
|
|
156
|
+
|
|
157
|
+
// `ready` means the hook finished — not that the read succeeded.
|
|
158
|
+
if (rooming.syncedAt === undefined) return <MyCouldNotLoad />;
|
|
159
|
+
|
|
160
|
+
return <MyBedGrid rooms={rooming.rooms} onAssign={rooming.assign} />;
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
That `syncedAt` check is the one thing worth memorising: a failed live read
|
|
165
|
+
still resolves `ready` with an empty array, so `syncedAt === undefined` is
|
|
166
|
+
what separates "there is nothing here" from "we could not read it".
|
|
167
|
+
|
|
168
|
+
## Documentation
|
|
169
|
+
|
|
170
|
+
Full docs ship as Storybook — twelve pages covering tokens, the
|
|
171
|
+
customization ladder, the layer model, capability behaviour, per-instance
|
|
172
|
+
theming, the hook catalog, offline and sync, deep links, system screens,
|
|
173
|
+
i18n and RTL, and an index of every component with the states it renders.
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
git clone https://github.com/kaafil/kaafil-react-uikit
|
|
177
|
+
cd kaafil-react-uikit && pnpm install && pnpm storybook
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Requirements
|
|
181
|
+
|
|
182
|
+
Node `>=20.11` for the toolchain. The package itself ships ESM and CJS
|
|
183
|
+
builds with type declarations for both, targeting ES2022.
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT © Kaafil
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { K as KaafilTokenOverrides } from './tokenStyle-CToG5oOS.js';
|
|
3
|
+
|
|
4
|
+
/** The same failure modes `<KaafilSessionProbe/>` distinguishes, plus the
|
|
5
|
+
* honest sixth for anything unclassifiable. */
|
|
6
|
+
type BootFailureMode = 'endpoint-401' | 'wrong-environment' | 'test-key-on-live' | 'clock-skew' | 'cors' | 'unknown';
|
|
7
|
+
interface BootErrorScreenProps {
|
|
8
|
+
readonly failureMode?: BootFailureMode;
|
|
9
|
+
/** The underlying error's message. Rendered behind a disclosure, never
|
|
10
|
+
* inline in the primary copy — it is developer-facing. */
|
|
11
|
+
readonly detail?: string;
|
|
12
|
+
/** Remounts the entire provider tree; some boot failures (a `kf_test_`
|
|
13
|
+
* key shipped to production) cannot be fixed by retrying at all, which
|
|
14
|
+
* is why this is optional. */
|
|
15
|
+
readonly onRetry?: () => void;
|
|
16
|
+
readonly components?: {
|
|
17
|
+
readonly BootErrorScreenUI?: () => ReactNode;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare function BootErrorScreen({ failureMode, detail, onRetry, components, }: BootErrorScreenProps): ReactNode;
|
|
21
|
+
|
|
22
|
+
interface OfflineFallbackScreenProps {
|
|
23
|
+
/** Present on a trip-scoped mount; absent on the share surface. Context
|
|
24
|
+
* only — this screen fetches nothing. */
|
|
25
|
+
readonly tripRef?: string;
|
|
26
|
+
/** Present on a share mount instead of `tripRef`. */
|
|
27
|
+
readonly token?: string;
|
|
28
|
+
/** The host's own retry — typically remounting whatever failed. */
|
|
29
|
+
readonly onRetry?: () => void;
|
|
30
|
+
readonly components?: {
|
|
31
|
+
readonly OfflineFallbackScreenUI?: () => ReactNode;
|
|
32
|
+
};
|
|
33
|
+
readonly style?: KaafilTokenOverrides;
|
|
34
|
+
}
|
|
35
|
+
declare function OfflineFallbackScreen({ onRetry, components, style, }: OfflineFallbackScreenProps): ReactNode;
|
|
36
|
+
|
|
37
|
+
export { BootErrorScreen as B, OfflineFallbackScreen as O, type BootErrorScreenProps as a, type BootFailureMode as b, type OfflineFallbackScreenProps as c };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { K as KaafilTokenOverrides } from './tokenStyle-CToG5oOS.cjs';
|
|
3
|
+
|
|
4
|
+
/** The same failure modes `<KaafilSessionProbe/>` distinguishes, plus the
|
|
5
|
+
* honest sixth for anything unclassifiable. */
|
|
6
|
+
type BootFailureMode = 'endpoint-401' | 'wrong-environment' | 'test-key-on-live' | 'clock-skew' | 'cors' | 'unknown';
|
|
7
|
+
interface BootErrorScreenProps {
|
|
8
|
+
readonly failureMode?: BootFailureMode;
|
|
9
|
+
/** The underlying error's message. Rendered behind a disclosure, never
|
|
10
|
+
* inline in the primary copy — it is developer-facing. */
|
|
11
|
+
readonly detail?: string;
|
|
12
|
+
/** Remounts the entire provider tree; some boot failures (a `kf_test_`
|
|
13
|
+
* key shipped to production) cannot be fixed by retrying at all, which
|
|
14
|
+
* is why this is optional. */
|
|
15
|
+
readonly onRetry?: () => void;
|
|
16
|
+
readonly components?: {
|
|
17
|
+
readonly BootErrorScreenUI?: () => ReactNode;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare function BootErrorScreen({ failureMode, detail, onRetry, components, }: BootErrorScreenProps): ReactNode;
|
|
21
|
+
|
|
22
|
+
interface OfflineFallbackScreenProps {
|
|
23
|
+
/** Present on a trip-scoped mount; absent on the share surface. Context
|
|
24
|
+
* only — this screen fetches nothing. */
|
|
25
|
+
readonly tripRef?: string;
|
|
26
|
+
/** Present on a share mount instead of `tripRef`. */
|
|
27
|
+
readonly token?: string;
|
|
28
|
+
/** The host's own retry — typically remounting whatever failed. */
|
|
29
|
+
readonly onRetry?: () => void;
|
|
30
|
+
readonly components?: {
|
|
31
|
+
readonly OfflineFallbackScreenUI?: () => ReactNode;
|
|
32
|
+
};
|
|
33
|
+
readonly style?: KaafilTokenOverrides;
|
|
34
|
+
}
|
|
35
|
+
declare function OfflineFallbackScreen({ onRetry, components, style, }: OfflineFallbackScreenProps): ReactNode;
|
|
36
|
+
|
|
37
|
+
export { BootErrorScreen as B, OfflineFallbackScreen as O, type BootErrorScreenProps as a, type BootFailureMode as b, type OfflineFallbackScreenProps as c };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { K as KaafilTokenOverrides } from './tokenStyle-CToG5oOS.cjs';
|
|
3
|
+
|
|
4
|
+
interface LockedTripScreenProps {
|
|
5
|
+
/** For context and for building the link's destination — never used to
|
|
6
|
+
* fetch anything. */
|
|
7
|
+
readonly tripRef: string;
|
|
8
|
+
/** What the dead-end link would have done ("Record a collection"), from
|
|
9
|
+
* whatever metadata came with it. Absent means the generic sentence: this
|
|
10
|
+
* screen invents no explanation of its own. */
|
|
11
|
+
readonly intendedAction?: string;
|
|
12
|
+
/** The host's own navigation to wherever it mounts Closing Day. A screen
|
|
13
|
+
* never navigates itself. */
|
|
14
|
+
readonly onGoToClosingDay: (tripRef: string) => void;
|
|
15
|
+
readonly components?: {
|
|
16
|
+
readonly LockedTripScreenUI?: () => ReactNode;
|
|
17
|
+
};
|
|
18
|
+
readonly style?: KaafilTokenOverrides;
|
|
19
|
+
}
|
|
20
|
+
declare function LockedTripScreen({ tripRef, intendedAction, onGoToClosingDay, components, style, }: LockedTripScreenProps): ReactNode;
|
|
21
|
+
|
|
22
|
+
interface NotFoundScreenProps {
|
|
23
|
+
/** The host's own "back" navigation. Optional — a host that reached this
|
|
24
|
+
* with no history to return to simply gets no button, which is more
|
|
25
|
+
* honest than one that goes nowhere. */
|
|
26
|
+
readonly onGoBack?: () => void;
|
|
27
|
+
readonly components?: {
|
|
28
|
+
readonly NotFoundScreenUI?: () => ReactNode;
|
|
29
|
+
};
|
|
30
|
+
readonly style?: KaafilTokenOverrides;
|
|
31
|
+
}
|
|
32
|
+
declare function NotFoundScreen({ onGoBack, components, style }: NotFoundScreenProps): ReactNode;
|
|
33
|
+
|
|
34
|
+
interface SessionExpiredScreenProps {
|
|
35
|
+
/** The host's own re-auth entry point. Required: there is no default
|
|
36
|
+
* action, because Kaafil has no login page of its own. */
|
|
37
|
+
readonly onReauthenticate: (returnTo?: string) => void | Promise<void>;
|
|
38
|
+
/** Threaded back to `onReauthenticate` UNEXAMINED. This screen never
|
|
39
|
+
* interprets it, builds a URL from it, or hands it to a router — it
|
|
40
|
+
* exists purely so the host's own flow can restore the right destination
|
|
41
|
+
* afterwards. */
|
|
42
|
+
readonly returnTo?: string;
|
|
43
|
+
readonly components?: {
|
|
44
|
+
readonly SessionExpiredScreenUI?: () => ReactNode;
|
|
45
|
+
};
|
|
46
|
+
readonly style?: KaafilTokenOverrides;
|
|
47
|
+
}
|
|
48
|
+
declare function SessionExpiredScreen({ onReauthenticate, returnTo, components, style, }: SessionExpiredScreenProps): ReactNode;
|
|
49
|
+
|
|
50
|
+
export { LockedTripScreen as L, NotFoundScreen as N, SessionExpiredScreen as S, type LockedTripScreenProps as a, type NotFoundScreenProps as b, type SessionExpiredScreenProps as c };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { K as KaafilTokenOverrides } from './tokenStyle-CToG5oOS.js';
|
|
3
|
+
|
|
4
|
+
interface LockedTripScreenProps {
|
|
5
|
+
/** For context and for building the link's destination — never used to
|
|
6
|
+
* fetch anything. */
|
|
7
|
+
readonly tripRef: string;
|
|
8
|
+
/** What the dead-end link would have done ("Record a collection"), from
|
|
9
|
+
* whatever metadata came with it. Absent means the generic sentence: this
|
|
10
|
+
* screen invents no explanation of its own. */
|
|
11
|
+
readonly intendedAction?: string;
|
|
12
|
+
/** The host's own navigation to wherever it mounts Closing Day. A screen
|
|
13
|
+
* never navigates itself. */
|
|
14
|
+
readonly onGoToClosingDay: (tripRef: string) => void;
|
|
15
|
+
readonly components?: {
|
|
16
|
+
readonly LockedTripScreenUI?: () => ReactNode;
|
|
17
|
+
};
|
|
18
|
+
readonly style?: KaafilTokenOverrides;
|
|
19
|
+
}
|
|
20
|
+
declare function LockedTripScreen({ tripRef, intendedAction, onGoToClosingDay, components, style, }: LockedTripScreenProps): ReactNode;
|
|
21
|
+
|
|
22
|
+
interface NotFoundScreenProps {
|
|
23
|
+
/** The host's own "back" navigation. Optional — a host that reached this
|
|
24
|
+
* with no history to return to simply gets no button, which is more
|
|
25
|
+
* honest than one that goes nowhere. */
|
|
26
|
+
readonly onGoBack?: () => void;
|
|
27
|
+
readonly components?: {
|
|
28
|
+
readonly NotFoundScreenUI?: () => ReactNode;
|
|
29
|
+
};
|
|
30
|
+
readonly style?: KaafilTokenOverrides;
|
|
31
|
+
}
|
|
32
|
+
declare function NotFoundScreen({ onGoBack, components, style }: NotFoundScreenProps): ReactNode;
|
|
33
|
+
|
|
34
|
+
interface SessionExpiredScreenProps {
|
|
35
|
+
/** The host's own re-auth entry point. Required: there is no default
|
|
36
|
+
* action, because Kaafil has no login page of its own. */
|
|
37
|
+
readonly onReauthenticate: (returnTo?: string) => void | Promise<void>;
|
|
38
|
+
/** Threaded back to `onReauthenticate` UNEXAMINED. This screen never
|
|
39
|
+
* interprets it, builds a URL from it, or hands it to a router — it
|
|
40
|
+
* exists purely so the host's own flow can restore the right destination
|
|
41
|
+
* afterwards. */
|
|
42
|
+
readonly returnTo?: string;
|
|
43
|
+
readonly components?: {
|
|
44
|
+
readonly SessionExpiredScreenUI?: () => ReactNode;
|
|
45
|
+
};
|
|
46
|
+
readonly style?: KaafilTokenOverrides;
|
|
47
|
+
}
|
|
48
|
+
declare function SessionExpiredScreen({ onReauthenticate, returnTo, components, style, }: SessionExpiredScreenProps): ReactNode;
|
|
49
|
+
|
|
50
|
+
export { LockedTripScreen as L, NotFoundScreen as N, SessionExpiredScreen as S, type LockedTripScreenProps as a, type NotFoundScreenProps as b, type SessionExpiredScreenProps as c };
|