{
  "name": "PopConfirm",
  "category": "Overlay",
  "subcategory": null,
  "description": "Inline 'are you sure?' popover attached to a trigger.",
  "thumbnail": "/preview-cards/pop-confirm.png",
  "hasDocsPage": true,
  "nugetPackage": "Lumeo",
  "files": [
    "UI/PopConfirm/PopConfirm.razor"
  ],
  "dependencies": [
    "button",
    "popover"
  ],
  "packageDependencies": [
    "Blazicons.Lucide"
  ],
  "cssVars": [
    "--color-muted",
    "--color-muted-foreground"
  ],
  "api": {
    "name": "PopConfirm",
    "category": "Overlay",
    "subcategory": null,
    "description": "Inline 'are you sure?' popover attached to a trigger.",
    "nugetPackage": "Lumeo",
    "files": [
      "UI/PopConfirm/PopConfirm.razor"
    ],
    "namespace": "Lumeo",
    "inheritsFrom": null,
    "implements": [],
    "parameters": [
      {
        "name": "Title",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Description",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "ConfirmText",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "CancelText",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "IsDestructive",
        "type": "bool",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "OnConfirm",
        "type": "EventCallback",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "OnCancel",
        "type": "EventCallback",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "ChildContent",
        "type": "RenderFragment?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Placement",
        "type": "string",
        "default": "\"top\"",
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Icon",
        "type": "Blazicons.SvgIcon?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Class",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "AdditionalAttributes",
        "type": "Dictionary<string, object>?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": true
      }
    ],
    "events": [
      {
        "name": "OnConfirm",
        "type": "EventCallback",
        "description": null
      },
      {
        "name": "OnCancel",
        "type": "EventCallback",
        "description": null
      }
    ],
    "enums": [],
    "records": [],
    "cssVars": [
      "--color-muted",
      "--color-muted-foreground"
    ],
    "examples": [
      {
        "title": "Basic Pop Confirm",
        "code": "<PopConfirm Title=\"Delete this item?\"\n            Description=\"This action cannot be undone.\"\n            OnConfirm=\"@HandleConfirm\">\n    <Button Variant=\"Button.ButtonVariant.Outline\">Delete item</Button>\n</PopConfirm>"
      },
      {
        "title": "Destructive Action",
        "code": "<PopConfirm Title=\"Delete account?\"\n            Description=\"All data will be permanently removed.\"\n            ConfirmText=\"Yes, delete\"\n            IsDestructive=\"true\"\n            OnConfirm=\"@HandleDelete\">\n    <Button Variant=\"Button.ButtonVariant.Destructive\">Delete Account</Button>\n</PopConfirm>"
      },
      {
        "title": "Custom Texts",
        "code": "<PopConfirm Title=\"Archive project?\"\n            ConfirmText=\"Archive\"\n            CancelText=\"Keep active\"\n            OnConfirm=\"@HandleArchive\">\n    <Button Variant=\"Button.ButtonVariant.Secondary\">Archive Project</Button>\n</PopConfirm>"
      },
      {
        "title": "No Description",
        "code": "<PopConfirm Title=\"Mark as complete?\" OnConfirm=\"@HandleComplete\">\n    <Button Variant=\"Button.ButtonVariant.Ghost\">Complete</Button>\n</PopConfirm>"
      }
    ],
    "subComponents": {},
    "parseFailed": false,
    "parseError": null
  },
  "$schema": "https://lumeo.nativ.sh/registry-component-schema.json",
  "key": "pop-confirm",
  "docsUrl": "https://lumeo.nativ.sh/components/pop-confirm",
  "sourceUrl": [
    {
      "file": "UI/PopConfirm/PopConfirm.razor",
      "url": "https://github.com/Brain2k-0005/Lumeo/tree/master/src/Lumeo/UI/PopConfirm/PopConfirm.razor"
    }
  ],
  "source": [
    {
      "path": "UI/PopConfirm/PopConfirm.razor",
      "content": "@namespace Lumeo\n\n<Popover @bind-Open=\"_isOpen\" @attributes=\"AdditionalAttributes\">\n    <span @onclick=\"Open\" class=\"inline-flex cursor-pointer\">\n        @ChildContent\n    </span>\n    <PopoverContent Class=\"@($\"w-72 p-4 {Class}\".Trim())\">\n        <div class=\"flex flex-col gap-3\">\n            <div class=\"flex items-start gap-2\">\n                @if (Icon != null)\n                {\n                    <span class=\"mt-0.5 shrink-0 text-muted-foreground\">\n                        <Blazicon Svg=\"@Icon\" class=\"h-4 w-4\" />\n                    </span>\n                }\n                <div class=\"flex flex-col gap-1\">\n                    <p class=\"text-sm font-medium leading-none\">@EffectiveTitle</p>\n                    @if (!string.IsNullOrEmpty(Description))\n                    {\n                        <p class=\"text-sm text-muted-foreground\">@Description</p>\n                    }\n                </div>\n            </div>\n            <div class=\"flex justify-end gap-2\">\n                <Button Variant=\"Button.ButtonVariant.Outline\" Size=\"Button.ButtonSize.Sm\" OnClick=\"HandleCancel\">\n                    @EffectiveCancelText\n                </Button>\n                <Button Variant=\"@(IsDestructive ? Button.ButtonVariant.Destructive : Button.ButtonVariant.Default)\"\n                        Size=\"Button.ButtonSize.Sm\"\n                        OnClick=\"HandleConfirm\">\n                    @EffectiveConfirmText\n                </Button>\n            </div>\n        </div>\n    </PopoverContent>\n</Popover>\n\n@inject Lumeo.Services.Localization.ILumeoLocalizer L\n\n@code {\n    [Parameter] public string? Title { get; set; }\n    [Parameter] public string? Description { get; set; }\n    [Parameter] public string? ConfirmText { get; set; }\n    [Parameter] public string? CancelText { get; set; }\n\n    private string EffectiveTitle => Title ?? L[\"PopConfirm.Title\"];\n    private string EffectiveConfirmText => ConfirmText ?? L[\"PopConfirm.Confirm\"];\n    private string EffectiveCancelText => CancelText ?? L[\"PopConfirm.Cancel\"];\n    [Parameter] public bool IsDestructive { get; set; }\n    [Parameter] public EventCallback OnConfirm { get; set; }\n    [Parameter] public EventCallback OnCancel { get; set; }\n    [Parameter] public RenderFragment? ChildContent { get; set; }\n    [Parameter] public string Placement { get; set; } = \"top\";\n    [Parameter] public Blazicons.SvgIcon? Icon { get; set; }\n    [Parameter] public string? Class { get; set; }\n    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }\n\n    private bool _isOpen;\n\n    private void Open() => _isOpen = true;\n\n    private async Task HandleConfirm()\n    {\n        _isOpen = false;\n        await OnConfirm.InvokeAsync();\n    }\n\n    private async Task HandleCancel()\n    {\n        _isOpen = false;\n        await OnCancel.InvokeAsync();\n    }\n}\n"
    }
  ],
  "slots": [
    {
      "name": "ChildContent",
      "owner": "PopConfirm",
      "type": "RenderFragment?",
      "description": null
    }
  ],
  "serviceDependencies": [
    {
      "service": "ILumeoLocalizer",
      "namespace": "Lumeo.Services.Localization"
    }
  ],
  "cascadingDependencies": [],
  "relatedComponents": [
    {
      "name": "Popover",
      "reason": "used internally"
    },
    {
      "name": "Button",
      "reason": "used internally"
    }
  ],
  "keyboardInteractions": [],
  "tests": [
    "tests/Lumeo.Tests/Components/PopConfirm/PopConfirmTests.cs"
  ],
  "mdSummary": "# PopConfirm\n\nInline 'are you sure?' popover attached to a trigger.\n\n**Package:** `Lumeo` · **Category:** Overlay\n**Docs:** https://lumeo.nativ.sh/components/pop-confirm\n\n## Parameters\n| Owner | Name | Type | Default | Description |\n|---|---|---|---|---|\n| PopConfirm | Title | `string?` | `` |  |\n| PopConfirm | Description | `string?` | `` |  |\n| PopConfirm | ConfirmText | `string?` | `` |  |\n| PopConfirm | CancelText | `string?` | `` |  |\n| PopConfirm | IsDestructive | `bool` | `` |  |\n| PopConfirm | OnConfirm | `EventCallback` | `` |  |\n| PopConfirm | OnCancel | `EventCallback` | `` |  |\n| PopConfirm | ChildContent | `RenderFragment?` | `` |  |\n| PopConfirm | Placement | `string` | `\"top\"` |  |\n| PopConfirm | Icon | `Blazicons.SvgIcon?` | `` |  |\n| PopConfirm | Class | `string?` | `` |  |\n| PopConfirm | AdditionalAttributes | `Dictionary<string, object>?` | `` |  |\n\n## Slots\n- `ChildContent` (PopConfirm) — RenderFragment slot\n\n## Events\n- `OnConfirm` (`EventCallback`)\n- `OnCancel` (`EventCallback`)\n\n## Sub-components\n- (none)\n\n## Cascading values it expects\n- (none)\n\n## Services it injects\n- `ILumeoLocalizer` (Lumeo.Services.Localization)\n\n## Keyboard\n—\n\n## Example\n```razor\n<PopConfirm />\n```\n\n## CSS variables\n`--color-muted`, `--color-muted-foreground`\n\n## Files\n- `UI/PopConfirm/PopConfirm.razor`\n"
}