{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-feature-spotlight",
  "title": "Feature Spotlight",
  "description": "Destaque ancorado para apresentar novas funcionalidades e guias passo a passo.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "@lema-ds/popover",
    "@lema-ds/button",
    "@lema-ds/ui-i18n",
    "@lema-ds/ds-locale-provider"
  ],
  "files": [
    {
      "path": "components/ds/ds-feature-spotlight.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Sparkles, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Popover, PopoverAnchor, PopoverContent } from \"@/components/ui/popover\"\nimport { Button } from \"@/components/ui/button\"\nimport { UI_I18N, type UILocale } from \"@/lib/ui-i18n\"\nimport { useUILocale } from \"@/components/ui/ds-locale-provider\"\n\n// ── Types ──\n\nexport interface FeatureSpotlightProps {\n  /**\n   * The element to anchor the spotlight to.\n   */\n  children: React.ReactNode\n  /**\n   * Title of highlighted feature.\n   */\n  title: React.ReactNode\n  /**\n   * Description explaining the feature.\n   */\n  description: React.ReactNode\n  /**\n   * Controlled open state.\n   */\n  open?: boolean\n  /**\n   * Open state change callback.\n   */\n  onOpenChange?: (open: boolean) => void\n  /**\n   * Current step number in a tour.\n   */\n  step?: number\n  /**\n   * Total steps in tour.\n   */\n  totalSteps?: number\n  /**\n   * Next step callback.\n   */\n  onNext?: () => void\n  /**\n   * Previous step callback.\n   */\n  onPrevious?: () => void\n  /**\n   * Dismiss callback.\n   */\n  onDismiss?: () => void\n  /**\n   * Popover placement side.\n   */\n  side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n  /**\n   * Popover alignment.\n   */\n  align?: \"start\" | \"center\" | \"end\"\n  /**\n   * Whether to render a pulsing beacon ring on the target.\n   */\n  showBeacon?: boolean\n  /**\n   * Localization locale.\n   */\n  locale?: UILocale\n  /**\n   * Content box custom classes.\n   */\n  className?: string\n}\n\n// ── Component ──\n\nexport function FeatureSpotlight({\n  children,\n  title,\n  description,\n  open,\n  onOpenChange,\n  step,\n  totalSteps,\n  onNext,\n  onPrevious,\n  onDismiss,\n  side = \"bottom\",\n  align = \"start\",\n  showBeacon = true,\n  locale: localeProp,\n  className,\n}: FeatureSpotlightProps) {\n  const locale = useUILocale(localeProp)\n  const [internalOpen, setInternalOpen] = React.useState(true)\n  const isControlled = open !== undefined\n  const isOpen = isControlled ? open : internalOpen\n  const setIsOpen = isControlled ? onOpenChange : setInternalOpen\n\n  const t = UI_I18N[locale].featureSpotlight\n\n  const isLastStep = !totalSteps || !step ? true : step === totalSteps\n\n  const handleDismiss = () => {\n    onDismiss?.()\n    setIsOpen?.(false)\n  }\n\n  const handleNext = () => {\n    if (onNext) {\n      onNext()\n    } else {\n      setIsOpen?.(false)\n    }\n  }\n\n  return (\n    <Popover open={isOpen} onOpenChange={setIsOpen}>\n      <PopoverAnchor asChild>\n        <div className=\"relative inline-flex items-center\">\n          {children}\n          {showBeacon && isOpen && (\n            <span className=\"absolute -top-1 -right-1 flex size-3\">\n              <span className=\"absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75\" />\n              <span className=\"relative inline-flex size-3 rounded-full bg-primary\" />\n            </span>\n          )}\n        </div>\n      </PopoverAnchor>\n      <PopoverContent\n        side={side}\n        align={align}\n        sideOffset={8}\n        aria-label={typeof title === \"string\" ? title : \"Feature Spotlight\"}\n        className={cn(\n          \"z-50 flex w-80 flex-col gap-3 rounded-xl border border-border bg-popover p-4 shadow-lg\",\n          className\n        )}\n      >\n        <div className=\"flex items-start justify-between gap-2\">\n          <div className=\"flex items-center gap-1.5 text-primary\">\n            <Sparkles className=\"size-4 shrink-0\" />\n            <h4 className=\"text-sm leading-tight font-semibold text-foreground\">\n              {title}\n            </h4>\n          </div>\n          <Button\n            type=\"button\"\n            variant=\"ghost\"\n            size=\"icon\"\n            onClick={handleDismiss}\n            aria-label={t.dismiss}\n            className=\"-mt-1 -mr-1 size-6 shrink-0 text-muted-foreground hover:text-foreground\"\n          >\n            <X className=\"size-3.5\" />\n          </Button>\n        </div>\n\n        <div className=\"text-xs leading-relaxed text-muted-foreground\">\n          {description}\n        </div>\n\n        <div className=\"flex items-center justify-between border-t border-border/50 pt-1\">\n          {step && totalSteps ? (\n            <span className=\"text-xs font-medium text-muted-foreground tabular-nums\">\n              {t.step} {step} {t.of} {totalSteps}\n            </span>\n          ) : (\n            <div />\n          )}\n\n          <div className=\"flex items-center gap-1.5\">\n            {step && step > 1 && onPrevious && (\n              <Button\n                type=\"button\"\n                variant=\"ghost\"\n                size=\"sm\"\n                onClick={onPrevious}\n                className=\"h-7 px-2 text-xs\"\n              >\n                {t.previous}\n              </Button>\n            )}\n            <Button\n              type=\"button\"\n              size=\"sm\"\n              onClick={handleNext}\n              className=\"h-7 px-3 text-xs\"\n            >\n              {isLastStep ? t.gotIt : t.next}\n            </Button>\n          </div>\n        </div>\n      </PopoverContent>\n    </Popover>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
