/** * Tabs — headless primitive wrapping Radix Tabs. * * Radix's Tabs owns the WAI-ARIA Tabs pattern: `role="tablist"` / * `role="tab"` / `role="tabpanel"` wiring, arrow-key + Home/End * navigation, automatic vs. manual activation modes, and * `aria-controls` / `aria-labelledby` pairing (ARCHITECTURE §6). We * wrap thinly: * - Permission gating on (denied → null + permission:denied) * - Audit emission on tab change (`tabs:change`) * - `data-oshon-primitive="tabs-*"` styling hooks * * "use client" mandatory — Radix uses hooks + DOM APIs internally. */ import * as RadixTabs from '@radix-ui/react-tabs'; import type { ComponentPropsWithoutRef, ReactNode } from 'react'; import { type PermissionContext } from '../context.js'; export interface TabsRootProps extends Omit { /** * Fires whenever the active tab changes. The primitive fires * `tabs:change` audit automatically before this callback runs. */ onValueChange?: (value: string) => void; /** * Per-instance permission override. Merges over the ambient * `PermissionContext`. Denied + any mode hides the entire tabs * surface — tabs are navigation scaffolding; no useful visible-but- * inert state — and emits a `permission:denied` audit. */ permissions?: Partial; /** * Resource name for `permissions.can('view', resource, attrs)`. * Default `'tabs'`. Override for e.g. `resource="admin:settings-tabs"`. */ resource?: string; /** Attribute bag for attribute-based access control. */ permissionAttrs?: Record; children: ReactNode; } /** * Tabs root. Orchestrates the tablist + panels, gates on permissions, * fires `tabs:change` audit. Must wrap `Tabs.List` + `Tabs.Trigger*` + * `Tabs.Content*`. */ declare function Root({ children, value, defaultValue, onValueChange, permissions, resource, permissionAttrs, orientation, dir, activationMode, ...rest }: TabsRootProps): import("react/jsx-runtime").JSX.Element | null; declare namespace Root { var displayName: string; } export type TabsListProps = ComponentPropsWithoutRef; export type TabsTriggerProps = ComponentPropsWithoutRef; export type TabsContentProps = ComponentPropsWithoutRef; /** * Compound Tabs primitive. Use as: * * * * Overview * Activity * * * * */ export declare const Tabs: { Root: typeof Root; List: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Trigger: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Content: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; }; export type TabsProps = TabsRootProps; export {}; //# sourceMappingURL=tabs.d.ts.map