@alfadocs/ui-kit 0.35.0 → 0.36.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.
@@ -0,0 +1,3 @@
1
+ export { MarketplaceAppShell, ConnectWithAlfadocs, } from './marketplace-app-shell';
2
+ export type { MarketplaceAppShellProps, MarketplaceAppShellLabels, MarketplaceAppUser, MarketplaceNavItem, ConnectWithAlfadocsProps, ConnectStatus, } from './marketplace-app-shell';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { C as l, M as o } from "../../_chunks/marketplace-app-shell-DXHxy9dj.js";
2
+ export {
3
+ l as ConnectWithAlfadocs,
4
+ o as MarketplaceAppShell
5
+ };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Marketplace App Shell — the standard chrome for an app built on top of
3
+ * AlfaDocs (the kind a partner scaffolds with Claude Code, Lovable, etc.).
4
+ *
5
+ * It is a thin, opinionated composition of kit primitives: an `AppFrame` with
6
+ * a branded `Header` (the `ProductLockup` "Alfadocs <Product>"), a `Sidebar`
7
+ * for app navigation, and an account menu with sign-out. `ConnectWithAlfadocs`
8
+ * is the matching pre-auth screen.
9
+ *
10
+ * Like `PatientShell`, this pattern ships a RUNTIME component (surfaced via
11
+ * `src/patterns/index.ts` and the library bundle) because consuming apps mount
12
+ * it in production rather than copying the source.
13
+ *
14
+ * Auth is intentionally decoupled: the shell takes the signed-in `user` and an
15
+ * `onSignOut` callback as props, and `ConnectWithAlfadocs` takes a `status` +
16
+ * `onConnect`. Wire them to `@alfadocs/auth/react`'s `useAlfadocsAuth()` in the
17
+ * consuming app — the kit never touches OAuth or secrets (those live in the
18
+ * server-side `@alfadocs/auth` BFF).
19
+ *
20
+ * All user-visible copy is consumer-provided (props) so each app localises in
21
+ * its own i18n; the only kit-owned strings reuse existing translated `ui.*`
22
+ * keys (sidebar label, skip link, menu button).
23
+ */
24
+ import { type ReactNode } from 'react';
25
+ import { type SidebarMode } from '../../components/sidebar';
26
+ export interface MarketplaceNavItem {
27
+ id: string;
28
+ /** Pre-translated label — apps localise their own nav copy. */
29
+ label: string;
30
+ href: string;
31
+ /** Optional leading icon (a lucide-react element or equivalent). */
32
+ icon?: ReactNode;
33
+ /** Optional unseen-item count rendered as a pill badge. */
34
+ badgeCount?: number;
35
+ /** Mark the item as the current page (`aria-current='page'`). */
36
+ isActive?: boolean;
37
+ }
38
+ export interface MarketplaceAppUser {
39
+ /** Display name — drives the avatar initials + the account-menu header. */
40
+ name: string;
41
+ /** Optional email shown under the name in the account menu. */
42
+ email?: string;
43
+ /** Optional avatar image URL. */
44
+ avatarSrc?: string;
45
+ }
46
+ export interface MarketplaceAppShellLabels {
47
+ /** Accessible name for the account-menu trigger, e.g. "Account menu". */
48
+ accountMenu: string;
49
+ /** The sign-out menu item, e.g. "Sign out". */
50
+ signOut: string;
51
+ /**
52
+ * Optional fullscreen menu item, e.g. "Toggle fullscreen". When omitted (or
53
+ * `onToggleFullscreen` is not supplied) the item is not rendered.
54
+ */
55
+ fullscreen?: string;
56
+ }
57
+ export interface MarketplaceAppShellProps {
58
+ /** Product name paired with the Alfadocs wordmark — renders "Alfadocs <productName>". */
59
+ productName: string;
60
+ /** Link target for the brand lockup. Default `'/'`. */
61
+ productHref?: string;
62
+ /** Sidebar nav items, in order. */
63
+ nav: MarketplaceNavItem[];
64
+ /** The signed-in user shown in the account menu. */
65
+ user: MarketplaceAppUser;
66
+ /** Consumer-localised chrome labels owned by the shell. */
67
+ labels: MarketplaceAppShellLabels;
68
+ /** Fires when the user picks "Sign out". Wire to `useAlfadocsAuth().signOut`. */
69
+ onSignOut?: () => void;
70
+ /** Fires when the user toggles fullscreen. Omit to hide the fullscreen item. */
71
+ onToggleFullscreen?: () => void;
72
+ /**
73
+ * Force the sidebar into a specific mode. Apps typically flip to `'overlay'`
74
+ * on narrow viewports and leave this undefined elsewhere (defaults to
75
+ * `'expanded'`).
76
+ */
77
+ sidebarState?: SidebarMode;
78
+ /** Override the accessible name of the `<main>` landmark. */
79
+ mainAriaLabel?: string;
80
+ /** Children render inside the main content region. */
81
+ children: ReactNode;
82
+ }
83
+ export declare const MarketplaceAppShell: import("react").ForwardRefExoticComponent<MarketplaceAppShellProps & import("react").RefAttributes<HTMLDivElement>>;
84
+ export type ConnectStatus = 'idle' | 'connecting' | 'error';
85
+ export interface ConnectWithAlfadocsProps {
86
+ /** Product name for the lockup at the top of the card. */
87
+ productName: string;
88
+ /** Heading, e.g. "Connect your AlfaDocs account". */
89
+ title: string;
90
+ /** Supporting copy below the heading. */
91
+ description: ReactNode;
92
+ /** The connect button label, e.g. "Connect with AlfaDocs". */
93
+ connectLabel: string;
94
+ /** Connection lifecycle. `connecting` shows a loading button; `error` shows the alert. */
95
+ status?: ConnectStatus;
96
+ /** Error message shown (as an alert) when `status === 'error'`. */
97
+ error?: ReactNode;
98
+ /** Fires when the connect button is pressed. Wire to `useAlfadocsAuth().connect`. */
99
+ onConnect?: () => void;
100
+ /** Optional footer content below the button (e.g. a "what's this?" link). */
101
+ footer?: ReactNode;
102
+ className?: string;
103
+ }
104
+ /**
105
+ * The pre-auth "Connect with AlfaDocs" screen. Centred card with the product
106
+ * lockup, copy, an error slot, and the primary connect CTA. Presentational —
107
+ * `onConnect` should call `useAlfadocsAuth().connect()`, which redirects the
108
+ * browser to the server-side BFF that runs the real OAuth2 + PKCE flow.
109
+ */
110
+ export declare const ConnectWithAlfadocs: import("react").ForwardRefExoticComponent<ConnectWithAlfadocsProps & import("react").RefAttributes<HTMLDivElement>>;
111
+ //# sourceMappingURL=marketplace-app-shell.d.ts.map