{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-review-dialogs-visitor-experience-1",
  "type": "registry:block",
  "title": "Visitor experience",
  "description": "Workspace card from the overtrue/ui workspace examples. Editable source, scoped styles, and demo interactions.",
  "categories": [
    "cards",
    "workspace"
  ],
  "registryDependencies": [
    "https://ui.overtrue.xyz/r/overtrue-card-foundation.json"
  ],
  "files": [
    {
      "path": "src/blocks/registry/review-dialogs-visitor-experience-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/review-dialogs-visitor-experience-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/workflows.tsx:538.\nimport { useRef, useState, type ReactNode } from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { IconPlus, IconX, IconAlertTriangle } from \"@tabler/icons-react\";\nimport { team } from \"./runtime/data/workspace/studio\";\nimport {\n  SceneCard,\n  Action,\n  Pill,\n  Person,\n} from \"./runtime/components/overtrue/scenes/shared\";\nfunction WorkflowDialog({\n  open,\n  onOpenChange,\n  title,\n  description,\n  children,\n  className = \"\",\n}: {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  title: string;\n  description: string;\n  children: ReactNode;\n  className?: string;\n}) {\n  const returnFocus = useRef<HTMLElement | null>(null);\n  const content = useRef<HTMLDivElement>(null);\n  return (\n    <Dialog.Root open={open} onOpenChange={onOpenChange}>\n      <Dialog.Portal>\n        <div className=\"overtrue-workspace overtrue-block workspace-portal\">\n          <Dialog.Overlay className=\"workspace-dialog-overlay\" />\n          <Dialog.Content\n            ref={content}\n            className={`scene scene-workflow-dialog ${className}`}\n            onOpenAutoFocus={(event) => {\n              returnFocus.current =\n                document.activeElement instanceof HTMLElement\n                  ? document.activeElement\n                  : null;\n              const field = content.current?.querySelector<HTMLElement>(\n                \"input,select,textarea\",\n              );\n              if (field) {\n                event.preventDefault();\n                field.focus();\n              }\n            }}\n            onCloseAutoFocus={(event) => {\n              if (returnFocus.current?.isConnected) {\n                event.preventDefault();\n                returnFocus.current.focus();\n              }\n            }}\n          >\n            <Dialog.Title className=\"scene-dialog-title\">{title}</Dialog.Title>\n            <Dialog.Description className=\"scene-dialog-description\">\n              {description}\n            </Dialog.Description>\n            <Dialog.Close\n              className=\"scene-dialog-close\"\n              aria-label=\"Close dialog\"\n            >\n              <IconX size={18} />\n            </Dialog.Close>\n            {children}\n          </Dialog.Content>\n        </div>\n      </Dialog.Portal>\n    </Dialog.Root>\n  );\n}\nfunction CardExample() {\n  const [dialog, setDialog] = useState<\"invite\" | \"archive\" | null>(null);\n  const [email, setEmail] = useState(\"\");\n  const [archived, setArchived] = useState(false);\n  const [, setNotice] = useState(\"\");\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page=\"modals\">\n        <SceneCard\n          title=\"Visitor experience\"\n          description=\"Culture venue · Shared with 3 people\"\n          action={<Pill>{archived ? \"Archived\" : \"In progress\"}</Pill>}\n        >\n          <div className=\"scene-resource\">\n            <Person name=\"Maya Okafor\" subtitle=\"Project owner\" />\n            <Pill>Owner</Pill>\n          </div>\n          {[team[1], team[2]].map((person) => (\n            <div className=\"scene-resource\" key={person.id}>\n              <Person name={person.name} subtitle={person.email} />\n              <Pill>Editor</Pill>\n            </div>\n          ))}\n          <div className=\"scene-action-footer\">\n            <Action primary onClick={() => setDialog(\"invite\")}>\n              <IconPlus size={16} />\n              Invite collaborator\n            </Action>\n          </div>\n        </SceneCard>\n        <WorkflowDialog\n          open={dialog === \"invite\"}\n          onOpenChange={(open) => !open && setDialog(null)}\n          title=\"Invite a collaborator\"\n          description=\"Prepare a project invitation for a teammate or client.\"\n        >\n          <form\n            className=\"scene-form\"\n            onSubmit={(event) => {\n              event.preventDefault();\n              setNotice(`Invitation prepared for ${email}. No email was sent.`);\n              setDialog(null);\n            }}\n          >\n            <label>\n              Email address\n              <input\n                type=\"email\"\n                required\n                value={email}\n                onChange={(event) => setEmail(event.target.value)}\n                placeholder=\"name@example.com\"\n              />\n            </label>\n            <label>\n              Project role\n              <select className=\"native-select\">\n                <option>Reviewer — comment on shared work</option>\n                <option>Editor — manage deliverables</option>\n              </select>\n            </label>\n            <div className=\"scene-action-footer\">\n              <Action onClick={() => setDialog(null)}>Cancel</Action>\n              <Action primary type=\"submit\">\n                Prepare invitation\n              </Action>\n            </div>\n          </form>\n        </WorkflowDialog>\n        <WorkflowDialog\n          open={dialog === \"archive\"}\n          onOpenChange={(open) => !open && setDialog(null)}\n          title=\"Archive Visitor experience?\"\n          description=\"The project will move out of active work. You can restore it later.\"\n        >\n          <div className=\"scene-dialog-callout\">\n            <IconAlertTriangle size={20} />\n            <p>\n              Make sure all open deliverables have an owner before archiving.\n            </p>\n          </div>\n          <div className=\"scene-action-footer\">\n            <Action onClick={() => setDialog(null)}>Keep project</Action>\n            <Action\n              primary\n              onClick={() => {\n                setArchived(true);\n                setDialog(null);\n                setNotice(\"Project archived in this preview.\");\n              }}\n            >\n              Archive project\n            </Action>\n          </div>\n        </WorkflowDialog>\n      </div>\n    </>\n  );\n}\n\nexport default function Block() { return <BlockFrame><CardExample /></BlockFrame>; }\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/review-dialogs-visitor-experience-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
