/** * Select — headless primitive wrapping Radix Select. * * Radix's Select owns the WAI-ARIA Listbox pattern used for native-like * dropdowns: combobox semantics, typeahead, arrow-key navigation, * keyboard-only operation, collision detection, portal, and focus * return (ARCHITECTURE §6). We wrap thinly: * - Permission gating on (denied → null + permission:denied * audit; no useful visible-but-inert state) * - Audit on open / close (`select:open` / `select:close`) and on * value change (`select:change`) * - `data-oshon-primitive="select-*"` styling hooks * * "use client" mandatory — Radix uses hooks + DOM APIs internally. */ import * as RadixSelect from '@radix-ui/react-select'; import type { ComponentPropsWithoutRef, ReactNode } from 'react'; import { type PermissionContext } from '../context.js'; export interface SelectRootProps extends Omit { /** * Fires whenever the select's open state changes. Primitive emits * `select:open` / `select:close` audit before the callback runs. */ onOpenChange?: (open: boolean) => void; /** * Fires whenever the user picks a value. Primitive emits * `select:change` audit with `{ value }` details before the callback * runs. */ onValueChange?: (value: string) => void; /** * Per-instance permission override. Merges over the ambient * `PermissionContext`. Denied → primitive returns null (a select has * no useful visible-but-inert state — the components layer can render * a static readout for that case) and emits `permission:denied`. */ permissions?: Partial; /** * Resource name for `permissions.can('view', resource, attrs)`. * Default `'select'`. Override for e.g. `resource="field:status"`. */ resource?: string; /** Attribute bag for attribute-based access control. */ permissionAttrs?: Record; children: ReactNode; } declare function Root({ children, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, permissions, resource, permissionAttrs, ...rest }: SelectRootProps): import("react/jsx-runtime").JSX.Element | null; declare namespace Root { var displayName: string; } export type SelectTriggerProps = ComponentPropsWithoutRef; export type SelectValueProps = ComponentPropsWithoutRef; export type SelectIconProps = ComponentPropsWithoutRef; export type SelectPortalProps = RadixSelect.SelectPortalProps; declare function Portal(props: SelectPortalProps): import("react/jsx-runtime").JSX.Element; declare namespace Portal { var displayName: string; } export type SelectContentProps = ComponentPropsWithoutRef; export type SelectViewportProps = ComponentPropsWithoutRef; export type SelectItemProps = ComponentPropsWithoutRef; export type SelectItemTextProps = ComponentPropsWithoutRef; export type SelectItemIndicatorProps = ComponentPropsWithoutRef; export type SelectSeparatorProps = ComponentPropsWithoutRef; export type SelectGroupProps = ComponentPropsWithoutRef; export type SelectLabelProps = ComponentPropsWithoutRef; /** * Compound Select primitive. Use as: * * * * * * * * * * * Open * * * * Closed * * * * * */ export declare const Select: { Root: typeof Root; Trigger: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Value: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Icon: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Portal: typeof Portal; Content: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Viewport: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Item: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; ItemText: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; ItemIndicator: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Separator: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Group: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Label: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; }; export type SelectProps = SelectRootProps; export {}; //# sourceMappingURL=select.d.ts.map