@alfadocs/ui-kit-debug 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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/brand/product-lockup/product-lockup.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Logo } from '../../components/logo/logo';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\n// Outer lockup row. ~4px logical gap between the wordmark and the product\n// name (`--spacing-xs`), centre-aligned so the name's cap height sits\n// against the wordmark's letterforms.\nconst lockup = cva('ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]');\n\n// The product name. Marketing serif (Fraunces, `--font-serif`) — permitted\n// here because this file lives under `src/brand/`, never in `src/components/`\n// or `src/patterns/` (constraint 10). Sized to ~95% of the wordmark height so\n// its cap height matches the logo letterforms across every size and theme\n// (the `--logo-size-*` tokens shift up in the accessible themes; the calc\n// keeps the name proportional for free).\nconst productName = cva(\n [\n 'ds:[font-family:var(--font-serif)]',\n 'ds:font-semibold',\n 'ds:leading-none',\n 'ds:tracking-[0.01em]',\n 'ds:whitespace-nowrap',\n // Forced-colors: drop the transparent text-fill and paint the label\n // as solid CanvasText so it never disappears under Windows HCM —\n // a gradient/transparent fill has no meaning there.\n 'ds:forced-colors:text-[CanvasText]',\n 'ds:forced-colors:[-webkit-text-fill-color:CanvasText]',\n ],\n {\n variants: {\n size: {\n sm: 'ds:text-[calc(var(--logo-size-sm)*0.95)]',\n md: 'ds:text-[calc(var(--logo-size-md)*0.95)]',\n lg: 'ds:text-[calc(var(--logo-size-lg)*0.95)]',\n xl: 'ds:text-[calc(var(--logo-size-xl)*0.95)]',\n },\n tone: {\n // Brand gradient filled into the glyphs via background-clip:text.\n // `--gradient-wordmark` rides the theme aliases, so it stays\n // AA-safe and adapts per theme on its own (and flattens to a solid\n // ink in the accessible / forced-colors blocks — see tokens).\n gradient: [\n 'ds:italic',\n 'ds:bg-[image:var(--gradient-wordmark)]',\n 'ds:bg-clip-text',\n 'ds:text-transparent',\n 'ds:[-webkit-text-fill-color:transparent]',\n ],\n // Monochrome: solid `--foreground` ink, upright, no gradient — for\n // print, single-colour reproductions, and constrained contexts.\n solid: 'ds:text-[color:var(--foreground)]',\n },\n },\n defaultVariants: { size: 'md', tone: 'gradient' },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ntype LockupSize = NonNullable<VariantProps<typeof productName>['size']>;\n\nexport type ProductLockupProps = {\n /**\n * The product name paired with the Alfadocs wordmark — e.g. `\"Builders\"`\n * renders as \"Alfadocs Builders\". Passed verbatim (product names are not\n * translated); the lockup's accessible name becomes `Alfadocs <name>`.\n */\n name: string;\n /**\n * Render the name as a solid `--foreground` ink, upright (no gradient, no\n * italic), and pair it with the monochrome wordmark. Use for print,\n * single-colour reproductions, or any constrained context where the\n * gradient/serif treatment is inappropriate.\n */\n monochrome?: boolean;\n /** Lockup size. Drives both the wordmark and the name's cap height. */\n size?: LockupSize;\n className?: string;\n} & Omit<\n ComponentPropsWithoutRef<'span'>,\n 'role' | 'aria-label' | 'aria-hidden' | 'children' | 'className'\n>;\n\n/* ------------------------------------------------------------------ */\n/* ProductLockup */\n/* ------------------------------------------------------------------ */\n\n/**\n * The standard lockup pairing the Alfadocs wordmark with a product name\n * (\"Alfadocs Builders\", \"Alfadocs MyApp\"). Every marketplace app should use\n * this rather than hand-rolling a wordmark + typed span.\n *\n * The whole lockup is exposed to assistive tech as a single `img` named\n * `Alfadocs <name>`; the inner wordmark and the visible name are both\n * decorative so the brand isn't announced twice.\n */\nexport const ProductLockup = forwardRef<HTMLSpanElement, ProductLockupProps>(\n ({ name, monochrome = false, size = 'md', className, ...props }, ref) => {\n if (import.meta.env.DEV && !name.trim()) {\n console.warn(\n '[ProductLockup] `name` is empty — the lockup will render the bare wordmark with no product name. Pass the product name (e.g. \"Builders\").',\n );\n }\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={`Alfadocs ${name}`.trim()}\n className={lockup({ className })}\n data-component=\"product-lockup\"\n {...props}\n >\n <Logo\n variant={monochrome ? 'monochrome' : 'wordmark'}\n size={size}\n decorative\n />\n <span\n aria-hidden\n className={productName({\n size,\n tone: monochrome ? 'solid' : 'gradient',\n })}\n >\n {name}\n </span>\n </span>\n );\n },\n);\nProductLockup.displayName = 'ProductLockup';\n"],"names":["lockup","cva","productName","ProductLockup","forwardRef","name","monochrome","size","className","props","ref","jsxs","jsx","Logo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAMA,IAASC,EAAI,2DAA2D,GAQxEC,IAAcD;AAAA,EAClB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,QAKJ,UAAU;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA;AAAA;AAAA,QAIF,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB,EAAE,MAAM,MAAM,MAAM,WAAA;AAAA,EAAW;AAEpD,GA2CaE,IAAgBC;AAAA,EAC3B,CAAC,EAAE,MAAAC,GAAM,YAAAC,IAAa,IAAO,MAAAC,IAAO,MAAM,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAQ7D,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,MAAK;AAAA,MACL,cAAY,YAAYL,CAAI,GAAG,KAAA;AAAA,MAC/B,WAAWL,EAAO,EAAE,WAAAQ,GAAW;AAAA,MAC/B,kBAAe;AAAA,MACd,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAG;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,SAASP,IAAa,eAAe;AAAA,YACrC,MAAAC;AAAA,YACA,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAEZ,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAW;AAAA,YACX,WAAWV,EAAY;AAAA,cACrB,MAAAK;AAAA,cACA,MAAMD,IAAa,UAAU;AAAA,YAAA,CAC9B;AAAA,YAEA,UAAAD;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;AACAF,EAAc,cAAc;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/marketplace-app-shell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,GACd,MAAM,yBAAyB,CAAC"}
@@ -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 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace-app-shell.d.ts","sourceRoot":"","sources":["../../../src/patterns/marketplace-app-shell/marketplace-app-shell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkB7D,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAUlC,MAAM,WAAW,kBAAkB;IACjC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