@ai-matrx/design-system 0.1.0 → 0.2.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,"sources":["../src/cn.ts","../src/badge.tsx","../src/button.tsx","../src/label.tsx","../src/separator.tsx"],"names":["cva","jsx","React2","React3"],"mappings":";;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACAO,IAAM,aAAA,GAAgB,GAAA;AAAA,EAC3B,sKAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,+CAAA;AAAA,QACT,SAAA,EAAW,2DAAA;AAAA,QACX,WAAA,EAAa,uDAAA;AAAA,QACb,OAAA,EAAS,+BAAA;AAAA,QACT,OAAA,EAAS,+CAAA;AAAA,QACT,OAAA,EAAS,+CAAA;AAAA,QACT,IAAA,EAAM,2CAAA;AAAA,QACN,KAAA,EAAO,iEAAA;AAAA,QACP,OAAA,EAAS;AAAA;AACX,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ;AAMO,SAAS,MAAM,EAAE,SAAA,EAAW,OAAA,EAAS,GAAG,OAAM,EAAe;AAClE,EAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,CAAA,EAAG,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAChF;ACzBO,IAAM,cAAA,GAAiBA,GAAAA;AAAA,EAC5B,gXAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,kEAAA;AAAA,QACT,WAAA,EACE,8EAAA;AAAA,QACF,OAAA,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AAA,CAG7B,CAAC,EAAE,SAAA,EAAW,WAAA,GAAc,YAAA,EAAc,UAAA,GAAa,IAAA,EAAM,GAAG,KAAA,EAAM,EAAG,wBACzEF,GAAAA;AAAA,EAAoB,kBAAA,CAAA,IAAA;AAAA,EAAnB;AAAA,IACC,GAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,oBAAA;AAAA,MACA,WAAA,KAAgB,eAAe,aAAA,GAAgB,aAAA;AAAA,MAC/C;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,SAAA,CAAU,cAAiC,kBAAA,CAAA,IAAA,CAAK,WAAA","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary/15 text-primary\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground\",\n destructive: \"border-transparent bg-destructive/15 text-destructive\",\n outline: \"border-border text-foreground\",\n success: \"border-transparent bg-success/15 text-success\",\n warning: \"border-transparent bg-warning/15 text-warning\",\n info: \"border-blue-200 bg-blue-100 text-blue-800\",\n error: \"border-transparent bg-red-500/15 text-red-700 dark:text-red-400\",\n neutral: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({ className, variant, ...props }: BadgeProps) {\n return <span className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-6\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","\"use client\";\n\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className,\n )}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n","\"use client\";\n\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n"]}
1
+ {"version":3,"sources":["../src/badge.tsx","../src/cn.ts","../src/bottom-sheet.tsx","../src/icons.tsx","../src/radix-dialog-modal-context.tsx","../src/button.tsx","../src/editable-label.tsx","../src/input.tsx","../src/label.tsx","../src/overflow-toolbar.tsx","../src/popover.tsx","../src/portal-container.tsx","../src/score-ring.tsx","../src/segmented-control.tsx","../src/separator.tsx","../src/sheet.tsx","../src/skeleton.tsx","../src/tabbed-bottom-sheet.tsx","../src/use-scroll-fade.ts"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary/15 text-primary\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground\",\n destructive: \"border-transparent bg-destructive/15 text-destructive\",\n outline: \"border-border text-foreground\",\n success: \"border-transparent bg-success/15 text-success\",\n warning: \"border-transparent bg-warning/15 text-warning\",\n info: \"border-blue-200 bg-blue-100 text-blue-800\",\n error: \"border-transparent bg-red-500/15 text-red-700 dark:text-red-400\",\n neutral: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({ className, variant, ...props }: BadgeProps) {\n return <span className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * BottomSheet — the canonical mobile sheet. Ported verbatim from\n * matrx-frontend `components/official/bottom-sheet/BottomSheet.tsx` (S19).\n *\n * `vaul` is a sanctioned real dependency here, the same way\n * @radix-ui/react-alert-dialog is for @ai-matrx/kit `/confirm`: the drag-to-\n * dismiss drawer physics IS the component — there is no BottomSheet without\n * it, and reimplementing gesture/velocity handling would be a vendored twin\n * of a maintained library rather than of our own code. Rationale recorded in\n * FEATURE.md.\n *\n * Seam inversions:\n * - The host's `components/ui/drawer.tsx` wrappers are inlined as private\n * equivalents with identical behavior (thin over vaul + the shared\n * RadixDialogModalProvider); the host keeps its own drawer module for its\n * other drawer surfaces.\n * - `ChevronLeft` is the package's inlined SVG (C19).\n *\n * Host-owned CSS contracts (documented, not shipped): the glass tokens\n * `--matrx-glass-bg` / `--matrx-glass-border-color`, the utility classes\n * `matrx-glass-thin-border` and `pb-safe`, and semantic color tokens.\n */\n\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { ChevronLeftIcon } from \"./icons\";\nimport { RadixDialogModalProvider } from \"./radix-dialog-modal-context\";\n\ntype DrawerRootProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n /** Vaul does not forward false to its underlying Radix root. */\n modal?: true;\n};\n\nconst DrawerRoot = ({\n children,\n shouldScaleBackground = true,\n ...props\n}: DrawerRootProps) => (\n <RadixDialogModalProvider modal>\n <DrawerPrimitive.Root\n modal\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n >\n {children}\n </DrawerPrimitive.Root>\n </RadixDialogModalProvider>\n);\nDrawerRoot.displayName = \"DrawerRoot\";\n\n/**\n * Unstyled, non-portalling Content for custom Drawer layouts. It derives\n * explicit modal semantics while Vaul retains focus/background behavior.\n */\nconst DrawerContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ ...props }, ref) => (\n <DrawerPrimitive.Content {...props} ref={ref} aria-modal=\"true\" />\n));\nDrawerContentPrimitive.displayName = \"DrawerContentPrimitive\";\n\nexport interface BottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title?: string;\n /**\n * `adaptive` (default) — the sheet sizes to its content between 60dvh and\n * 90dvh. Correct for a single short list.\n *\n * `full` — ONE fixed height (92dvh) that never changes as content changes.\n * Use it for any sheet whose body varies (multi-level navigation, tabs,\n * search results): an adaptive sheet there resizes under the user's thumb\n * on every keystroke and every drill-in, which reads as the panel jumping.\n */\n size?: \"adaptive\" | \"full\";\n /** Visual treatment for the panel. Solid is intended for dense, long-lived surfaces. */\n surface?: \"glass\" | \"solid\";\n /** Merged onto the sheet panel. */\n contentClassName?: string;\n children: React.ReactNode;\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n title = \"Bottom Sheet\",\n size = \"adaptive\",\n surface = \"glass\",\n contentClassName,\n children,\n}: BottomSheetProps) {\n return (\n <DrawerRoot open={open} onOpenChange={onOpenChange}>\n <DrawerPrimitive.Portal>\n {/* Identical output to the host's DrawerOverlay wrapper: its base\n classes merged with the caller classes, inline background wins. */}\n <DrawerPrimitive.Overlay\n className={cn(\"fixed inset-0 z-50 bg-black/80\", \"fixed inset-0 z-50\")}\n style={{ background: \"rgba(0, 0, 0, 0.08)\" }}\n />\n <DrawerContentPrimitive\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex flex-col rounded-t-2xl overflow-hidden\",\n size === \"full\" ? \"h-[92dvh]\" : \"min-h-[60dvh] max-h-[90dvh]\",\n surface === \"solid\" &&\n \"border border-b-0 border-border bg-background shadow-2xl\",\n contentClassName,\n )}\n style={\n surface === \"glass\"\n ? {\n background: \"var(--matrx-glass-bg)\",\n backdropFilter: \"blur(20px) saturate(180%)\",\n WebkitBackdropFilter: \"blur(20px) saturate(180%)\",\n border: \"1px solid var(--matrx-glass-border-color)\",\n borderBottom: \"none\",\n }\n : undefined\n }\n >\n <VisuallyHidden>\n <DrawerPrimitive.Title>{title}</DrawerPrimitive.Title>\n <DrawerPrimitive.Description>\n Bottom sheet panel.\n </DrawerPrimitive.Description>\n </VisuallyHidden>\n <div className=\"mx-auto mt-3 mb-1 h-1.5 w-10 rounded-full bg-muted-foreground/30 flex-shrink-0\" />\n {children}\n </DrawerContentPrimitive>\n </DrawerPrimitive.Portal>\n </DrawerRoot>\n );\n}\n\nexport interface BottomSheetHeaderProps {\n title: string;\n showBack?: boolean;\n onBack?: () => void;\n trailing?: React.ReactNode;\n}\n\nexport function BottomSheetHeader({\n title,\n showBack = false,\n onBack,\n trailing,\n}: BottomSheetHeaderProps) {\n return (\n <div className=\"flex items-center px-2 pt-1 pb-2 flex-shrink-0 min-h-[44px]\">\n <div className=\"min-w-[44px] flex items-center justify-start\">\n <button\n onClick={onBack}\n className={cn(\n \"h-8 w-8 rounded-full matrx-glass-thin-border flex items-center justify-center transition-all active:scale-95\",\n showBack ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n aria-hidden={!showBack}\n tabIndex={showBack ? 0 : -1}\n >\n <ChevronLeftIcon className=\"h-4 w-4 text-foreground\" />\n </button>\n </div>\n <span className=\"text-[17px] font-semibold flex-1 text-center truncate\">\n {title}\n </span>\n <div className=\"min-w-[44px] flex items-center justify-end\">\n {trailing}\n </div>\n </div>\n );\n}\n\nexport interface BottomSheetBodyProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetBody({ children, className }: BottomSheetBodyProps) {\n return (\n <div\n className={cn(\n // min-h-0 is load-bearing: without it a flex child's min-height:auto\n // floors it at content height and the body grows instead of scrolling.\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain pb-safe\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport interface BottomSheetFooterProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetFooter({\n children,\n className,\n}: BottomSheetFooterProps) {\n return (\n <div\n className={cn(\n \"flex-shrink-0 px-4 py-3 pb-safe border-t border-white/[0.06]\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","/**\n * Internal inlined SVG icons (policy C19: no icon-library dependency, ever).\n *\n * Each icon is copied from the exact glyph the ported originals rendered:\n * lucide-react's Loader2 / ChevronLeft / ChevronRight / MoreHorizontal and\n * @radix-ui/react-icons' Cross2Icon. Same viewBoxes, same paths, same default\n * stroke geometry — a host swapping the import sees pixel-identical output.\n *\n * Not exported from the package entry; components consume them directly.\n */\n\nimport * as React from \"react\";\n\ntype IconProps = React.SVGAttributes<SVGSVGElement>;\n\nfunction lucideProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** lucide `loader-2` — the spinner glyph. Callers add `animate-spin`. */\nexport function Loader2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n/** lucide `chevron-left`. */\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-right`. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `more-horizontal` — the kebab/ellipsis glyph. */\nexport function MoreHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `Cross2Icon` — the dialog/sheet close glyph. */\nexport function Cross2Icon(props: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n aria-hidden\n {...props}\n >\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n","\"use client\";\n\n/**\n * Ported verbatim from matrx-frontend `components/ui/radix-dialog-modal-context.tsx`.\n * Shared by the Sheet and BottomSheet families (and available to hosts that\n * compose their own Radix Dialog-derived wrappers around these primitives).\n */\n\nimport * as React from \"react\";\n\nconst RadixDialogModalContext = React.createContext(true);\n\nexport interface RadixDialogModalProviderProps {\n children: React.ReactNode;\n modal: boolean;\n}\n\n/**\n * Keeps our Radix-based content wrappers aligned with the owning Root's\n * modality so ARIA semantics cannot drift from focus/pointer behavior.\n */\nexport function RadixDialogModalProvider({\n children,\n modal,\n}: RadixDialogModalProviderProps) {\n return (\n <RadixDialogModalContext.Provider value={modal}>\n {children}\n </RadixDialogModalContext.Provider>\n );\n}\n\n/** Returns whether the nearest Radix Dialog-derived root is modal. */\nexport function useRadixDialogModal(): boolean {\n return React.useContext(RadixDialogModalContext);\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-6\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","\"use client\";\n\n/**\n * EditableLabel — inline rename-in-place text.\n *\n * Ported verbatim from matrx-frontend\n * `components/official/item/EditableLabel.tsx` (S16). Commit on Enter/blur,\n * Esc cancels, whitespace-only falls back to `emptyFallback` (or cancels),\n * stays in sync with upstream `value` while not editing. Decoupled from any\n * store — `onCommit(next)` is the only side-effect channel.\n *\n * Three activation modes:\n * - \"click\" → click the display text to edit (header titles)\n * - \"doubleClick\" → double-click to edit (rows where single-click selects)\n * - \"controlled\" → host owns `editing`; this renders ONLY the input while\n * editing (the host renders its own display element)\n *\n * Seam inversions:\n * - Prop types come with the component instead of the host's item-system\n * `types.ts` (identical shapes).\n * - The lucide `Loader2` busy spinner is the package's inlined SVG (C19).\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { cn } from \"./cn\";\nimport { Loader2Icon } from \"./icons\";\n\nexport type EditableLabelCommitMode = \"optimistic\" | \"await\";\nexport type EditableLabelActivation = \"click\" | \"doubleClick\" | \"controlled\";\n\nexport interface EditableLabelProps {\n value: string;\n /**\n * Commit handler. optimistic (default): edit mode exits immediately, the\n * promise is fire-and-forget (owners do optimistic update + revert + toast).\n * await: input disables with a spinner until the promise resolves; a\n * rejection keeps edit mode open to retry.\n */\n onCommit: (next: string) => void | Promise<void>;\n commitMode?: EditableLabelCommitMode;\n /** Return an error message to block the commit (shown under the input). */\n validate?: (next: string) => string | null;\n /** Used when the trimmed draft is empty. Undefined → empty cancels. */\n emptyFallback?: string;\n maxLength?: number; // default 120\n /**\n * \"click\"/\"doubleClick\" — internal edit state (headers). \"controlled\" — host\n * owns `editing`; EditableLabel renders ONLY the input when editing.\n */\n activation?: EditableLabelActivation;\n editing?: boolean; // controlled mode\n /** Edit-state notifications. Controlled mode: the ONLY state channel.\n * Uncontrolled modes: fired as a notification (layout hooks etc.). */\n onEditingChange?: (editing: boolean) => void;\n selectOnEdit?: boolean; // default true\n placeholder?: string;\n /** Accessible name, e.g. \"Session title\". Default \"Name\". */\n ariaLabel?: string;\n truncate?: boolean; // display mode, default true\n className?: string; // both modes\n displayClassName?: string;\n inputClassName?: string;\n}\n\nexport function EditableLabel({\n value,\n onCommit,\n commitMode = \"optimistic\",\n validate,\n emptyFallback,\n maxLength = 120,\n activation = \"click\",\n editing: editingProp,\n onEditingChange,\n selectOnEdit = true,\n placeholder,\n ariaLabel = \"Name\",\n truncate = true,\n className,\n displayClassName,\n inputClassName,\n}: EditableLabelProps) {\n const controlled = activation === \"controlled\";\n const [internalEditing, setInternalEditing] = useState(false);\n const editing = controlled ? !!editingProp : internalEditing;\n\n const [draft, setDraft] = useState(value);\n const [error, setError] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n // Stay in sync with upstream changes (realtime / auto-label) while idle.\n useEffect(() => {\n if (!editing) setDraft(value);\n }, [value, editing]);\n\n // Focus + select on entering edit mode.\n useEffect(() => {\n if (editing && inputRef.current) {\n inputRef.current.focus();\n if (selectOnEdit) inputRef.current.select();\n }\n }, [editing, selectOnEdit]);\n\n const setEditing = useCallback(\n (next: boolean) => {\n if (controlled) {\n onEditingChange?.(next);\n } else {\n // Uncontrolled hosts still get notified — lets them adjust layout\n // (e.g. widen the edit box) without taking over the edit state.\n setInternalEditing(next);\n onEditingChange?.(next);\n }\n },\n [controlled, onEditingChange],\n );\n\n const startEdit = useCallback(() => {\n setDraft(value);\n setError(null);\n setEditing(true);\n }, [value, setEditing]);\n\n const cancel = useCallback(() => {\n setDraft(value);\n setError(null);\n setBusy(false);\n setEditing(false);\n }, [value, setEditing]);\n\n const commit = useCallback(() => {\n if (busy) return;\n const trimmed = draft.trim();\n const next = trimmed || emptyFallback;\n\n // Empty + no fallback → cancel rather than commit garbage.\n if (next === undefined) {\n cancel();\n return;\n }\n\n const validationError = validate?.(next) ?? null;\n if (validationError) {\n setError(validationError);\n return;\n }\n\n // No-op commit — skip the side effect entirely.\n if (next === value) {\n setEditing(false);\n setError(null);\n return;\n }\n\n if (commitMode === \"await\") {\n const result = onCommit(next);\n if (result instanceof Promise) {\n setBusy(true);\n result\n .then(() => {\n setBusy(false);\n setEditing(false);\n })\n .catch(() => {\n // Keep edit mode open so the user can retry.\n setBusy(false);\n });\n return;\n }\n setEditing(false);\n return;\n }\n\n // optimistic — exit immediately, fire-and-forget.\n setEditing(false);\n setError(null);\n const result = onCommit(next);\n if (result instanceof Promise) result.catch(() => {});\n }, [\n busy,\n draft,\n emptyFallback,\n validate,\n value,\n commitMode,\n onCommit,\n cancel,\n setEditing,\n ]);\n\n if (editing) {\n return (\n <span className={cn(\"relative flex min-w-0 flex-1 items-center\", className)}>\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n disabled={busy}\n placeholder={placeholder}\n onChange={(e) => {\n setDraft(e.target.value);\n if (error) setError(null);\n }}\n onBlur={commit}\n onClick={(e) => e.stopPropagation()}\n onDoubleClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n // Contain editing keystrokes so host rows / global hotkeys stay quiet.\n if (e.key === \"Enter\") {\n e.preventDefault();\n e.stopPropagation();\n commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n cancel();\n } else if (e.key === \" \") {\n e.stopPropagation();\n }\n }}\n maxLength={maxLength}\n aria-label={ariaLabel}\n aria-invalid={error ? true : undefined}\n // 16px on mobile prevents iOS focus-zoom; sm on desktop.\n className={cn(\n \"w-full min-w-0 rounded-sm bg-transparent px-1 outline-none\",\n \"text-base md:text-sm\",\n \"focus:bg-background focus:ring-1 focus:ring-ring\",\n busy && \"opacity-60\",\n inputClassName,\n )}\n />\n {busy && (\n <Loader2Icon className=\"absolute right-1 h-3.5 w-3.5 animate-spin text-muted-foreground\" />\n )}\n {error && (\n <span className=\"absolute left-0 top-full mt-0.5 whitespace-nowrap text-xs text-destructive\">\n {error}\n </span>\n )}\n </span>\n );\n }\n\n // Controlled mode: host owns the display; render nothing while idle.\n if (controlled) return null;\n\n return (\n <button\n type=\"button\"\n onClick={\n activation === \"click\"\n ? (e) => {\n e.stopPropagation();\n startEdit();\n }\n : undefined\n }\n onDoubleClick={\n activation === \"doubleClick\"\n ? (e) => {\n e.stopPropagation();\n startEdit();\n }\n : undefined\n }\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.stopPropagation();\n startEdit();\n }\n }}\n title={activation === \"doubleClick\" ? \"Double-click to rename\" : \"Click to rename\"}\n aria-label={`Rename ${ariaLabel.toLowerCase()}: ${value}`}\n className={cn(\n \"min-w-0 max-w-full rounded-sm px-1 text-left transition-colors\",\n \"hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n truncate && \"block truncate\",\n className,\n displayClassName,\n )}\n >\n {value || placeholder || \"\"}\n </button>\n );\n}\n","\"use client\";\n\n/**\n * Input family — ported verbatim from matrx-frontend `components/ui/input.tsx`.\n *\n * Seam inversions:\n * - `MatrxVariant` (host `components/ui/types`) becomes the structural\n * `InputVariant` union with the identical members, so host call sites are\n * drop-in compatible.\n * - The host file's `CopyInput` / `FancyInput` / `DeleteInput` are\n * deliberately NOT absorbed (C8 split-out law): they carry a `motion/react`\n * dependency (and clipboard behavior) that plain-Input consumers must not\n * pay for. They stay host-owned until sanctioned separately.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type InputVariant =\n | \"default\"\n | \"destructive\"\n | \"success\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"link\"\n | \"primary\";\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n variant?: InputVariant;\n}\n\nconst getVariantStyles = (variant: InputVariant = \"default\") => {\n const baseStyles = `flex h-10 w-full border border-border bg-background text-black dark:text-white shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent\n file:text-sm file:font-medium placeholder:text-neutral-400 dark:placeholder-text-neutral-600\n focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-neutral-400 dark:focus-visible:ring-neutral-600\n disabled:cursor-not-allowed disabled:opacity-50\n dark:shadow-[0px_0px_1px_1px_var(--neutral-700)]\n transition duration-400\n [&:-webkit-autofill]:bg-background [&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--background))_inset] [&:-webkit-autofill]:[caret-color:currentColor]\n dark:[&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--background))_inset] dark:[&:-webkit-autofill]:[-webkit-text-fill-color:white]\n [&:-webkit-autofill:hover]:shadow-[0_0_0_1000px_hsl(var(--background))_inset] [&:-webkit-autofill:focus]:shadow-[0_0_0_1000px_hsl(var(--background))_inset]`;\n\n switch (variant) {\n case \"destructive\":\n return `${baseStyles} bg-destructive text-destructive-foreground`;\n case \"outline\":\n return `${baseStyles} border-2`;\n case \"secondary\":\n return `${baseStyles} bg-secondary text-secondary-foreground`;\n case \"ghost\":\n return `${baseStyles} bg-transparent shadow-none`;\n case \"link\":\n return `${baseStyles} bg-transparent underline-offset-4 hover:underline`;\n case \"primary\":\n return `${baseStyles} bg-primary text-primary-foreground`;\n default:\n return baseStyles;\n }\n};\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, variant = \"default\", ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(getVariantStyles(variant), className)}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport interface EnterInputProps extends InputProps {\n onEnter?: () => void;\n}\n\nexport const EnterInput = React.forwardRef<HTMLInputElement, EnterInputProps>(\n ({ onEnter, ...props }, ref) => {\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\" && onEnter) {\n e.preventDefault();\n onEnter();\n }\n };\n\n return (\n <Input\n {...props}\n ref={ref}\n onKeyDown={(e) => {\n handleKeyDown(e);\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n }}\n />\n );\n },\n);\n\nEnterInput.displayName = \"EnterInput\";\n\nexport const BasicInput = React.forwardRef<HTMLInputElement, InputProps>(\n // `variant` is accepted (prop-compatible with Input) but intentionally\n // unused — and destructured so it never leaks onto the DOM element.\n ({ className, type, variant: _variant = \"default\", ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nBasicInput.displayName = \"BasicInput\";\n\nexport interface InputWithPrefixProps extends Omit<InputProps, \"prefix\"> {\n prefix?: React.ReactNode;\n wrapperClassName?: string;\n}\n\nexport const InputWithPrefix = React.forwardRef<\n HTMLInputElement,\n InputWithPrefixProps\n>(({ prefix, className, wrapperClassName, ...props }, ref) => {\n return (\n <div className={cn(\"relative\", wrapperClassName)}>\n {prefix && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {prefix}\n </div>\n )}\n <Input\n ref={ref}\n className={cn(prefix && \"pl-10\", className)}\n {...props}\n />\n </div>\n );\n});\nInputWithPrefix.displayName = \"InputWithPrefix\";\n","\"use client\";\n\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className,\n )}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n","\"use client\";\n\n/**\n * OverflowToolbar — a horizontal row of consistent, compact action buttons\n * that collapses the buttons that don't fit into a single \"more\" (…) menu.\n * Ported verbatim from matrx-frontend\n * `components/official/toolbar/OverflowToolbar.tsx` (S20).\n *\n * ┌───────────────────────────────────────────────┐\n * │ [leading] [Btn] [Btn] [Btn] [ … ] │\n * └───────────────────────────────────────────────┘\n *\n * Design rules (the primitive enforces them so callers can't drift):\n * - Every button is the same height (h-7), padding, text size, icon size.\n * - `hideLabel` renders an icon-only button with a tooltip — use it for\n * \"obvious\" actions (Find, Source, …).\n * - `tone: \"primary\"` colors a button without changing its size, so the\n * primary action is NOT visually larger than the rest.\n * - When the row is too narrow, the LAST actions collapse into the overflow\n * menu first. Order your actions most-important-first.\n *\n * Measurement is done with a hidden \"ghost\" row (always renders every action\n * + the kebab) read via a ResizeObserver, so the visible row never reflows\n * mid-frame.\n *\n * Seam inversions (host-shaped chrome becomes injected):\n * - `icon: LucideIcon` → the structural `ToolbarIcon`\n * (`ComponentType<{ className?: string }>`) — any SVG component fits.\n * - The host Tooltip wrapper → `renderTooltip` prop. Without it, icon-only\n * buttons render bare (they always carry `aria-label`); hosts inject their\n * tooltip system for the original hover behavior.\n * - The host ItemMenu overflow menu → `renderOverflowMenu` prop (required):\n * the host receives the collapsed actions plus the ready-made kebab trigger\n * and renders them with its own menu system.\n */\n\nimport React, { useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"./cn\";\nimport { Loader2Icon, MoreHorizontalIcon } from \"./icons\";\n\nexport type ToolbarActionTone = \"default\" | \"primary\" | \"destructive\";\n\n/** Structural icon contract (a lucide icon satisfies it, so does any SVG component). */\nexport type ToolbarIcon = React.ComponentType<{ className?: string }>;\n\nexport interface ToolbarAction {\n id: string;\n label: string;\n icon: ToolbarIcon;\n /** Click handler. Ignored when `href` is set. */\n onSelect?: () => void;\n /** Renders an anchor instead of a button. */\n href?: string;\n target?: \"_blank\";\n disabled?: boolean;\n /** Swaps the icon for a spinner and (optionally) shows `runningLabel`. */\n running?: boolean;\n runningLabel?: string;\n tone?: ToolbarActionTone;\n /** Icon-only button (tooltip carries the label). For obvious actions. */\n hideLabel?: boolean;\n /** Drop the action entirely. */\n hidden?: boolean;\n}\n\nexport interface OverflowToolbarProps {\n actions: ToolbarAction[];\n /**\n * Optional element pinned at the start of the row — never collapsed, never\n * measured into the action budget except as a fixed prefix (e.g. a surface\n * switcher / context chip cluster).\n */\n leading?: React.ReactNode;\n /** Accessible label for the overflow trigger. */\n overflowAriaLabel?: string;\n className?: string;\n /**\n * Injected overflow-menu seam: render the collapsed actions with the host's\n * menu system, using `trigger` (the ready-made kebab button) as the menu\n * trigger element.\n */\n renderOverflowMenu: (args: {\n actions: ToolbarAction[];\n trigger: React.ReactNode;\n }) => React.ReactNode;\n /**\n * Injected tooltip seam for icon-only buttons (their label lives nowhere\n * else on screen). Omitted → the bare control renders (aria-label intact).\n */\n renderTooltip?: (control: React.ReactElement, label: string) => React.ReactNode;\n}\n\nconst GAP_PX = 6; // gap-1.5\n\n// ── Button ──────────────────────────────────────────────────────────────────\n\nconst TONE: Record<ToolbarActionTone, string> = {\n default: \"border border-border bg-background hover:bg-accent text-foreground\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"border border-destructive/40 text-destructive hover:bg-destructive/10\",\n};\n\nfunction ToolbarButton({\n action,\n enableTooltip = false,\n renderTooltip,\n}: {\n action: ToolbarAction;\n /** Wrap icon-only buttons in a styled tooltip. Off for the ghost row. */\n enableTooltip?: boolean;\n renderTooltip?:\n | ((control: React.ReactElement, label: string) => React.ReactNode)\n | undefined;\n}) {\n const tone = action.tone ?? \"default\";\n const Icon = action.running ? Loader2Icon : action.icon;\n const showLabel =\n !action.hideLabel || (action.running && action.runningLabel);\n const text =\n action.running && action.runningLabel ? action.runningLabel : action.label;\n\n const className = cn(\n \"inline-flex items-center gap-1 h-7 rounded-md text-[11px] font-medium transition-colors whitespace-nowrap\",\n \"disabled:opacity-50 disabled:pointer-events-none\",\n action.hideLabel && !action.running ? \"w-7 justify-center px-0\" : \"px-2\",\n TONE[tone],\n );\n\n const inner = (\n <>\n <Icon\n className={cn(\"w-3.5 h-3.5 shrink-0\", action.running && \"animate-spin\")}\n />\n {showLabel && <span>{text}</span>}\n </>\n );\n\n const control =\n action.href && !action.disabled ? (\n <a\n href={action.href}\n target={action.target}\n rel={action.target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={className}\n aria-label={action.label}\n >\n {inner}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={action.onSelect}\n disabled={action.disabled}\n className={className}\n aria-label={action.label}\n >\n {inner}\n </button>\n );\n\n // Icon-only buttons need a styled tooltip to be discoverable — the label\n // lives nowhere else on screen. Labeled buttons are self-describing.\n if (enableTooltip && action.hideLabel && renderTooltip) {\n return <>{renderTooltip(control, action.label)}</>;\n }\n\n return control;\n}\n\nfunction OverflowTrigger({ ariaLabel }: { ariaLabel: string }) {\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n aria-haspopup=\"menu\"\n title=\"More actions\"\n className={cn(\n \"inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors\",\n \"border border-border bg-background hover:bg-accent text-foreground\",\n )}\n >\n <MoreHorizontalIcon className=\"w-3.5 h-3.5\" />\n </button>\n );\n}\n\n// ── Toolbar ───────────────────────────────────────────────────────────────\n\nexport function OverflowToolbar({\n actions,\n leading,\n overflowAriaLabel = \"More actions\",\n className,\n renderOverflowMenu,\n renderTooltip,\n}: OverflowToolbarProps) {\n const visibleActions = useMemo(\n () => actions.filter((a) => !a.hidden),\n [actions],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n const ghostRef = useRef<HTMLDivElement>(null);\n // The leading slot renders ONCE (in the visible row) — it may host a\n // stateful/data-fetching component, so we never duplicate it into the ghost.\n // Its width is read directly off this ref instead.\n const leadingRef = useRef<HTMLSpanElement>(null);\n const [visibleCount, setVisibleCount] = useState(visibleActions.length);\n\n // Re-measure whenever the rendered text/state of any action changes (label,\n // icon-only mode, or running label all change a button's width).\n const signature = visibleActions\n .map(\n (a) =>\n `${a.id}:${a.hideLabel ? 1 : 0}:${a.running ? 1 : 0}:${a.runningLabel ?? \"\"}:${a.label}`,\n )\n .join(\"|\");\n\n useLayoutEffect(() => {\n const container = containerRef.current;\n const ghost = ghostRef.current;\n if (!container || !ghost) return undefined;\n\n const compute = () => {\n const available = container.clientWidth;\n const n = visibleActions.length;\n const children = Array.from(ghost.children) as HTMLElement[];\n const hasLeading = leading != null;\n const leadingW = hasLeading ? (leadingRef.current?.offsetWidth ?? 0) : 0;\n const itemW = (i: number) => children[i]?.offsetWidth ?? 0;\n const kebabW = children[n]?.offsetWidth ?? 28;\n\n // Width consumed by the always-present leading slot.\n const base = leadingW + (hasLeading && n > 0 ? GAP_PX : 0);\n\n // Does everything fit with no kebab?\n let totalAll = base;\n for (let i = 0; i < n; i++) totalAll += itemW(i) + (i > 0 ? GAP_PX : 0);\n if (totalAll <= available) {\n setVisibleCount(n);\n return;\n }\n\n // Otherwise fit as many as possible while reserving room for the kebab.\n let used = base;\n let count = 0;\n for (let i = 0; i < n; i++) {\n const add = itemW(i) + (count > 0 ? GAP_PX : 0);\n if (used + add + GAP_PX + kebabW <= available) {\n used += add;\n count += 1;\n } else break;\n }\n setVisibleCount(count);\n };\n\n compute();\n const ro = new ResizeObserver(compute);\n ro.observe(container);\n return () => ro.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [signature, leading != null]);\n\n const shown = visibleActions.slice(0, visibleCount);\n const hidden = visibleActions.slice(visibleCount);\n\n return (\n <div ref={containerRef} className={cn(\"relative min-w-0\", className)}>\n {/* Ghost measuring row — every action button + kebab, never visible.\n The leading slot is intentionally NOT duplicated here (it may be a\n stateful/fetching component); its width is read off `leadingRef`. */}\n <div\n ref={ghostRef}\n aria-hidden\n className=\"pointer-events-none absolute left-0 top-0 flex items-center gap-1.5 opacity-0\"\n >\n {visibleActions.map((a) => (\n <ToolbarButton key={a.id} action={a} />\n ))}\n <OverflowTrigger ariaLabel={overflowAriaLabel} />\n </div>\n\n {/* Visible row — right-aligned cluster that collapses overflow. */}\n <div className=\"flex items-center justify-end gap-1.5\">\n {leading != null && (\n <span ref={leadingRef} className=\"shrink-0\">\n {leading}\n </span>\n )}\n {shown.map((a) => (\n <ToolbarButton\n key={a.id}\n action={a}\n enableTooltip\n renderTooltip={renderTooltip}\n />\n ))}\n {hidden.length > 0 &&\n renderOverflowMenu({\n actions: hidden,\n trigger: <OverflowTrigger ariaLabel={overflowAriaLabel} />,\n })}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.\n *\n * Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)\n * becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);\n * the explicit `container` prop keeps top priority, exactly as before.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-popover 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n */\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { usePortalContainer } from \"./portal-container\";\n\nexport const Popover = PopoverPrimitive.Root;\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n // Cap to the viewport space Radix measured and scroll — a popover taller\n // than the screen must never trap the user with unreachable content.\n // z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal\n // z, DOM portal order decides, so a dialog opened FROM a popover stacks\n // above it, and a popover opened from a dialog still stacks above the\n // dialog. z-[10001] buried dialogs behind fullscreen popovers.\n \"z-[10000] w-72 max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n","\"use client\";\n\n/**\n * Injected portal-container seam.\n *\n * The matrx-frontend original resolved nested portal targets through\n * `useNestedPortalContainer` (explicit prop > dialog content > popout body >\n * document.body) — a host-shaped hook wired to that app's dialog and\n * window-panel systems. The package inverts the seam: hosts provide the\n * resolved container through `PortalContainerProvider`; an explicit\n * `container` prop on a component still wins, and with neither the portal\n * falls through to `document.body` (Radix default). Priority semantics are\n * unchanged from the original.\n */\n\nimport * as React from \"react\";\n\nconst PortalContainerContext = React.createContext<HTMLElement | null | undefined>(\n undefined,\n);\n\nexport interface PortalContainerProviderProps {\n /** Where nested Radix portals (Popover, etc.) should mount. `null`/`undefined` → document.body. */\n container: HTMLElement | null | undefined;\n children: React.ReactNode;\n}\n\nexport function PortalContainerProvider({\n container,\n children,\n}: PortalContainerProviderProps) {\n return (\n <PortalContainerContext.Provider value={container ?? undefined}>\n {children}\n </PortalContainerContext.Provider>\n );\n}\n\n/**\n * Resolve a portal target: explicit prop (including an explicit `null`,\n * meaning \"the default body\") beats the injected container.\n */\nexport function usePortalContainer(\n explicit?: HTMLElement | null,\n): HTMLElement | undefined {\n const injected = React.useContext(PortalContainerContext);\n\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n return injected ?? undefined;\n}\n","\"use client\";\n\n/**\n * ScoreRing — SVG progress ring + the shared score→color threshold semantics.\n * Ported verbatim from matrx-frontend `components/official/ScoreRing.tsx`\n * (S18). The thresholds ARE the product: green at/above `good`, orange\n * at/above `warning`, red below, muted for null. No seams.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport interface ScoreThresholds {\n /** Scores at or above this value are green. */\n good: number;\n /** Scores at or above this value (but below good) are orange. */\n warning: number;\n}\n\nexport const DEFAULT_SCORE_THRESHOLDS: ScoreThresholds = {\n good: 75,\n warning: 50,\n};\n\n/** Semantic score color shared by ring and accent consumers. */\nexport function scoreRingColorClasses(\n pct: number | null,\n thresholds: ScoreThresholds = DEFAULT_SCORE_THRESHOLDS,\n): string {\n if (pct === null) return \"text-muted-foreground\";\n if (pct >= thresholds.good) return \"text-green-500\";\n if (pct >= thresholds.warning) return \"text-orange-500\";\n return \"text-red-500\";\n}\n\n/** Solid-background twin of `scoreRingColorClasses`. */\nexport function scoreAccentBgClasses(\n pct: number | null,\n thresholds: ScoreThresholds = DEFAULT_SCORE_THRESHOLDS,\n): string {\n if (pct === null) return \"bg-muted-foreground/30\";\n if (pct >= thresholds.good) return \"bg-green-500\";\n if (pct >= thresholds.warning) return \"bg-orange-500\";\n return \"bg-red-500\";\n}\n\nexport interface ScoreRingProps {\n pct: number | null;\n size?: number;\n strokeWidth?: number;\n label?: string;\n valueClassName?: string;\n className?: string;\n thresholds?: ScoreThresholds;\n /** Visible suffix; study keeps `%`, while Lighthouse convention omits it. */\n suffix?: string;\n}\n\n/**\n * Shared SVG score ring. `pct` is 0–100; threshold semantics are supplied by\n * the domain (for example Lighthouse uses 90/50 while study uses 75/50).\n */\nexport function ScoreRing({\n pct,\n size = 112,\n strokeWidth = 8,\n label,\n valueClassName,\n className,\n thresholds = DEFAULT_SCORE_THRESHOLDS,\n suffix = \"%\",\n}: ScoreRingProps) {\n const radius = 50 - strokeWidth / 2;\n const circumference = 2 * Math.PI * radius;\n const boundedPct = pct === null ? 0 : Math.max(0, Math.min(100, pct));\n const dashOffset = circumference * (1 - boundedPct / 100);\n\n return (\n <div\n className={cn(\n \"relative flex shrink-0 items-center justify-center\",\n className,\n )}\n style={{ width: size, height: size }}\n role=\"img\"\n aria-label={`${label ?? \"Score\"}: ${pct === null ? \"not available\" : `${pct} out of 100`}`}\n >\n <svg viewBox=\"0 0 100 100\" className=\"h-full w-full -rotate-90\">\n <circle\n cx=\"50\"\n cy=\"50\"\n r={radius}\n className=\"stroke-muted\"\n strokeWidth={strokeWidth}\n fill=\"none\"\n />\n {pct !== null ? (\n <circle\n cx=\"50\"\n cy=\"50\"\n r={radius}\n className={cn(\n \"transition-[stroke-dashoffset] duration-700 ease-out\",\n scoreRingColorClasses(pct, thresholds),\n )}\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n fill=\"none\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n />\n ) : null}\n </svg>\n <div className=\"absolute flex flex-col items-center justify-center\">\n <span\n className={cn(\n \"font-bold tabular-nums text-foreground\",\n valueClassName ?? \"text-2xl\",\n )}\n >\n {pct === null ? \"—\" : `${pct}${suffix}`}\n </span>\n {label ? (\n <span className=\"max-w-[74px] truncate text-[9px] font-semibold uppercase tracking-wide text-muted-foreground\">\n {label}\n </span>\n ) : null}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * SegmentedControl — sized accessible segmented toggle.\n * Ported verbatim from matrx-frontend `components/ui/segmented-control.tsx`\n * (S17). No seams: pure markup over host semantic tokens. The option/prop\n * interfaces are exported here (the original kept them file-local).\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport interface SegmentOption {\n value: string;\n label: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps {\n value: string;\n onValueChange: (value: string) => void;\n data: SegmentOption[];\n name?: string;\n className?: string;\n fullWidth?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function SegmentedControl({\n value,\n onValueChange,\n data,\n name: _name,\n className,\n fullWidth = false,\n size = \"md\",\n}: SegmentedControlProps) {\n // Handle size classes\n const sizeClasses = {\n sm: \"h-7 text-xs\",\n md: \"h-9 text-sm\",\n lg: \"h-10 text-base\",\n };\n\n return (\n <div\n className={cn(\n \"inline-flex p-0.5 bg-muted rounded-md\",\n fullWidth && \"w-full\",\n className\n )}\n role=\"tablist\"\n >\n {data.map((option) => {\n const isActive = value === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n disabled={option.disabled}\n onClick={() => onValueChange(option.value)}\n className={cn(\n \"relative flex items-center justify-center rounded-[0.2rem] px-3 py-1.5 transition-all\",\n sizeClasses[size],\n fullWidth && \"flex-1\",\n isActive\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground hover:bg-background/50\",\n option.disabled && \"opacity-50 cursor-not-allowed\"\n )}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n","\"use client\";\n\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n","\"use client\";\n\n/**\n * Sheet — ported verbatim from matrx-frontend `components/ui/sheet.tsx`.\n *\n * Seam inversions:\n * - The host's `DialogContentPrimitive` (from its dialog module) is inlined\n * here as a private wrapper with identical behavior: unstyled non-portalling\n * Radix Content that derives `aria-modal` from the owning Root's modality.\n * - `Cross2Icon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `treeContainsComponent` stays the ONE kit implementation\n * (@ai-matrx/kit/react-tree) — never a vendored twin.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-dialog 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n * The RadixDialogModalProvider wrapper stays — it is unrelated to hydration.\n */\n\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { Cross2Icon } from \"./icons\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\n\n/**\n * Unstyled, non-portalling Content for Sheet layouts. It preserves Radix\n * focus/background behavior and derives `aria-modal` from the owning Root\n * (identical to the host dialog module's DialogContentPrimitive).\n */\nconst SheetContentBase = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>\n>(({ ...props }, ref) => {\n const isModal = useRadixDialogModal();\n return (\n <SheetPrimitive.Content\n {...props}\n ref={ref}\n aria-modal={isModal || undefined}\n />\n );\n});\nSheetContentBase.displayName = \"SheetContentBase\";\n\nexport const Sheet = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Root>\n>(({ children, ...props }, _ref) => {\n const modal = props.modal ?? true;\n\n return (\n <RadixDialogModalProvider modal={modal}>\n <SheetPrimitive.Root {...props} modal={modal}>\n {children}\n </SheetPrimitive.Root>\n </RadixDialogModalProvider>\n );\n});\nSheet.displayName = \"Sheet\";\n\nexport const SheetTrigger = SheetPrimitive.Trigger;\n\nexport const SheetClose = SheetPrimitive.Close;\n\nexport const SheetPortal = SheetPrimitive.Portal;\n\nexport const SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nexport const sheetVariants = cva(\n \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n center:\n \"inset-0 m-auto max-h-full max-w-full border rounded-lg data-[state=closed]:fade-out data-[state=open]:fade-in\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n },\n);\n\nexport interface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {\n hideCloseButton?: boolean;\n /** Skip the dimming overlay — for non-modal side panels (e.g. chat canvas). */\n hideOverlay?: boolean;\n /** Optional className for the overlay when shown. */\n overlayClassName?: string;\n}\n\nexport const SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport const SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(\n (\n {\n side = \"right\",\n className,\n children,\n hideCloseButton = false,\n hideOverlay = false,\n overlayClassName,\n ...props\n },\n ref,\n ) => {\n const hasDescription =\n treeContainsComponent(children, SheetDescription) ||\n treeContainsComponent(children, SheetPrimitive.Description);\n return (\n <SheetPortal>\n {!hideOverlay && <SheetOverlay className={overlayClassName} />}\n <SheetContentBase\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {!hideCloseButton && (\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <Cross2Icon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n {children}\n </SheetContentBase>\n </SheetPortal>\n );\n },\n);\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nexport const SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport const SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nexport const SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n","/**\n * Skeleton — ported verbatim from matrx-frontend `components/ui/skeleton.tsx`.\n * No seams: pure markup over host semantic tokens.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport function Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\"animate-pulse rounded-md bg-primary/10\", className)}\n {...props}\n />\n );\n}\n","\"use client\";\n\n/**\n * TabbedBottomSheet — iOS Settings–style two-level navigation for tabbed menus.\n * Ported verbatim from matrx-frontend\n * `components/official/bottom-sheet/TabbedBottomSheet.tsx` (S19).\n *\n * Level 1: a scrollable list of tabs (icon + label + chevron).\n * Level 2: drill into one tab's content with a back button in the header.\n *\n * Two invariants make this ONE surface instead of a different panel per tab:\n *\n * 1. **Fixed height** (`size=\"full\"`) — the sheet is the same near-full\n * height on the index and inside every tab, and it never resizes as\n * content loads, filters, or expands. An adaptive height here meant the\n * panel grew and shrank under the user's thumb on every keystroke.\n * 2. **One typography scale** (`matrx-mobile-sheet`, host globals.css) —\n * the tab bodies are the same components the desktop window renders at\n * desktop density (11–12px). That is unreadable and untappable on a\n * phone, so the sheet promotes small text to mobile sizes and every\n * field to the 16px that stops iOS focus-zoom. Panels stay density-free;\n * the host decides the density.\n *\n * Seam inversions: `ChevronRight` is the package's inlined SVG (C19); the\n * `matrx-mobile-sheet` and `pb-safe` utility classes are host-owned CSS.\n */\n\nimport { useState, type ComponentType, type ReactNode } from \"react\";\n\nimport { BottomSheet, BottomSheetBody, BottomSheetHeader } from \"./bottom-sheet\";\nimport { ChevronRightIcon } from \"./icons\";\n\nexport interface TabbedBottomSheetTab {\n id: string;\n label: string;\n icon?: ComponentType<{ className?: string }>;\n /** Optional trailing badge / dot shown on the index row. */\n trailing?: ReactNode;\n content: ReactNode;\n}\n\nexport interface TabbedBottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n tabs: TabbedBottomSheetTab[];\n}\n\nexport function TabbedBottomSheet({\n open,\n onOpenChange,\n title,\n tabs,\n}: TabbedBottomSheetProps) {\n const [selectedTabId, setSelectedTabId] = useState<string | null>(null);\n\n // Every open starts on the index. Adjusted during render (the React-docs\n // pattern for state derived from a prop change) rather than in an effect,\n // which would render the previous tab's body for one frame first.\n const [wasOpen, setWasOpen] = useState(open);\n if (open !== wasOpen) {\n setWasOpen(open);\n if (open) setSelectedTabId(null);\n }\n\n const selectedTab = selectedTabId\n ? tabs.find((tab) => tab.id === selectedTabId)\n : null;\n\n return (\n <BottomSheet\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n size=\"full\"\n >\n <div className=\"matrx-mobile-sheet flex min-h-0 flex-1 flex-col\">\n <BottomSheetHeader\n title={selectedTab ? selectedTab.label : title}\n showBack={!!selectedTab}\n onBack={() => setSelectedTabId(null)}\n />\n {selectedTab ? (\n <div className=\"flex min-h-0 flex-1 flex-col overflow-hidden pb-safe\">\n {selectedTab.content}\n </div>\n ) : (\n <BottomSheetBody>\n <ul className=\"divide-y divide-border\">\n {tabs.map((tab) => {\n const Icon = tab.icon;\n return (\n <li key={tab.id}>\n <button\n type=\"button\"\n onClick={() => setSelectedTabId(tab.id)}\n className=\"flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-muted/60 active:bg-muted\"\n >\n {Icon ? (\n <Icon className=\"h-5 w-5 shrink-0 text-muted-foreground\" />\n ) : null}\n <span className=\"min-w-0 flex-1 text-base text-foreground\">\n {tab.label}\n </span>\n {tab.trailing}\n <ChevronRightIcon className=\"h-5 w-5 shrink-0 text-muted-foreground\" />\n </button>\n </li>\n );\n })}\n </ul>\n </BottomSheetBody>\n )}\n </div>\n </BottomSheet>\n );\n}\n","\"use client\";\n\n// useScrollFade — ported verbatim from matrx-frontend\n// `components/official/scroll-fade/useScrollFade.ts` (S21).\n//\n// \"There is more below\" — told to the eye, not to nobody.\n//\n// A scroll container that simply hard-clips its last row reads as FINISHED.\n// The user never scrolls, because nothing suggested there was anything to\n// scroll to. A soft fade at the overflowing edge is the standard cue, and it\n// must appear ONLY on the edges that actually overflow — a permanent fade on a\n// non-scrolling list just makes the last item look broken.\n//\n// Attach `ref` to the scrolling element and spread `fadeProps`. Styling is\n// host-owned CSS (the `.matrx-scroll-fade` class in the host's globals.css),\n// keyed off the data attributes.\n//\n// The ref is a CALLBACK ref, not a useRef object, on purpose: these containers\n// are usually mounted conditionally (a popover body, a lazily-resolved menu),\n// so an effect that reads `ref.current` on mount finds null and — with no\n// dependency that ever changes — never runs again. The fade then silently\n// never appears, which is exactly the failure this hook exists to prevent.\n//\n// TWO RULES THE CALLBACK MUST OBEY (both learned the hard way — breaking\n// either one produced \"Maximum update depth exceeded\" on a page of 13 menus):\n// 1. NEVER setState synchronously inside the callback. Radix composes our\n// ref with its own via useComposedRefs, whose identity changes every render,\n// so the ref detaches+reattaches on every commit. A synchronous setState\n// there re-renders, which re-attaches, which sets state again — forever.\n// Measurement is always deferred to rAF.\n// 2. NEVER setState on detach (node === null). A detach/attach pair would\n// otherwise flip the fade off and on and drive the same loop.\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport interface ScrollFadeState {\n top: boolean;\n bottom: boolean;\n}\n\nexport interface UseScrollFadeResult {\n ref: (node: HTMLElement | null) => void;\n fadeProps: {\n \"data-fade-top\": \"\" | undefined;\n \"data-fade-bottom\": \"\" | undefined;\n className: string;\n };\n state: ScrollFadeState;\n}\n\n/** Slack below which we treat the edge as reached (sub-pixel scroll math). */\nconst EPSILON = 2;\n\nexport function useScrollFade(): UseScrollFadeResult {\n const [state, setState] = useState<ScrollFadeState>({\n top: false,\n bottom: false,\n });\n const nodeRef = useRef<HTMLElement | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n const measure = useCallback(() => {\n const el = nodeRef.current;\n if (!el) return;\n const overflowing = el.scrollHeight - el.clientHeight > EPSILON;\n const next: ScrollFadeState = {\n top: overflowing && el.scrollTop > EPSILON,\n bottom:\n overflowing &&\n el.scrollTop + el.clientHeight < el.scrollHeight - EPSILON,\n };\n setState((prev) =>\n prev.top === next.top && prev.bottom === next.bottom ? prev : next,\n );\n }, []);\n\n const ref = useCallback(\n (node: HTMLElement | null) => {\n cleanupRef.current?.();\n cleanupRef.current = null;\n nodeRef.current = node;\n // Rule 2: no state change on detach.\n if (!node) return;\n\n node.addEventListener(\"scroll\", measure, { passive: true });\n // Content can arrive after mount (lazy menu configs, async lists) and the\n // box can be resized by the viewport, so watch both.\n const ro = new ResizeObserver(measure);\n ro.observe(node);\n const mo = new MutationObserver(measure);\n mo.observe(node, { childList: true, subtree: true });\n\n cleanupRef.current = () => {\n node.removeEventListener(\"scroll\", measure);\n ro.disconnect();\n mo.disconnect();\n };\n\n // Rule 1: deferred, never synchronous. Radix also animates the panel in,\n // so its final height is not known on the frame it mounts anyway.\n requestAnimationFrame(measure);\n },\n [measure],\n );\n\n useEffect(() => () => cleanupRef.current?.(), []);\n\n return {\n ref,\n state,\n fadeProps: {\n \"data-fade-top\": state.top ? \"\" : undefined,\n \"data-fade-bottom\": state.bottom ? \"\" : undefined,\n className: \"matrx-scroll-fade\",\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,WAA8B;;;ACAvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAA8B;AAClD,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD2BS;AA3BF,IAAM,gBAAgB;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,QACP,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAMO,SAAS,MAAM,EAAE,WAAW,SAAS,GAAG,MAAM,GAAe;AAClE,SAAO,oBAAC,UAAK,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO;AAChF;;;AERA,SAAS,sBAAsB;AAC/B,YAAYA,YAAW;AACvB,SAAS,UAAU,uBAAuB;;;ACMpC,gBAAAC,MA0BF,YA1BE;AAlBN,SAAS,YAAY,OAAsD;AACzE,SAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,GAAG;AAAA,EACL;AACF;AAGO,SAAS,YAAY,OAAkB;AAC5C,SACE,gBAAAA,KAAC,SAAK,GAAG,YAAY,KAAK,GACxB,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AK,oBAAoB,UAAU,OAAO;AAC1C,WAAG,WAAW;AACd,WAAG,WAAW;AAAA,MAChB;AAIA,4BAAsB,OAAO;AAAA,IAC/B;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,EAAAC,WAAU,MAAM,MAAM,WAAW,UAAU,GAAG,CAAC,CAAC;AAEhD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB,MAAM,MAAM,KAAK;AAAA,MAClC,oBAAoB,MAAM,SAAS,KAAK;AAAA,MACxC,WAAW;AAAA,IACb;AAAA,EACF;AACF;","names":["React","jsx","jsx","jsx","jsxs","cva","React","jsx","cva","jsx","jsxs","result","React","jsx","jsxs","React","jsx","useRef","useState","jsx","jsxs","useRef","useState","React","React","jsx","jsx","jsx","jsxs","jsx","React","jsx","cva","React","jsx","jsxs","cva","jsx","useState","jsx","jsxs","useState","useCallback","useEffect","useRef","useState"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/design-system",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "AI Matrx semantic React primitives shared across Vite, Next.js, desktop, and customer-built applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,34 +21,48 @@
21
21
  ],
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/index.d.ts",
25
- "import": "./dist/index.js"
24
+ "import": {
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./dist/index.d.cts",
30
+ "default": "./dist/index.cjs"
31
+ }
26
32
  },
27
33
  "./package.json": "./package.json"
28
34
  },
