{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet-action-list",
  "title": "Sheet Action List",
  "description": "A bottom action sheet for one item's actions on a phone with large rows, destructive actions styled, disabled ones kept visible and Cancel always present.",
  "registryDependencies": [
    "button",
    "sheet"
  ],
  "files": [
    {
      "path": "registry/patterns/sheet-action-list/sheet-action-list.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Sheet,\n  SheetClose,\n  SheetContent,\n  SheetDescription,\n  SheetHeader,\n  SheetTitle,\n  SheetTrigger,\n} from \"@/components/ui/sheet\"\n\nexport interface SheetAction {\n  id: string\n  label: string\n  icon?: React.ReactNode\n  destructive?: boolean\n  disabled?: boolean\n  onSelect: () => void\n}\n\nexport interface SheetActionListProps {\n  trigger: React.ReactNode\n  title: string\n  description?: string\n  actions: SheetAction[]\n}\n\n/**\n * An action sheet that rises from the bottom, for the actions of one item on\n * a phone: big targets, one per row, destructive ones styled and last. It is a\n * real dialog with a title, so the sheet is announced; choosing an action runs\n * it and closes the sheet, and Cancel is always available.\n */\nexport function SheetActionList({\n  trigger,\n  title,\n  description,\n  actions,\n}: SheetActionListProps) {\n  return (\n    <Sheet>\n      <SheetTrigger asChild>{trigger}</SheetTrigger>\n      <SheetContent side=\"bottom\" className=\"rounded-t-xl\">\n        <SheetHeader>\n          <SheetTitle>{title}</SheetTitle>\n          <SheetDescription className={description ? undefined : \"sr-only\"}>\n            {description ?? \"Choose an action\"}\n          </SheetDescription>\n        </SheetHeader>\n        <ul className=\"grid gap-1 px-2 pb-2\">\n          {actions.map((action) => (\n            <li key={action.id}>\n              <SheetClose asChild>\n                <button\n                  type=\"button\"\n                  disabled={action.disabled}\n                  onClick={action.onSelect}\n                  className={cn(\n                    \"hover:bg-accent focus-visible:ring-ring flex min-h-12 w-full items-center gap-3 rounded-md px-3 text-start text-base outline-none focus-visible:ring-2 disabled:opacity-50\",\n                    action.destructive && \"text-destructive\"\n                  )}\n                >\n                  {action.icon}\n                  {action.label}\n                </button>\n              </SheetClose>\n            </li>\n          ))}\n        </ul>\n        <div className=\"px-4 pb-4\">\n          <SheetClose asChild>\n            <Button variant=\"outline\" className=\"w-full\">\n              Cancel\n            </Button>\n          </SheetClose>\n        </div>\n      </SheetContent>\n    </Sheet>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}