import { type ReactElement } from "react"; import { type MessageDescriptor } from "react-intl"; import { type IUiLabelsChecklistItem } from "../UiLabelsChecklist/UiLabelsChecklist.js"; /** * Selectable permission level, mirroring the model's `AccessGranularPermission`: * EDIT ("Can edit & share"), SHARE ("Can view & share") and VIEW ("Can view") * are all assignable from the menu. * * @internal */ export type PermissionMenuLevel = "VIEW" | "SHARE" | "EDIT"; /** * Message descriptor of a permission level's display label ("Can edit & share" / * "Can view & share" / "Can view") — for triggers anchoring {@link UiPermissionMenu}. * * @internal */ export declare function permissionLevelMessage(level: PermissionMenuLevel): MessageDescriptor; /** * @internal */ export interface IUiPermissionMenuProps { /** Element that opens the menu on click. */ anchor: ReactElement; /** Currently selected permission level — drives `aria-checked`. */ selectedLevel?: PermissionMenuLevel; /** Fires when the user picks a permission level. */ onPermissionChange: (level: PermissionMenuLevel) => void; /** * Levels rendered disabled (`aria-disabled`, click blocked) — e.g. levels * the signed-in user may not pick because they exceed their own. */ disabledLevels?: ReadonlyArray; /** Tooltip shown on disabled level rows, explaining why the level can't be picked. */ disabledTooltip?: string; /** * Per-level override of `disabledTooltip`, for menus whose disabled levels have * different reasons (capped by the caller's own level vs. already inherited). */ disabledLevelTooltips?: Partial>; /** * Enables a labels row that drills into {@link UiLabelsChecklist} within the menu — for * rows whose menu hosts every action (no "⋯" menu). Offered unless the only labels are * primary ones; locked non-primary items still show, read-only. */ labels?: ReadonlyArray; /** Locked items are always treated as selected. */ selectedLabelIds?: ReadonlyArray; /** Fires with the applied label selection from the labels drill-in. */ onLabelsChange?: (selectedIds: string[]) => void; /** Fires when the user picks Remove access. */ onRemoveAccess?: () => void; /** * Renders Remove access disabled (`aria-disabled`, click blocked) instead of * hiding it — e.g. for a grantee whose access is inherited, so there is nothing * to remove here. Pair with `removeDisabledTooltip` to say why. */ isRemoveDisabled?: boolean; /** Tooltip shown on Remove access while it is disabled. */ removeDisabledTooltip?: string; /** * Label of the remove row. Defaults to "Remove access"; a picker staging a grantee * that holds no access yet passes the shorter "Remove". */ removeAccessLabel?: string; /** Test id forwarded to the menu body. */ dataTestId?: string; } /** * Per-grantee permission popover. Renders a fixed set of rows — three * permission levels (Can edit & share / Can view & share / Can view), an * optional divider, an optional labels drill-in and an optional Remove access * action row. Enabled rows carry no tooltip; a disabled row (`disabledLevels`, * `isRemoveDisabled`) shows its explanation as a tooltip over the whole row. * * @internal */ export declare function UiPermissionMenu({ anchor, selectedLevel, onPermissionChange, disabledLevels, disabledTooltip, disabledLevelTooltips, labels, selectedLabelIds, onLabelsChange, onRemoveAccess, isRemoveDisabled, removeDisabledTooltip, removeAccessLabel, dataTestId, }: IUiPermissionMenuProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=UiPermissionMenu.d.ts.map