kaafil-react-uikit 0.7.0 → 0.8.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/CHANGELOG.md +34 -0
- package/dist/admin/index.cjs +468 -446
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.js +128 -106
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-53ITV6GF.cjs → chunk-4R7QBTNL.cjs} +4 -4
- package/dist/{chunk-53ITV6GF.cjs.map → chunk-4R7QBTNL.cjs.map} +1 -1
- package/dist/{chunk-HNENKHHJ.js → chunk-57DYMIWS.js} +5 -5
- package/dist/{chunk-HNENKHHJ.js.map → chunk-57DYMIWS.js.map} +1 -1
- package/dist/{chunk-XPF737RG.cjs → chunk-7COMKJTM.cjs} +9 -9
- package/dist/{chunk-XPF737RG.cjs.map → chunk-7COMKJTM.cjs.map} +1 -1
- package/dist/{chunk-OOHU3ECL.cjs → chunk-7O3TPYK4.cjs} +17 -17
- package/dist/{chunk-OOHU3ECL.cjs.map → chunk-7O3TPYK4.cjs.map} +1 -1
- package/dist/{chunk-4QMYUKW4.cjs → chunk-ASFUY3IE.cjs} +5368 -5358
- package/dist/chunk-ASFUY3IE.cjs.map +1 -0
- package/dist/{chunk-CJMUPBZ7.js → chunk-DYOAKTGJ.js} +5 -5
- package/dist/{chunk-CJMUPBZ7.js.map → chunk-DYOAKTGJ.js.map} +1 -1
- package/dist/{chunk-JHLPO6LZ.js → chunk-E3KOQYY2.js} +3 -3
- package/dist/{chunk-JHLPO6LZ.js.map → chunk-E3KOQYY2.js.map} +1 -1
- package/dist/{chunk-F6B4CDUL.js → chunk-GKR52SVU.js} +3 -3
- package/dist/{chunk-F6B4CDUL.js.map → chunk-GKR52SVU.js.map} +1 -1
- package/dist/chunk-LBTAK5JA.cjs +12 -0
- package/dist/{chunk-V45VFRBI.cjs.map → chunk-LBTAK5JA.cjs.map} +1 -1
- package/dist/{chunk-77RKNRNH.cjs → chunk-MP4IMAPF.cjs} +55 -55
- package/dist/{chunk-77RKNRNH.cjs.map → chunk-MP4IMAPF.cjs.map} +1 -1
- package/dist/{chunk-AWOKWGTB.cjs → chunk-PQJGV3RE.cjs} +83 -83
- package/dist/{chunk-AWOKWGTB.cjs.map → chunk-PQJGV3RE.cjs.map} +1 -1
- package/dist/{chunk-F6YBM6EE.js → chunk-Q4B25EZO.js} +3 -3
- package/dist/{chunk-F6YBM6EE.js.map → chunk-Q4B25EZO.js.map} +1 -1
- package/dist/{chunk-XPCCR7OH.cjs → chunk-TDFM563X.cjs} +12 -12
- package/dist/{chunk-XPCCR7OH.cjs.map → chunk-TDFM563X.cjs.map} +1 -1
- package/dist/{chunk-PWZNUXKT.js → chunk-VU5BCK2P.js} +3 -3
- package/dist/{chunk-PWZNUXKT.js.map → chunk-VU5BCK2P.js.map} +1 -1
- package/dist/{chunk-4BPCKBLP.js → chunk-YHGAFRN6.js} +3 -3
- package/dist/{chunk-4BPCKBLP.js.map → chunk-YHGAFRN6.js.map} +1 -1
- package/dist/{chunk-SEPFCHBJ.js → chunk-ZURCZQQ7.js} +5368 -5358
- package/dist/chunk-ZURCZQQ7.js.map +1 -0
- package/dist/core/index.cjs +107 -107
- package/dist/core/index.js +10 -10
- package/dist/index.css +1 -1
- package/dist/manager/index.cjs +239 -239
- package/dist/manager/index.js +6 -6
- package/dist/tokens.json +7 -1
- package/dist/traveller/index.cjs +35 -35
- package/dist/traveller/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-4QMYUKW4.cjs.map +0 -1
- package/dist/chunk-SEPFCHBJ.js.map +0 -1
- package/dist/chunk-V45VFRBI.cjs +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useKaafilChrome, useOutboxStatus, useCapabilities, usePersona, tokenStyle } from './chunk-
|
|
1
|
+
import { useKaafilChrome, useOutboxStatus, useCapabilities, usePersona, tokenStyle } from './chunk-ZURCZQQ7.js';
|
|
2
2
|
import { useState, useRef, useId, useEffect } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -283,5 +283,5 @@ function SessionExpiredScreen({
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, PlanLockedScreen, SessionExpiredScreen };
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
287
|
-
//# sourceMappingURL=chunk-
|
|
286
|
+
//# sourceMappingURL=chunk-YHGAFRN6.js.map
|
|
287
|
+
//# sourceMappingURL=chunk-YHGAFRN6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/system-screens/BootErrorScreen.tsx","../src/shared/system-screens/internal/SystemScreenFrame.tsx","../src/shared/system-screens/LockedTripScreen.tsx","../src/shared/system-screens/NotFoundScreen.tsx","../src/shared/system-screens/OfflineFallbackScreen.tsx","../src/shared/system-screens/PlanLockedScreen.tsx","../src/shared/system-screens/SessionExpiredScreen.tsx"],"names":["jsx","jsxs","Fragment","useState"],"mappings":";;;;AAgEA,IAAM,IAAA,GAAkD;AAAA,EACtD,cAAA,EACE,yFAAA;AAAA,EACF,mBAAA,EACE,sFAAA;AAAA,EACF,kBAAA,EAAoB,+EAAA;AAAA,EACpB,YAAA,EAAc,2EAAA;AAAA,EACd,IAAA,EAAM,gGAAA;AAAA,EACN,OAAA,EAAS;AACX,CAAA;AAEA,IAAM,KAAA,GAAuB;AAAA,EAC3B,SAAA,EAAW,YAAA;AAAA,EACX,aAAA,EAAe,OAAA;AAAA,EACf,YAAA,EAAc,MAAA;AAAA,EACd,WAAA,EAAa,MAAA;AAAA,EACb,OAAA,EAAS,QAAA;AAAA,EACT,MAAA,EAAQ,mBAAA;AAAA,EACR,YAAA,EAAc,MAAA;AAAA,EACd,UAAA,EAAY,SAAA;AAAA,EACZ,KAAA,EAAO,SAAA;AAAA,EACP,UAAA,EAAY,wDAAA;AAAA,EACZ,QAAA,EAA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E SCREEN THAT CANNOT ASSUME ANYTHING ───────────────────────────\n//\n// It renders when `<KaafilUIKitProvider>` itself never opened, mounted by\n// the integrator's own error boundary around it. That means:\n//\n// · NO `I18nShell` → no `t()`. The copy below is ENGLISH ONLY, and that\n// is the spec's own DELTA, not an oversight.\n// · NO `ThemeShell` → no resolved tokens.\n// · NO `usePersona` → the credential never opened, so there is no\n// resolved persona to fork a presentation on. This is\n// the ONE screen in the tier that ships a single\n// rendering for every mounting context, including the\n// share surface — `public`'s richer reading layout\n// depends on shells that did not run.\n// · NO hook of any kind. There is no context above it to read.\n//\n// ── WHY IT CARRIES INLINE STYLES, WHICH NOTHING ELSE HERE DOES ───────────\n//\n// The stylesheet is OPT-IN (`import \"kaafil-react-uikit/styles\"`), so this\n// screen may render with no CSS whatsoever — and it is the one screen whose\n// entire job is explaining a total failure. Unstyled black-on-white text is\n// a poor way to do that, and a token reference resolves to nothing when the\n// ladder never loaded.\n//\n// So every node carries BOTH: an inline style that works with zero CSS, and\n// a `.kf-boot-error-screen__*` class so a host that DID load the stylesheet\n// can restyle it. The literals below are deliberate and must not be\n// \"corrected\" into `var(--kf-*)` — doing so silently breaks the only case\n// this screen exists for. dx-05 governs `src/styles/components/**` and does\n// not reach here, which is consistent rather than a loophole: the rule\n// exists so a stylesheet cannot shadow a token, and this file is not one.\n\nimport type { CSSProperties, ReactNode } from 'react';\nimport { useState } from 'react';\n\n/** The same failure modes `<KaafilSessionProbe/>` distinguishes, plus the\n * honest sixth for anything unclassifiable. */\nexport type BootFailureMode =\n | 'endpoint-401'\n | 'wrong-environment'\n | 'test-key-on-live'\n | 'clock-skew'\n | 'cors'\n | 'unknown';\n\nexport interface BootErrorScreenProps {\n readonly failureMode?: BootFailureMode;\n /** The underlying error's message. Rendered behind a disclosure, never\n * inline in the primary copy — it is developer-facing. */\n readonly detail?: string;\n /** Remounts the entire provider tree; some boot failures (a `kf_test_`\n * key shipped to production) cannot be fixed by retrying at all, which\n * is why this is optional. */\n readonly onRetry?: () => void;\n readonly components?: { readonly BootErrorScreenUI?: () => ReactNode };\n}\n\n/** English-only by contract — see this file's header. Each line says what\n * an integrator can actually DO, because the audience for a boot failure is\n * whoever wired the provider, not an end user. */\nconst COPY: Readonly<Record<BootFailureMode, string>> = {\n 'endpoint-401':\n 'The API key or session token was rejected. Check the credential the provider was given.',\n 'wrong-environment':\n 'This credential belongs to a different environment than the endpoint it was sent to.',\n 'test-key-on-live': 'A test key was used against live. Retrying will not help — swap the key.',\n 'clock-skew': \"This device's clock is too far from the server's for a token to validate.\",\n cors: 'The browser blocked the request before it was sent. This origin is not allowlisted on the API.',\n unknown: 'Kaafil could not start. The detail below may say why.',\n};\n\nconst PANEL: CSSProperties = {\n boxSizing: 'border-box',\n maxInlineSize: '32rem',\n marginInline: 'auto',\n marginBlock: '3rem',\n padding: '1.5rem',\n border: '1px solid #e3ded7',\n borderRadius: '10px',\n background: '#ffffff',\n color: '#1c1917',\n fontFamily: 'system-ui, -apple-system, Segoe UI, Roboto, sans-serif',\n fontSize: '0.875rem',\n lineHeight: 1.5,\n};\n\nconst TITLE: CSSProperties = { margin: '0 0 0.5rem', fontSize: '1rem', fontWeight: 600 };\nconst BODY: CSSProperties = { margin: '0 0 1rem', color: '#57534e' };\nconst CODE: CSSProperties = {\n display: 'block',\n overflowX: 'auto',\n marginBlockStart: '0.5rem',\n padding: '0.75rem',\n borderRadius: '6px',\n background: '#f5f5f4',\n color: '#44403c',\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',\n fontSize: '0.75rem',\n whiteSpace: 'pre-wrap',\n};\nconst BUTTON: CSSProperties = {\n padding: '0.5rem 1rem',\n border: '0',\n borderRadius: '8px',\n background: '#1c1917',\n color: '#ffffff',\n fontSize: '0.8125rem',\n fontWeight: 500,\n cursor: 'pointer',\n};\nconst TOGGLE: CSSProperties = {\n marginBlockStart: '1rem',\n color: '#78716c',\n fontSize: '0.75rem',\n cursor: 'pointer',\n};\n\nexport function BootErrorScreen({\n failureMode = 'unknown',\n detail,\n onRetry,\n components,\n}: BootErrorScreenProps): ReactNode {\n const [showDetail, setShowDetail] = useState(false);\n const Override = components?.BootErrorScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <div className=\"kf-boot-error-screen\" style={PANEL} role=\"alert\">\n <h1 className=\"kf-boot-error-screen__title\" style={TITLE}>\n Kaafil could not start\n </h1>\n <p className=\"kf-boot-error-screen__body\" style={BODY}>\n {COPY[failureMode]}\n </p>\n\n {onRetry === undefined ? null : (\n <button\n type=\"button\"\n className=\"kf-boot-error-screen__retry\"\n style={BUTTON}\n onClick={onRetry}\n >\n Try again\n </button>\n )}\n\n {detail === undefined || detail === '' ? null : (\n <div className=\"kf-boot-error-screen__detail\">\n {/* A disclosure rather than always-on: the message is the\n * underlying error's, which can be long and is not the first\n * thing a reader needs. */}\n <button\n type=\"button\"\n className=\"kf-boot-error-screen__detail-toggle\"\n style={{ ...TOGGLE, background: 'none', border: 0, padding: 0 }}\n aria-expanded={showDetail}\n onClick={() => setShowDetail((open) => !open)}\n >\n {showDetail ? 'Hide technical detail' : 'Show technical detail'}\n </button>\n {showDetail ? (\n <code className=\"kf-boot-error-screen__detail-text\" style={CODE}>\n {detail}\n </code>\n ) : null}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\n// The one frame the five context-reading system screens share.\n//\n// ── THE PRESENTATION FORK IS REAL, AND IT IS NOT A PROP ───────────────────\n//\n// `shared/01-system-screens.md` records a `Presentation notes by mounting\n// context` field on every screen: an `admin`-family mount is a CONTAINED\n// CARD inside the host's own CRM page, a `manager`-family mount is a\n// FULL-VIEWPORT takeover with its primary action reachable without\n// scrolling. The spec is explicit that this is a genuine layout-model fork\n// (`03-layer-contract.md §5` level 3), not a spacing difference — and\n// equally explicit that it is ONE component, never two named variants.\n//\n// It is derived from `usePersona()`, never from a prop. Hard rule #7: no\n// `persona` prop and no `mode` prop exists anywhere, and dx-07 fails the\n// build on either. The credential decides.\n//\n// ── WHY THIS IS A FRAME AND NOT AN ATOM ──────────────────────────────────\n//\n// The spec's `Composes` rows name `EmptyState`/`Button`/`Banner` atoms from\n// `atomic/*`. Those do not exist: the v2 rebuild ships no shared\n// `/primitives` layer, by decision — each family owns whatever atoms it\n// needs. So these five screens share a FRAME (the layout fork, the focus\n// move, the announcement) and own their own content, rather than depending\n// on a primitives package this package deliberately does not have.\n\nimport type { ReactNode } from 'react';\nimport { useEffect, useId, useRef } from 'react';\nimport { usePersona } from '../../../core/hooks/usePersona.js';\nimport type { KaafilTokenOverrides } from '../../../primitives/internal/tokenStyle.js';\nimport { tokenStyle } from '../../../primitives/internal/tokenStyle.js';\n\nexport interface SystemScreenFrameProps {\n /** BEM block name — each screen owns its own, so a host can target one\n * without catching the rest (`.kf-session-expired-screen__*`). */\n readonly block: string;\n readonly title: string;\n readonly body: ReactNode;\n /** Rendered below the body. On a field mount this is what the sticky\n * action region holds. */\n readonly actions?: ReactNode;\n /** An error/context line above the title. */\n readonly banner?: ReactNode;\n readonly icon?: ReactNode;\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function SystemScreenFrame({\n block,\n title,\n body,\n actions,\n banner,\n icon,\n style,\n}: SystemScreenFrameProps): ReactNode {\n const persona = usePersona();\n const headingRef = useRef<HTMLHeadingElement>(null);\n const headingId = useId();\n\n // A field mount owns the whole screen; a desk mount is embedded beside the\n // host's own nav and must not consume the viewport (briefing §27.7).\n // `traveller` takes the contained treatment too — only `OfflineFallback`\n // and `BootError` reach the public surface, and neither should black out\n // a document a host has embedded.\n const layout = persona === 'manager' ? 'takeover' : 'contained';\n\n // FOCUS MOVES TO THE HEADING on mount. This is a full state replacement,\n // not an overlay — there is no opener to return focus to, so the\n // overlay-focus contract (`12-accessibility.md §3`) does not apply and the\n // heading is the correct landing point. Without this a keyboard or screen\n // reader user gets no signal that the page became something else and Tab\n // keeps walking whatever is still behind it.\n useEffect(() => {\n headingRef.current?.focus();\n }, []);\n\n return (\n <div\n className=\"kf-system-screen\"\n data-block={block}\n data-layout={layout}\n style={tokenStyle(style)}\n // A significant, infrequent state change — announced politely rather\n // than assertively, since the focus move above already carries the\n // urgency and `assertive` would interrupt whatever is mid-sentence.\n role=\"status\"\n aria-live=\"polite\"\n aria-labelledby={headingId}\n >\n <div className={`kf-system-screen__panel ${block}`}>\n {icon === undefined ? null : (\n <span className=\"kf-system-screen__glyph\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {banner === undefined ? null : <div className=\"kf-system-screen__banner\">{banner}</div>}\n {/* `tabIndex={-1}` so the effect above can focus it — a heading is\n * not focusable by default and focusing the panel instead would\n * draw the accent ring around the entire card. */}\n <h1 ref={headingRef} id={headingId} tabIndex={-1} className=\"kf-system-screen__title\">\n {title}\n </h1>\n <div className=\"kf-system-screen__body\">{body}</div>\n {actions === undefined ? null : <div className=\"kf-system-screen__actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §LockedTripScreen`.\n//\n// The destination for a WRITE-ONLY deep link into a closed-out trip — a\n// \"record this collection\" push sent before the trip closed, a bookmarked\n// mutation route. Mounting the flow it points at would show a form whose\n// one action can only ever answer `423`.\n//\n// BACKED BY NOTHING, and that is the discipline rather than a gap. This\n// screen never calls `closeout.get`/`useCloseout` to learn the trip is\n// locked: the caller already knows (its own write would 423, or the link's\n// own metadata carried the LOCKED stage). Checking again here would be a\n// second gate — \"check the resolved state before render, never\n// render-then-catch\", applied to lock state instead of capability darkness.\n//\n// LINKS to Closing Day, never mounts it. No unlock control appears here or\n// anywhere else at any layer (hard rule #21): the desk locks, the CRM\n// reopens.\n\nimport type { ReactNode } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface LockedTripScreenProps {\n /** For context and for building the link's destination — never used to\n * fetch anything. */\n readonly tripRef: string;\n /** What the dead-end link would have done (\"Record a collection\"), from\n * whatever metadata came with it. Absent means the generic sentence: this\n * screen invents no explanation of its own. */\n readonly intendedAction?: string;\n /** The host's own navigation to wherever it mounts Closing Day. A screen\n * never navigates itself. */\n readonly onGoToClosingDay: (tripRef: string) => void;\n readonly components?: { readonly LockedTripScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function LockedTripScreen({\n tripRef,\n intendedAction,\n onGoToClosingDay,\n components,\n style,\n}: LockedTripScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const Override = components?.LockedTripScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-locked-trip-screen\"\n title={t('chrome.systemScreens.lockedTrip.title')}\n banner={\n intendedAction === undefined\n ? t('chrome.systemScreens.lockedTrip.genericAction')\n : t('chrome.systemScreens.lockedTrip.namedAction').replace('{action}', intendedAction)\n }\n body={<p>{t('chrome.systemScreens.lockedTrip.body')}</p>}\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n onClick={() => onGoToClosingDay(tripRef)}\n >\n {t('chrome.systemScreens.lockedTrip.action')}\n </button>\n }\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §NotFoundScreen`.\n//\n// A route-level 404 for a `manager`/`agencyAdmin` mount: a bookmarked\n// `tripRef` from another agency, a deep link to a deleted entity, a stale\n// notification pointing at a now-cross-tenant resource.\n//\n// NOT THE TRAVELLER'S 404, and this is load-bearing rather than an\n// oversight. A dead share token is `ShareEndedScreen`'s `not-found`\n// variant, which must stay 404-shaped — no heading, no divider, no\n// distinguishing DOM signal (hard rule #20, enforced by dx-15). Rendering\n// THIS screen on the share surface would leak that the token was once real.\n// It is therefore never re-exported from `/traveller`.\n//\n// BACKED BY NOTHING, by design. It renders on a 404 that some mounted\n// flow's own hook already surfaced; it performs no second fetch to\n// \"double-check\" what the flow already learned.\n\nimport type { ReactNode } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface NotFoundScreenProps {\n /** The host's own \"back\" navigation. Optional — a host that reached this\n * with no history to return to simply gets no button, which is more\n * honest than one that goes nowhere. */\n readonly onGoBack?: () => void;\n readonly components?: { readonly NotFoundScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function NotFoundScreen({ onGoBack, components, style }: NotFoundScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const Override = components?.NotFoundScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-not-found-screen\"\n title={t('chrome.systemScreens.notFound.title')}\n // Deliberately does not speculate about WHY. \"Deleted, or belongs to\n // another agency, or you mistyped it\" are three different sentences\n // and this screen cannot tell which is true — naming one would be a\n // guess presented as a diagnosis.\n body={<p>{t('chrome.systemScreens.notFound.body')}</p>}\n {...(style !== undefined ? { style } : {})}\n {...(onGoBack !== undefined\n ? {\n actions: (\n <button type=\"button\" className=\"kf-system-screen__primary\" onClick={onGoBack}>\n {t('chrome.systemScreens.notFound.action')}\n </button>\n ),\n }\n : {})}\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §OfflineFallbackScreen`.\n//\n// The device has nothing cached AND no connectivity — a manager opening a\n// trip for the first time at a trailhead before ever syncing, a desk\n// session losing the network before its first pull, a share link opened\n// with zero signal before the first snapshot.\n//\n// THE ONLY ONE OF THE SIX THE TRAVELLER SURFACE SHARES besides\n// `BootErrorScreen`, and it is safe there precisely because it discloses\n// nothing: \"there is no connection\" is true of any URL and leaks nothing\n// about whether this token was ever real. That is what separates it from\n// `ShareEndedScreen`'s dead-token cases, which are about a token's\n// VALIDITY and must stay 404-shaped (hard rule #20).\n//\n// SESSION STATE OUTRANKS THIS. An offline device whose credential has also\n// expired shows `SessionExpiredScreen`, not this — re-authentication is the\n// blocking concern regardless of connectivity, and a caller composing both\n// should check session first.\n\nimport type { ReactNode } from 'react';\nimport { useOutboxStatus } from '../../core/hooks/useOutboxStatus.js';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface OfflineFallbackScreenProps {\n /** Present on a trip-scoped mount; absent on the share surface. Context\n * only — this screen fetches nothing. */\n readonly tripRef?: string;\n /** Present on a share mount instead of `tripRef`. */\n readonly token?: string;\n /** The host's own retry — typically remounting whatever failed. */\n readonly onRetry?: () => void;\n readonly components?: { readonly OfflineFallbackScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function OfflineFallbackScreen({\n onRetry,\n components,\n style,\n}: OfflineFallbackScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const { isOnline } = useOutboxStatus();\n const Override = components?.OfflineFallbackScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-offline-fallback-screen\"\n title={t('chrome.systemScreens.offlineFallback.title')}\n body={\n <>\n <p>{t('chrome.systemScreens.offlineFallback.body')}</p>\n {/* Connectivity came back while this was on screen. Said rather\n * than acted on: this screen does not refetch or navigate on its\n * own, because whatever failed is the caller's to retry — but\n * leaving a stale \"you are offline\" up while the bars are back is\n * the thing that makes an app feel broken. */}\n {isOnline ? (\n <p data-tone=\"ok\">{t('chrome.systemScreens.offlineFallback.backOnline')}</p>\n ) : null}\n </>\n }\n {...(style !== undefined ? { style } : {})}\n {...(onRetry !== undefined\n ? {\n actions: (\n <button type=\"button\" className=\"kf-system-screen__primary\" onClick={onRetry}>\n {t('chrome.systemScreens.offlineFallback.action')}\n </button>\n ),\n }\n : {})}\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §PlanLockedScreen`.\n//\n// The takeover a STANDALONE route (no surrounding tab bar) renders when its\n// destination module is flag-dark. Admin-only: entitlement is a desk\n// concern, a manager's flows are always mounted inside a tab set where a\n// flag-dark tab renders its own inline view, and the share surface has no\n// upsell copy at all (its flag-dark case is 404-shaped).\n//\n// ── A SPEC FIELD THAT HAS NO WIRE SOURCE ─────────────────────────────────\n//\n// The spec splits the CTA by `details.reason` into `'agency'` (the agency's\n// own plan) vs `'partner-ceiling'` (the partner's tier caps it), so the\n// right person is sent to the right queue. `CapabilityRow` carries no such\n// field — `06-capability-and-personas.md §6` point 2 fixes it as \"four\n// booleans, no `reason` string\", and `capability.types.ts` says so too.\n//\n// So the reason is an OPTIONAL PROP, supplied by whatever the caller saw\n// (a refusal's own `details`), and `onUpgradeRequest` is called with\n// `undefined` when nobody knows. Defaulting it to `'agency'` would have\n// been a guess routed to a real support queue — the host can decide what to\n// do with \"unknown\" far better than this screen can invent an answer.\n\nimport type { ReactNode } from 'react';\nimport { useCapabilities } from '../../core/hooks/useCapabilities.js';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport type PlanLockedReason = 'agency' | 'partner-ceiling';\n\nexport interface PlanLockedScreenProps {\n /** The capability this route was headed for. Read for its own triple\n * only — never exhaustively switched on (`§6` point 5's open-set rule). */\n readonly capabilityKey: string;\n /** The host's own upsell/support flow — Kaafil has no in-product upgrade\n * path to hand off to. `undefined` means the wire did not say which\n * queue this belongs in; see this file's header. */\n readonly onUpgradeRequest: (reason: PlanLockedReason | undefined) => void;\n /** Supplied by the caller when it saw a refusal that named one. */\n readonly reason?: PlanLockedReason;\n readonly components?: { readonly PlanLockedScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function PlanLockedScreen({\n capabilityKey,\n onUpgradeRequest,\n reason,\n components,\n style,\n}: PlanLockedScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const capabilities = useCapabilities([capabilityKey]);\n const Override = components?.PlanLockedScreenUI;\n if (Override !== undefined) return <Override />;\n\n // Read, never re-derived: `status` is resolved once in `/core` and this\n // screen reads it rather than recombining the booleans itself\n // (`06-capability-and-personas.md §6` point 2).\n const status = capabilities.get(capabilityKey)?.status;\n\n return (\n <SystemScreenFrame\n block=\"kf-plan-locked-screen\"\n title={t('chrome.systemScreens.planLocked.title')}\n body={\n <>\n <p>\n {t(\n reason === 'partner-ceiling'\n ? 'chrome.systemScreens.planLocked.bodyPartnerCeiling'\n : 'chrome.systemScreens.planLocked.body',\n )}\n </p>\n {/* A route that reached this screen for a capability that is NOT\n * flag-dark is a caller bug, and saying so beats rendering upsell\n * copy over a module that is merely data-dark or simply lit. */}\n {status === 'flag-dark' ? null : (\n <p data-tone=\"warn\">{t('chrome.systemScreens.planLocked.notFlagDark')}</p>\n )}\n </>\n }\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n onClick={() => onUpgradeRequest(reason)}\n >\n {t('chrome.systemScreens.planLocked.action')}\n </button>\n }\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §SessionExpiredScreen`.\n//\n// Renders exactly when `useSession().status === 'expired'` — the open\n// credential's silent refresh has exhausted itself. Re-authentication is\n// routed through the HOST's own login; Kaafil has no login page to redirect\n// to, which is why `onReauthenticate` is required and has no default.\n//\n// DOES NOT retry any token call itself. A broken credential means the\n// host's own user is not authenticated and must re-authenticate through the\n// host's own flow — obtaining fresh tokens is `SessionShell`'s concern on\n// the NEXT successful mount, not this screen's on the current broken one.\n//\n// DOES NOT inspect which credential kind expired beyond the resolved\n// persona (`00-decisions.md` U-003 forecloses reading a JWT at any layer\n// above `SessionShell`).\n\nimport type { ReactNode } from 'react';\nimport { useState } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface SessionExpiredScreenProps {\n /** The host's own re-auth entry point. Required: there is no default\n * action, because Kaafil has no login page of its own. */\n readonly onReauthenticate: (returnTo?: string) => void | Promise<void>;\n /** Threaded back to `onReauthenticate` UNEXAMINED. This screen never\n * interprets it, builds a URL from it, or hands it to a router — it\n * exists purely so the host's own flow can restore the right destination\n * afterwards. */\n readonly returnTo?: string;\n readonly components?: { readonly SessionExpiredScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function SessionExpiredScreen({\n onReauthenticate,\n returnTo,\n components,\n style,\n}: SessionExpiredScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const [pending, setPending] = useState(false);\n // The host's own auth failure reason is not something Kaafil can\n // classify, so the rejection's own message is shown verbatim.\n const [failure, setFailure] = useState<string | undefined>(undefined);\n\n const Override = components?.SessionExpiredScreenUI;\n if (Override !== undefined) return <Override />;\n\n async function reauthenticate(): Promise<void> {\n setPending(true);\n setFailure(undefined);\n try {\n await onReauthenticate(returnTo);\n } catch (error) {\n setFailure(error instanceof Error ? error.message : String(error));\n } finally {\n setPending(false);\n }\n }\n\n return (\n <SystemScreenFrame\n block=\"kf-session-expired-screen\"\n title={t('chrome.systemScreens.sessionExpired.title')}\n body={<p>{t('chrome.systemScreens.sessionExpired.body')}</p>}\n {...(failure !== undefined ? { banner: <span data-tone=\"warn\">{failure}</span> } : {})}\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n disabled={pending}\n onClick={() => void reauthenticate()}\n >\n {t(\n pending\n ? 'chrome.systemScreens.sessionExpired.busy'\n : 'chrome.systemScreens.sessionExpired.action',\n )}\n </button>\n }\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shared/system-screens/BootErrorScreen.tsx","../src/shared/system-screens/internal/SystemScreenFrame.tsx","../src/shared/system-screens/LockedTripScreen.tsx","../src/shared/system-screens/NotFoundScreen.tsx","../src/shared/system-screens/OfflineFallbackScreen.tsx","../src/shared/system-screens/PlanLockedScreen.tsx","../src/shared/system-screens/SessionExpiredScreen.tsx"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vD,GAAI,OAAA,KAAY,MAAA,GAAY,EAAE,MAAA,kBAAQA,GAAAA,CAAC,MAAA,EAAA,EAAK,WAAA,EAAU,MAAA,EAAQ,QAAA,EAAA,OAAA,EAAQ,CAAA,KAAY,EAAC;AAAA,MACnF,GAAI,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,KAAU,EAAC;AAAA,MACxC,yBACEA,GAAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,SAAA,EAAU,2BAAA;AAAA,UACV,QAAA,EAAU,OAAA;AAAA,UACV,OAAA,EAAS,MAAM,KAAK,cAAA,EAAe;AAAA,UAElC,QAAA,EAAA,CAAA;AAAA,YACC,UACI,0CAAA,GACA;AAAA;AACN;AAAA;AACF;AAAA,GAEJ;AAEJ","file":"chunk-YHGAFRN6.js","sourcesContent":["'use client';\n\n// `shared/01-system-screens.md §BootErrorScreen`.\n//\n// ── THE ONE SCREEN THAT CANNOT ASSUME ANYTHING ───────────────────────────\n//\n// It renders when `<KaafilUIKitProvider>` itself never opened, mounted by\n// the integrator's own error boundary around it. That means:\n//\n// · NO `I18nShell` → no `t()`. The copy below is ENGLISH ONLY, and that\n// is the spec's own DELTA, not an oversight.\n// · NO `ThemeShell` → no resolved tokens.\n// · NO `usePersona` → the credential never opened, so there is no\n// resolved persona to fork a presentation on. This is\n// the ONE screen in the tier that ships a single\n// rendering for every mounting context, including the\n// share surface — `public`'s richer reading layout\n// depends on shells that did not run.\n// · NO hook of any kind. There is no context above it to read.\n//\n// ── WHY IT CARRIES INLINE STYLES, WHICH NOTHING ELSE HERE DOES ───────────\n//\n// The stylesheet is OPT-IN (`import \"kaafil-react-uikit/styles\"`), so this\n// screen may render with no CSS whatsoever — and it is the one screen whose\n// entire job is explaining a total failure. Unstyled black-on-white text is\n// a poor way to do that, and a token reference resolves to nothing when the\n// ladder never loaded.\n//\n// So every node carries BOTH: an inline style that works with zero CSS, and\n// a `.kf-boot-error-screen__*` class so a host that DID load the stylesheet\n// can restyle it. The literals below are deliberate and must not be\n// \"corrected\" into `var(--kf-*)` — doing so silently breaks the only case\n// this screen exists for. dx-05 governs `src/styles/components/**` and does\n// not reach here, which is consistent rather than a loophole: the rule\n// exists so a stylesheet cannot shadow a token, and this file is not one.\n\nimport type { CSSProperties, ReactNode } from 'react';\nimport { useState } from 'react';\n\n/** The same failure modes `<KaafilSessionProbe/>` distinguishes, plus the\n * honest sixth for anything unclassifiable. */\nexport type BootFailureMode =\n | 'endpoint-401'\n | 'wrong-environment'\n | 'test-key-on-live'\n | 'clock-skew'\n | 'cors'\n | 'unknown';\n\nexport interface BootErrorScreenProps {\n readonly failureMode?: BootFailureMode;\n /** The underlying error's message. Rendered behind a disclosure, never\n * inline in the primary copy — it is developer-facing. */\n readonly detail?: string;\n /** Remounts the entire provider tree; some boot failures (a `kf_test_`\n * key shipped to production) cannot be fixed by retrying at all, which\n * is why this is optional. */\n readonly onRetry?: () => void;\n readonly components?: { readonly BootErrorScreenUI?: () => ReactNode };\n}\n\n/** English-only by contract — see this file's header. Each line says what\n * an integrator can actually DO, because the audience for a boot failure is\n * whoever wired the provider, not an end user. */\nconst COPY: Readonly<Record<BootFailureMode, string>> = {\n 'endpoint-401':\n 'The API key or session token was rejected. Check the credential the provider was given.',\n 'wrong-environment':\n 'This credential belongs to a different environment than the endpoint it was sent to.',\n 'test-key-on-live': 'A test key was used against live. Retrying will not help — swap the key.',\n 'clock-skew': \"This device's clock is too far from the server's for a token to validate.\",\n cors: 'The browser blocked the request before it was sent. This origin is not allowlisted on the API.',\n unknown: 'Kaafil could not start. The detail below may say why.',\n};\n\nconst PANEL: CSSProperties = {\n boxSizing: 'border-box',\n maxInlineSize: '32rem',\n marginInline: 'auto',\n marginBlock: '3rem',\n padding: '1.5rem',\n border: '1px solid #e3ded7',\n borderRadius: '10px',\n background: '#ffffff',\n color: '#1c1917',\n fontFamily: 'system-ui, -apple-system, Segoe UI, Roboto, sans-serif',\n fontSize: '0.875rem',\n lineHeight: 1.5,\n};\n\nconst TITLE: CSSProperties = { margin: '0 0 0.5rem', fontSize: '1rem', fontWeight: 600 };\nconst BODY: CSSProperties = { margin: '0 0 1rem', color: '#57534e' };\nconst CODE: CSSProperties = {\n display: 'block',\n overflowX: 'auto',\n marginBlockStart: '0.5rem',\n padding: '0.75rem',\n borderRadius: '6px',\n background: '#f5f5f4',\n color: '#44403c',\n fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',\n fontSize: '0.75rem',\n whiteSpace: 'pre-wrap',\n};\nconst BUTTON: CSSProperties = {\n padding: '0.5rem 1rem',\n border: '0',\n borderRadius: '8px',\n background: '#1c1917',\n color: '#ffffff',\n fontSize: '0.8125rem',\n fontWeight: 500,\n cursor: 'pointer',\n};\nconst TOGGLE: CSSProperties = {\n marginBlockStart: '1rem',\n color: '#78716c',\n fontSize: '0.75rem',\n cursor: 'pointer',\n};\n\nexport function BootErrorScreen({\n failureMode = 'unknown',\n detail,\n onRetry,\n components,\n}: BootErrorScreenProps): ReactNode {\n const [showDetail, setShowDetail] = useState(false);\n const Override = components?.BootErrorScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <div className=\"kf-boot-error-screen\" style={PANEL} role=\"alert\">\n <h1 className=\"kf-boot-error-screen__title\" style={TITLE}>\n Kaafil could not start\n </h1>\n <p className=\"kf-boot-error-screen__body\" style={BODY}>\n {COPY[failureMode]}\n </p>\n\n {onRetry === undefined ? null : (\n <button\n type=\"button\"\n className=\"kf-boot-error-screen__retry\"\n style={BUTTON}\n onClick={onRetry}\n >\n Try again\n </button>\n )}\n\n {detail === undefined || detail === '' ? null : (\n <div className=\"kf-boot-error-screen__detail\">\n {/* A disclosure rather than always-on: the message is the\n * underlying error's, which can be long and is not the first\n * thing a reader needs. */}\n <button\n type=\"button\"\n className=\"kf-boot-error-screen__detail-toggle\"\n style={{ ...TOGGLE, background: 'none', border: 0, padding: 0 }}\n aria-expanded={showDetail}\n onClick={() => setShowDetail((open) => !open)}\n >\n {showDetail ? 'Hide technical detail' : 'Show technical detail'}\n </button>\n {showDetail ? (\n <code className=\"kf-boot-error-screen__detail-text\" style={CODE}>\n {detail}\n </code>\n ) : null}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\n// The one frame the five context-reading system screens share.\n//\n// ── THE PRESENTATION FORK IS REAL, AND IT IS NOT A PROP ───────────────────\n//\n// `shared/01-system-screens.md` records a `Presentation notes by mounting\n// context` field on every screen: an `admin`-family mount is a CONTAINED\n// CARD inside the host's own CRM page, a `manager`-family mount is a\n// FULL-VIEWPORT takeover with its primary action reachable without\n// scrolling. The spec is explicit that this is a genuine layout-model fork\n// (`03-layer-contract.md §5` level 3), not a spacing difference — and\n// equally explicit that it is ONE component, never two named variants.\n//\n// It is derived from `usePersona()`, never from a prop. Hard rule #7: no\n// `persona` prop and no `mode` prop exists anywhere, and dx-07 fails the\n// build on either. The credential decides.\n//\n// ── WHY THIS IS A FRAME AND NOT AN ATOM ──────────────────────────────────\n//\n// The spec's `Composes` rows name `EmptyState`/`Button`/`Banner` atoms from\n// `atomic/*`. Those do not exist: the v2 rebuild ships no shared\n// `/primitives` layer, by decision — each family owns whatever atoms it\n// needs. So these five screens share a FRAME (the layout fork, the focus\n// move, the announcement) and own their own content, rather than depending\n// on a primitives package this package deliberately does not have.\n\nimport type { ReactNode } from 'react';\nimport { useEffect, useId, useRef } from 'react';\nimport { usePersona } from '../../../core/hooks/usePersona.js';\nimport type { KaafilTokenOverrides } from '../../../primitives/internal/tokenStyle.js';\nimport { tokenStyle } from '../../../primitives/internal/tokenStyle.js';\n\nexport interface SystemScreenFrameProps {\n /** BEM block name — each screen owns its own, so a host can target one\n * without catching the rest (`.kf-session-expired-screen__*`). */\n readonly block: string;\n readonly title: string;\n readonly body: ReactNode;\n /** Rendered below the body. On a field mount this is what the sticky\n * action region holds. */\n readonly actions?: ReactNode;\n /** An error/context line above the title. */\n readonly banner?: ReactNode;\n readonly icon?: ReactNode;\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function SystemScreenFrame({\n block,\n title,\n body,\n actions,\n banner,\n icon,\n style,\n}: SystemScreenFrameProps): ReactNode {\n const persona = usePersona();\n const headingRef = useRef<HTMLHeadingElement>(null);\n const headingId = useId();\n\n // A field mount owns the whole screen; a desk mount is embedded beside the\n // host's own nav and must not consume the viewport (briefing §27.7).\n // `traveller` takes the contained treatment too — only `OfflineFallback`\n // and `BootError` reach the public surface, and neither should black out\n // a document a host has embedded.\n const layout = persona === 'manager' ? 'takeover' : 'contained';\n\n // FOCUS MOVES TO THE HEADING on mount. This is a full state replacement,\n // not an overlay — there is no opener to return focus to, so the\n // overlay-focus contract (`12-accessibility.md §3`) does not apply and the\n // heading is the correct landing point. Without this a keyboard or screen\n // reader user gets no signal that the page became something else and Tab\n // keeps walking whatever is still behind it.\n useEffect(() => {\n headingRef.current?.focus();\n }, []);\n\n return (\n <div\n className=\"kf-system-screen\"\n data-block={block}\n data-layout={layout}\n style={tokenStyle(style)}\n // A significant, infrequent state change — announced politely rather\n // than assertively, since the focus move above already carries the\n // urgency and `assertive` would interrupt whatever is mid-sentence.\n role=\"status\"\n aria-live=\"polite\"\n aria-labelledby={headingId}\n >\n <div className={`kf-system-screen__panel ${block}`}>\n {icon === undefined ? null : (\n <span className=\"kf-system-screen__glyph\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {banner === undefined ? null : <div className=\"kf-system-screen__banner\">{banner}</div>}\n {/* `tabIndex={-1}` so the effect above can focus it — a heading is\n * not focusable by default and focusing the panel instead would\n * draw the accent ring around the entire card. */}\n <h1 ref={headingRef} id={headingId} tabIndex={-1} className=\"kf-system-screen__title\">\n {title}\n </h1>\n <div className=\"kf-system-screen__body\">{body}</div>\n {actions === undefined ? null : <div className=\"kf-system-screen__actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §LockedTripScreen`.\n//\n// The destination for a WRITE-ONLY deep link into a closed-out trip — a\n// \"record this collection\" push sent before the trip closed, a bookmarked\n// mutation route. Mounting the flow it points at would show a form whose\n// one action can only ever answer `423`.\n//\n// BACKED BY NOTHING, and that is the discipline rather than a gap. This\n// screen never calls `closeout.get`/`useCloseout` to learn the trip is\n// locked: the caller already knows (its own write would 423, or the link's\n// own metadata carried the LOCKED stage). Checking again here would be a\n// second gate — \"check the resolved state before render, never\n// render-then-catch\", applied to lock state instead of capability darkness.\n//\n// LINKS to Closing Day, never mounts it. No unlock control appears here or\n// anywhere else at any layer (hard rule #21): the desk locks, the CRM\n// reopens.\n\nimport type { ReactNode } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface LockedTripScreenProps {\n /** For context and for building the link's destination — never used to\n * fetch anything. */\n readonly tripRef: string;\n /** What the dead-end link would have done (\"Record a collection\"), from\n * whatever metadata came with it. Absent means the generic sentence: this\n * screen invents no explanation of its own. */\n readonly intendedAction?: string;\n /** The host's own navigation to wherever it mounts Closing Day. A screen\n * never navigates itself. */\n readonly onGoToClosingDay: (tripRef: string) => void;\n readonly components?: { readonly LockedTripScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function LockedTripScreen({\n tripRef,\n intendedAction,\n onGoToClosingDay,\n components,\n style,\n}: LockedTripScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const Override = components?.LockedTripScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-locked-trip-screen\"\n title={t('chrome.systemScreens.lockedTrip.title')}\n banner={\n intendedAction === undefined\n ? t('chrome.systemScreens.lockedTrip.genericAction')\n : t('chrome.systemScreens.lockedTrip.namedAction').replace('{action}', intendedAction)\n }\n body={<p>{t('chrome.systemScreens.lockedTrip.body')}</p>}\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n onClick={() => onGoToClosingDay(tripRef)}\n >\n {t('chrome.systemScreens.lockedTrip.action')}\n </button>\n }\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §NotFoundScreen`.\n//\n// A route-level 404 for a `manager`/`agencyAdmin` mount: a bookmarked\n// `tripRef` from another agency, a deep link to a deleted entity, a stale\n// notification pointing at a now-cross-tenant resource.\n//\n// NOT THE TRAVELLER'S 404, and this is load-bearing rather than an\n// oversight. A dead share token is `ShareEndedScreen`'s `not-found`\n// variant, which must stay 404-shaped — no heading, no divider, no\n// distinguishing DOM signal (hard rule #20, enforced by dx-15). Rendering\n// THIS screen on the share surface would leak that the token was once real.\n// It is therefore never re-exported from `/traveller`.\n//\n// BACKED BY NOTHING, by design. It renders on a 404 that some mounted\n// flow's own hook already surfaced; it performs no second fetch to\n// \"double-check\" what the flow already learned.\n\nimport type { ReactNode } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface NotFoundScreenProps {\n /** The host's own \"back\" navigation. Optional — a host that reached this\n * with no history to return to simply gets no button, which is more\n * honest than one that goes nowhere. */\n readonly onGoBack?: () => void;\n readonly components?: { readonly NotFoundScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function NotFoundScreen({ onGoBack, components, style }: NotFoundScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const Override = components?.NotFoundScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-not-found-screen\"\n title={t('chrome.systemScreens.notFound.title')}\n // Deliberately does not speculate about WHY. \"Deleted, or belongs to\n // another agency, or you mistyped it\" are three different sentences\n // and this screen cannot tell which is true — naming one would be a\n // guess presented as a diagnosis.\n body={<p>{t('chrome.systemScreens.notFound.body')}</p>}\n {...(style !== undefined ? { style } : {})}\n {...(onGoBack !== undefined\n ? {\n actions: (\n <button type=\"button\" className=\"kf-system-screen__primary\" onClick={onGoBack}>\n {t('chrome.systemScreens.notFound.action')}\n </button>\n ),\n }\n : {})}\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §OfflineFallbackScreen`.\n//\n// The device has nothing cached AND no connectivity — a manager opening a\n// trip for the first time at a trailhead before ever syncing, a desk\n// session losing the network before its first pull, a share link opened\n// with zero signal before the first snapshot.\n//\n// THE ONLY ONE OF THE SIX THE TRAVELLER SURFACE SHARES besides\n// `BootErrorScreen`, and it is safe there precisely because it discloses\n// nothing: \"there is no connection\" is true of any URL and leaks nothing\n// about whether this token was ever real. That is what separates it from\n// `ShareEndedScreen`'s dead-token cases, which are about a token's\n// VALIDITY and must stay 404-shaped (hard rule #20).\n//\n// SESSION STATE OUTRANKS THIS. An offline device whose credential has also\n// expired shows `SessionExpiredScreen`, not this — re-authentication is the\n// blocking concern regardless of connectivity, and a caller composing both\n// should check session first.\n\nimport type { ReactNode } from 'react';\nimport { useOutboxStatus } from '../../core/hooks/useOutboxStatus.js';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface OfflineFallbackScreenProps {\n /** Present on a trip-scoped mount; absent on the share surface. Context\n * only — this screen fetches nothing. */\n readonly tripRef?: string;\n /** Present on a share mount instead of `tripRef`. */\n readonly token?: string;\n /** The host's own retry — typically remounting whatever failed. */\n readonly onRetry?: () => void;\n readonly components?: { readonly OfflineFallbackScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function OfflineFallbackScreen({\n onRetry,\n components,\n style,\n}: OfflineFallbackScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const { isOnline } = useOutboxStatus();\n const Override = components?.OfflineFallbackScreenUI;\n if (Override !== undefined) return <Override />;\n\n return (\n <SystemScreenFrame\n block=\"kf-offline-fallback-screen\"\n title={t('chrome.systemScreens.offlineFallback.title')}\n body={\n <>\n <p>{t('chrome.systemScreens.offlineFallback.body')}</p>\n {/* Connectivity came back while this was on screen. Said rather\n * than acted on: this screen does not refetch or navigate on its\n * own, because whatever failed is the caller's to retry — but\n * leaving a stale \"you are offline\" up while the bars are back is\n * the thing that makes an app feel broken. */}\n {isOnline ? (\n <p data-tone=\"ok\">{t('chrome.systemScreens.offlineFallback.backOnline')}</p>\n ) : null}\n </>\n }\n {...(style !== undefined ? { style } : {})}\n {...(onRetry !== undefined\n ? {\n actions: (\n <button type=\"button\" className=\"kf-system-screen__primary\" onClick={onRetry}>\n {t('chrome.systemScreens.offlineFallback.action')}\n </button>\n ),\n }\n : {})}\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §PlanLockedScreen`.\n//\n// The takeover a STANDALONE route (no surrounding tab bar) renders when its\n// destination module is flag-dark. Admin-only: entitlement is a desk\n// concern, a manager's flows are always mounted inside a tab set where a\n// flag-dark tab renders its own inline view, and the share surface has no\n// upsell copy at all (its flag-dark case is 404-shaped).\n//\n// ── A SPEC FIELD THAT HAS NO WIRE SOURCE ─────────────────────────────────\n//\n// The spec splits the CTA by `details.reason` into `'agency'` (the agency's\n// own plan) vs `'partner-ceiling'` (the partner's tier caps it), so the\n// right person is sent to the right queue. `CapabilityRow` carries no such\n// field — `06-capability-and-personas.md §6` point 2 fixes it as \"four\n// booleans, no `reason` string\", and `capability.types.ts` says so too.\n//\n// So the reason is an OPTIONAL PROP, supplied by whatever the caller saw\n// (a refusal's own `details`), and `onUpgradeRequest` is called with\n// `undefined` when nobody knows. Defaulting it to `'agency'` would have\n// been a guess routed to a real support queue — the host can decide what to\n// do with \"unknown\" far better than this screen can invent an answer.\n\nimport type { ReactNode } from 'react';\nimport { useCapabilities } from '../../core/hooks/useCapabilities.js';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport type PlanLockedReason = 'agency' | 'partner-ceiling';\n\nexport interface PlanLockedScreenProps {\n /** The capability this route was headed for. Read for its own triple\n * only — never exhaustively switched on (`§6` point 5's open-set rule). */\n readonly capabilityKey: string;\n /** The host's own upsell/support flow — Kaafil has no in-product upgrade\n * path to hand off to. `undefined` means the wire did not say which\n * queue this belongs in; see this file's header. */\n readonly onUpgradeRequest: (reason: PlanLockedReason | undefined) => void;\n /** Supplied by the caller when it saw a refusal that named one. */\n readonly reason?: PlanLockedReason;\n readonly components?: { readonly PlanLockedScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function PlanLockedScreen({\n capabilityKey,\n onUpgradeRequest,\n reason,\n components,\n style,\n}: PlanLockedScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const capabilities = useCapabilities([capabilityKey]);\n const Override = components?.PlanLockedScreenUI;\n if (Override !== undefined) return <Override />;\n\n // Read, never re-derived: `status` is resolved once in `/core` and this\n // screen reads it rather than recombining the booleans itself\n // (`06-capability-and-personas.md §6` point 2).\n const status = capabilities.get(capabilityKey)?.status;\n\n return (\n <SystemScreenFrame\n block=\"kf-plan-locked-screen\"\n title={t('chrome.systemScreens.planLocked.title')}\n body={\n <>\n <p>\n {t(\n reason === 'partner-ceiling'\n ? 'chrome.systemScreens.planLocked.bodyPartnerCeiling'\n : 'chrome.systemScreens.planLocked.body',\n )}\n </p>\n {/* A route that reached this screen for a capability that is NOT\n * flag-dark is a caller bug, and saying so beats rendering upsell\n * copy over a module that is merely data-dark or simply lit. */}\n {status === 'flag-dark' ? null : (\n <p data-tone=\"warn\">{t('chrome.systemScreens.planLocked.notFlagDark')}</p>\n )}\n </>\n }\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n onClick={() => onUpgradeRequest(reason)}\n >\n {t('chrome.systemScreens.planLocked.action')}\n </button>\n }\n />\n );\n}\n","'use client';\n\n// `shared/01-system-screens.md §SessionExpiredScreen`.\n//\n// Renders exactly when `useSession().status === 'expired'` — the open\n// credential's silent refresh has exhausted itself. Re-authentication is\n// routed through the HOST's own login; Kaafil has no login page to redirect\n// to, which is why `onReauthenticate` is required and has no default.\n//\n// DOES NOT retry any token call itself. A broken credential means the\n// host's own user is not authenticated and must re-authenticate through the\n// host's own flow — obtaining fresh tokens is `SessionShell`'s concern on\n// the NEXT successful mount, not this screen's on the current broken one.\n//\n// DOES NOT inspect which credential kind expired beyond the resolved\n// persona (`00-decisions.md` U-003 forecloses reading a JWT at any layer\n// above `SessionShell`).\n\nimport type { ReactNode } from 'react';\nimport { useState } from 'react';\nimport { useKaafilChrome } from '../../core/shells/I18nShell.js';\nimport type { KaafilTokenOverrides } from '../../primitives/internal/tokenStyle.js';\nimport { SystemScreenFrame } from './internal/SystemScreenFrame';\n\nexport interface SessionExpiredScreenProps {\n /** The host's own re-auth entry point. Required: there is no default\n * action, because Kaafil has no login page of its own. */\n readonly onReauthenticate: (returnTo?: string) => void | Promise<void>;\n /** Threaded back to `onReauthenticate` UNEXAMINED. This screen never\n * interprets it, builds a URL from it, or hands it to a router — it\n * exists purely so the host's own flow can restore the right destination\n * afterwards. */\n readonly returnTo?: string;\n readonly components?: { readonly SessionExpiredScreenUI?: () => ReactNode };\n readonly style?: KaafilTokenOverrides;\n}\n\nexport function SessionExpiredScreen({\n onReauthenticate,\n returnTo,\n components,\n style,\n}: SessionExpiredScreenProps): ReactNode {\n const { t } = useKaafilChrome();\n const [pending, setPending] = useState(false);\n // The host's own auth failure reason is not something Kaafil can\n // classify, so the rejection's own message is shown verbatim.\n const [failure, setFailure] = useState<string | undefined>(undefined);\n\n const Override = components?.SessionExpiredScreenUI;\n if (Override !== undefined) return <Override />;\n\n async function reauthenticate(): Promise<void> {\n setPending(true);\n setFailure(undefined);\n try {\n await onReauthenticate(returnTo);\n } catch (error) {\n setFailure(error instanceof Error ? error.message : String(error));\n } finally {\n setPending(false);\n }\n }\n\n return (\n <SystemScreenFrame\n block=\"kf-session-expired-screen\"\n title={t('chrome.systemScreens.sessionExpired.title')}\n body={<p>{t('chrome.systemScreens.sessionExpired.body')}</p>}\n {...(failure !== undefined ? { banner: <span data-tone=\"warn\">{failure}</span> } : {})}\n {...(style !== undefined ? { style } : {})}\n actions={\n <button\n type=\"button\"\n className=\"kf-system-screen__primary\"\n disabled={pending}\n onClick={() => void reauthenticate()}\n >\n {t(\n pending\n ? 'chrome.systemScreens.sessionExpired.busy'\n : 'chrome.systemScreens.sessionExpired.action',\n )}\n </button>\n }\n />\n );\n}\n"]}
|