import { Controller } from "@hotwired/stimulus" import { useTransition } from "stimulus-use" export default class Drawer extends Controller { static targets = ["draw"] connect() { useTransition(this, { element: this.drawTarget, }) } toggle() { this.toggleTransition() } hide(event) { if (!this.element.contains(event.target) && !this.menuTarget.classList.contains("hidden")) { this.leave() } } }