{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shared-events",
  "type": "registry:lib",
  "title": "shared/events",
  "description": "Internal module shared by the ui-* components (events). Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [
    "lit@^3.3.0"
  ],
  "registryDependencies": [
    "@kanok-ui/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/shared/events.ts",
      "type": "registry:lib",
      "target": "components/ui/primitives/shared/events.ts",
      "content": "/** Detail shapes shared by several elements' events. Each element also exports a `Ui…EventMap`. */\n\n/** `ui-toggle` of popups (menu, popover, toggletip, accordion item…): the new state. */\nexport interface OpenDetail {\n    open: boolean;\n}\n\n/** `ui-toggle` / `ui-before-toggle` of disclosures (tiles, side nav, panels, code snippet). */\nexport interface ExpandedDetail {\n    expanded: boolean;\n}\n\n/** `ui-copy` (cancelable): the text about to be copied. */\nexport interface CopyDetail {\n    text: string;\n}\n\n/**\n * Whether a listener on an element got that element's own event, not one bubbling up from inside it: `ui-toggle` and\n * `ui-close` bubble, so a popover's listener also hears the dropdown in it close.\n */\nexport const isOwnEvent = (event: Event) => event.target === event.currentTarget;\n\n/** `ui-request-close` (cancelable) and `ui-close`: why it is closing. */\nexport interface CloseDetail<Reason extends string = string> {\n    reason: Reason;\n}\n\n/** `ui-navigate` (cancelable) of every link a component renders: the `href` about to be followed, as written. */\nexport interface NavigateDetail {\n    href: string;\n}\n\ndeclare global {\n    /** `ui-navigate` bubbles out of shadow roots to `document`, where a router listens once for the whole app. */\n    interface GlobalEventHandlersEventMap {\n        'ui-navigate': CustomEvent<NavigateDetail>;\n    }\n}\n"
    }
  ]
}
