export interface RoleOption { id: R; /** "Workspace admin". */ label: string; /** One line from the role catalog: what someone with it can do. */ description: string; /** * Grants more power, so picking it asks first (Owner, Admin). Pass a * string to replace the role description in the confirmation. */ escalation?: boolean | string | undefined; /** Why this role can't be picked here. */ disabledReason?: string | undefined; } /** A role id, "custom" for a legacy hand-picked grant, or null for no access. */ export type RoleValue = R | "custom" | null; export type RoleSelectVariant = "field" | "cell" | "list" | "text"; export declare const CUSTOM_ROLE_LABEL = "Custom (set via API)"; export interface RoleSelectProps { roles: readonly RoleOption[]; value: RoleValue; /** * Saves the new role. Return a promise to show the saving state until it * settles; the select keeps showing the new role meanwhile. */ onValueChange?: ((role: R | null) => void | Promise) | undefined; variant?: RoleSelectVariant | undefined; /** "sm" is 32px for rows, "md" is 36px for forms. Field variant only. */ size?: "sm" | "md" | undefined; /** Adds a "No access" option (value null), for the person sheet and the matrix. */ noAccessLabel?: string | undefined; customLabel?: string | undefined; /** The person whose role this is, for confirmations and screen readers. */ subjectName?: string | undefined; disabled?: boolean | undefined; /** Shown in a tooltip on the disabled control, and read by screen readers. */ disabledReason?: string | undefined; /** Saving started elsewhere. */ pending?: boolean | undefined; /** Menu alignment against the trigger. */ align?: "start" | "end" | undefined; "aria-label"?: string | undefined; "aria-labelledby"?: string | undefined; id?: string | undefined; className?: string | undefined; } /** The label a role value shows, for rows, toasts and read-only text. */ export declare function roleLabel(roles: readonly RoleOption[], value: RoleValue, { noAccessLabel, customLabel, }?: { noAccessLabel?: string | undefined; customLabel?: string | undefined; }): string; /** Whether moving to a role needs a confirmation first: only roles marked as escalations do. */ export declare function needsEscalationConfirm(roles: readonly RoleOption[], from: RoleValue, to: R | null): boolean; /** Pick one role, from the server's catalog. Saves on change. */ export declare function RoleSelect({ roles, value, onValueChange, variant, size, noAccessLabel, customLabel, subjectName, disabled, disabledReason, pending: pendingProp, align, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, id, className, }: RoleSelectProps): import("react").JSX.Element;