29
35
  "dependencies": {
36
+ "@radix-ui/react-dialog": "^1.1.17",
30
37
  "@radix-ui/react-label": "^2.1.8",
38
+ "@radix-ui/react-popover": "^1.1.17",
31
39
  "@radix-ui/react-separator": "^1.1.8",
32
40
  "@radix-ui/react-slot": "^1.2.4",
41
+ "@radix-ui/react-visually-hidden": "^1.2.6",
33
42
  "class-variance-authority": "^0.7.1",
34
43
  "clsx": "^2.1.1",
35
- "tailwind-merge": "^3.0.0"
44
+ "tailwind-merge": "^3.0.0",
45
+ "vaul": "^1.1.2"
36
46
  },
37
47
  "peerDependencies": {
48
+ "@ai-matrx/kit": ">=0.5.1",
38
49
  "react": ">=18.0.0",
39
50
  "react-dom": ">=18.0.0"
40
51
  },
41
52
  "devDependencies": {
42
53
  "@arethetypeswrong/cli": "^0.18.5",
54
+ "@testing-library/react": "^16.3.0",
43
55
  "@types/node": "^22.20.0",
44
56
  "@types/react": "^19.1.0",
45
57
  "@types/react-dom": "^19.1.0",
58
+ "jsdom": "^26.1.0",
46
59
  "publint": "^0.3.24",
47
60
  "react": "^19.1.0",
48
61
  "react-dom": "^19.1.0",
49
62
  "tsup": "^8.5.1",
50
63
  "typescript": "^5.9.3",
51
- "vitest": "^4.1.6"
64
+ "vitest": "^4.1.6",
65
+ "@ai-matrx/kit": "0.5.1"
52
66
  },
53
67
  "publishConfig": {
54
68
  "access": "public",
@@ -59,7 +73,7 @@
59
73
  },
60
74
  "sideEffects": false,
61
75
  "scripts": {
62
- "build": "tsup",
76
+ "build": "tsup && node ./scripts/stamp-client-boundary.mjs",
63
77
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
64
78
  "check:package": "pnpm build && publint && pnpm verify:tarball",
65
79
  "typecheck": "tsc --noEmit",