{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "permission-grant",
  "title": "Permission Grant",
  "description": "A capability-level consent surface that explains reach and duration before access is granted.",
  "dependencies": [
    "@solar-icons/react@^2.2.0",
    "cn@^0.3.0"
  ],
  "registryDependencies": [
    "button",
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/permission-grant.tsx",
      "content": "import { ClockCircleIcon } from '@solar-icons/react/linear/clock-circle'\nimport { CloseIcon } from '@solar-icons/react/linear/close'\nimport { KeyMinimalisticIcon as KeyRoundIcon } from '@solar-icons/react/linear/key-minimalistic'\nimport * as React from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { cn } from 'cn'\n\ninterface PermissionGrantProps extends React.ComponentProps<'section'> {\n  capability: string\n  description: string\n  duration?: string\n  onDeny?: () => void\n  onGrant?: () => void\n  restrictions?: React.ReactNode[]\n  scope: React.ReactNode[]\n}\n\nconst itemClass =\n  'flex items-start gap-2.5 text-sm leading-5 text-foreground/80 [&_code]:rounded-[5px] [&_code]:bg-foreground/8 [&_code]:px-1 [&_code]:py-px [&_code]:font-mono [&_code]:text-[13px]'\n\nfunction PermissionGroup({\n  allowed,\n  items,\n  label,\n}: {\n  allowed: boolean\n  items: React.ReactNode[]\n  label: string\n}) {\n  return (\n    <div>\n      <p className=\"mb-2 text-[13px] leading-5 font-medium text-muted-foreground\">{label}</p>\n      <ul className=\"space-y-2\">\n        {items.map((item, index) => (\n          <li className={itemClass} key={index}>\n            {allowed ? (\n              <svg\n                aria-hidden=\"true\"\n                className=\"mt-0.5 size-4 shrink-0 text-emerald-600 dark:text-emerald-500\"\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"1.75\"\n                viewBox=\"0 0 16 16\"\n              >\n                <path d=\"m3.5 8.5 3 3 6-7\" />\n              </svg>\n            ) : (\n              <CloseIcon\n                aria-hidden=\"true\"\n                className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\"\n              />\n            )}\n            <span className=\"min-w-0\">{item}</span>\n          </li>\n        ))}\n      </ul>\n    </div>\n  )\n}\n\nfunction PermissionGrant({\n  capability,\n  className,\n  description,\n  duration = 'This session',\n  onDeny,\n  onGrant,\n  restrictions = [],\n  scope,\n  ...props\n}: PermissionGrantProps) {\n  return (\n    <section\n      data-slot=\"permission-grant\"\n      className={cn(\n        'overflow-hidden rounded-[16px] bg-card font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground shadow-card transition-[opacity,translate] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] starting:translate-y-1 starting:opacity-0 motion-reduce:starting:translate-y-0',\n        className,\n      )}\n      {...props}\n    >\n      <div className=\"flex gap-3 p-5\">\n        <span className=\"flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-foreground/6 text-muted-foreground\">\n          <KeyRoundIcon className=\"size-4\" />\n        </span>\n        <div className=\"min-w-0 flex-1\">\n          <h3 className=\"text-lg leading-6 font-medium tracking-[-0.01em] text-foreground\">\n            Grant {capability}?\n          </h3>\n          <p className=\"mt-1 text-sm leading-5 text-muted-foreground\">{description}</p>\n          <div className=\"mt-4 space-y-4 rounded-[12px] bg-foreground/4 p-4\">\n            {scope.length > 0 && <PermissionGroup allowed items={scope} label=\"Can\" />}\n            {restrictions.length > 0 && (\n              <PermissionGroup allowed={false} items={restrictions} label=\"Can't\" />\n            )}\n          </div>\n          <p className=\"mt-3 flex items-center gap-2 text-[13px] leading-5 text-muted-foreground\">\n            <ClockCircleIcon aria-hidden=\"true\" className=\"size-4 shrink-0\" />\n            {duration}\n          </p>\n        </div>\n      </div>\n      <div className=\"flex justify-end gap-2 px-5 pb-5\">\n        <Button\n          className=\"h-7 rounded-full px-3 text-sm font-[450] tracking-[-0.05px] text-muted-foreground hover:bg-foreground/8 hover:text-foreground\"\n          onClick={onDeny}\n          size=\"sm\"\n          type=\"button\"\n          variant=\"ghost\"\n        >\n          Deny\n        </Button>\n        <Button\n          className=\"h-7 rounded-full border-0 bg-primary bg-linear-to-b from-[color-mix(in_oklch,var(--primary),var(--primary-foreground)_30%)] to-primary px-3 text-sm font-[450] tracking-[-0.05px] text-primary-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.14),0_1px_2px_rgba(0,0,0,0.18)] shadow-none hover:brightness-110 dark:bg-none\"\n          onClick={onGrant}\n          size=\"sm\"\n          type=\"button\"\n          variant=\"default\"\n        >\n          Grant access\n        </Button>\n      </div>\n    </section>\n  )\n}\n\nexport { PermissionGrant }\nexport type { PermissionGrantProps }\n",
      "type": "registry:component",
      "target": "@components/ai/permission-grant.tsx"
    }
  ],
  "type": "registry:component"
}