{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "z-event-rsvp-action-row",
  "title": "Z Event Rsvp Action Row",
  "dependencies": [
    "@heroicons/react@2.2.0"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://ui.orchid.ai/r/orchid-foundation.json",
    "https://ui.orchid.ai/r/orchid-theme.json",
    "https://ui.orchid.ai/r/z-action-row.json",
    "https://ui.orchid.ai/r/z-button.json",
    "https://ui.orchid.ai/r/z-tooltip.json"
  ],
  "files": [
    {
      "path": "registry/ui/orchid/spectrum/molecules/z-action-row/z-event-rsvp-action-row.tsx",
      "content": "\"use client\";\nimport { ArrowPathIcon, CalendarDaysIcon, CheckIcon, ExclamationTriangleIcon, XMarkIcon, ArrowUturnLeftIcon, } from '@heroicons/react/16/solid';\nimport ZButton from \"../../atoms/z-button/z-button\";\nimport ZActionRow from \"./z-action-row\";\nimport ZTooltip from \"../../atoms/z-tooltip/z-tooltip\";\nimport { cn } from \"../../../lib/ui-utils\";\ntype EventRSVPActionRowProps = {\n    mode?: 'rsvp' | 'open' | 'review';\n    date: string;\n    time: string;\n    cancelled?: boolean;\n    selected?: 'accepted' | 'declined' | 'tentative';\n    isLoading?: boolean;\n    isConnectingCalendar?: boolean;\n    hasConflict?: boolean;\n    hardConflict?: boolean;\n    conflictLabels?: string[];\n    onAccept?: () => void;\n    onDecline?: () => void;\n    onMaybe?: () => void;\n    onDismiss?: () => void;\n    openHref?: string;\n    onReview?: () => void;\n    className?: string;\n};\ntype EventRSVPControlsProps = Pick<EventRSVPActionRowProps, 'mode' | 'cancelled' | 'selected' | 'isLoading' | 'isConnectingCalendar' | 'onAccept' | 'onDecline' | 'onMaybe' | 'onDismiss' | 'openHref' | 'onReview'> & {\n    openLabel?: string;\n    openInNewTab?: boolean;\n};\nexport default function ZEventRSVPActionRow({ mode = 'rsvp', date, time, cancelled, selected, isLoading, isConnectingCalendar, hasConflict, hardConflict, conflictLabels, onAccept, onDecline, onMaybe, onDismiss, openHref, onReview, className, }: EventRSVPActionRowProps) {\n    return (<ZActionRow className={className} hasPadding={true} icon={CalendarDaysIcon} iconClassName=\"text-neutral\" left={<div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n          <div className=\"flex items-center gap-1.5\">\n            <span className={cn('text-copy text-neutral-subtle', cancelled && 'line-through opacity-60')}>{date}</span>\n            <span className={cn('text-copy text-neutral-subtle', cancelled && 'line-through opacity-60')}>{time}</span>\n          </div>\n          {hasConflict && !cancelled && (<ZEventConflictIndicator conflictLabels={conflictLabels} hardConflict={hardConflict}/>)}\n        </div>} right={<ZEventRSVPControls mode={mode} cancelled={cancelled} selected={selected} isLoading={isLoading} isConnectingCalendar={isConnectingCalendar} onAccept={onAccept} onDecline={onDecline} onMaybe={onMaybe} onDismiss={onDismiss} openHref={openHref} onReview={onReview}/>}/>);\n}\nexport function ZEventRSVPControls({ mode = 'rsvp', cancelled, selected, isLoading, isConnectingCalendar, onAccept, onDecline, onMaybe, onDismiss, openHref, onReview, openLabel, openInNewTab = false, }: EventRSVPControlsProps) {\n    if (cancelled && mode !== 'review') {\n        if (onDismiss) {\n            return (<div className=\"bg-surface-weak flex gap-1 rounded-[10px] p-0.5\">\n          <ZButton variant=\"transparent\" size=\"sm\" onClick={onDismiss} trailingIcon={CheckIcon}>\n            Ok\n          </ZButton>\n        </div>);\n        }\n        return <span className=\"text-copy-sm text-neutral-subtle px-2\">Cancelled</span>;\n    }\n    if (mode === 'review') {\n        return (<ZButton variant=\"primary\" size=\"md\" onClick={onReview} leadingIcon={ArrowUturnLeftIcon}>\n        Review Reply\n      </ZButton>);\n    }\n    if (mode === 'open') {\n        return (<ZButton variant=\"primary\" size=\"sm\" href={openHref} target={openInNewTab ? '_blank' : undefined} rel={openInNewTab ? 'noreferrer' : undefined}>\n        {openLabel ?? 'Open Invite'}\n      </ZButton>);\n    }\n    if (isConnectingCalendar) {\n        return (<div className=\"bg-surface-weak flex items-center gap-1.5 rounded-[10px] px-3 py-1.5\">\n        <ArrowPathIcon className=\"text-neutral-subtle size-3.5 animate-spin\"/>\n        <span className=\"text-copy-sm text-neutral-subtle\">Connecting calendar…</span>\n      </div>);\n    }\n    return (<div className=\"bg-surface-weak flex gap-1 rounded-[10px] p-0.5\">\n      <ZButton variant={selected === 'declined' ? 'primary' : 'transparent'} className={cn(selected && selected !== 'declined' && 'opacity-40', isLoading && selected === 'declined' && 'animate-pulse')} size=\"sm\" onClick={onDecline} trailingIcon={XMarkIcon}>\n        No\n      </ZButton>\n      <ZButton variant={selected === 'tentative' ? 'primary' : 'transparent'} className={cn(selected && selected !== 'tentative' && 'opacity-40', isLoading && selected === 'tentative' && 'animate-pulse')} size=\"sm\" onClick={onMaybe}>\n        Maybe\n      </ZButton>\n      <ZButton variant={selected === 'accepted' ? 'primary' : 'transparent'} className={cn(selected && selected !== 'accepted' && 'opacity-40', isLoading && selected === 'accepted' && 'animate-pulse')} size=\"sm\" onClick={onAccept} trailingIcon={CheckIcon}>\n        Yes\n      </ZButton>\n    </div>);\n}\nexport function ZEventConflictIndicator({ conflictLabels, hardConflict, }: {\n    conflictLabels?: string[];\n    hardConflict?: boolean;\n}) {\n    return (<div className=\"flex items-center gap-1.5\">\n      <ExclamationTriangleIcon className={cn('size-3.5 shrink-0', hardConflict ? 'text-red-500' : 'text-yellow-500')} title={hardConflict\n            ? 'Conflicts with a committed meeting'\n            : 'Potential conflict with a meeting you have not accepted yet'}/>\n      <ConflictLabel conflictLabels={conflictLabels}/>\n    </div>);\n}\nfunction ConflictLabel({ conflictLabels }: {\n    conflictLabels?: string[];\n}) {\n    if (!conflictLabels?.length)\n        return <span className=\"text-copy text-neutral-subtle\">Conflict</span>;\n    if (conflictLabels.length === 1)\n        return <span className=\"text-copy text-neutral-subtle\">{conflictLabels[0]}</span>;\n    return (<ZTooltip content={<div className=\"flex flex-col gap-1\">\n          {conflictLabels.map((label, i) => (<span key={i}>{label}</span>))}\n        </div>} delay={200}>\n      <span className=\"text-copy text-neutral-subtle cursor-default\">\n        {conflictLabels.length} Conflicts\n      </span>\n    </ZTooltip>);\n}\n",
      "type": "registry:ui",
      "target": "@ui/orchid/spectrum/molecules/z-action-row/z-event-rsvp-action-row.tsx"
    }
  ],
  "type": "registry:ui"
}