$ show onokumus/metismenu
metismenu is a mature, widely-used jQuery plugin that provides collapsible, nested menu functionality. It transforms nested unordered lists into expandable/collapsible menus with support for ARIA accessibility, custom trigger elements, toggle behavior, and transition animations. The plugin is implemented as a single ES6 class (MetisMenu) with a jQuery plugin interface, and is built using Rollup, tested with Vitest/jsdom, and includes TypeScript definitions. It relies on jQuery as a peer dependency (version >=4.0.0) and provides optional CSS for icon frameworks (Bootstrap, FontAwesome, Ionicons). The codebase is well-structured, follows a clean plugin pattern, and includes comprehensive documentation and demo pages. While it is a straightforward library, its craftsmanship is professional, with good test coverage and modern build tooling.
The LLM identified 2 files worth highlighting for reuse:
A small, self-contained utility module that provides a cross-browser transition end event emulation for jQuery. It handles the 'transitionend' event by adding a custom special event ('mmTransitionEnd') and a jQuery method 'mmEmulateTransitionEnd' that falls back to a timeout-based emulation. This is a common pattern needed by any jQuery plugin that relies on CSS transitions, and it is extracted cleanly here, making it reusable in other projects that need transition end detection without a full library.
A comprehensive test suite for the MetisMenu jQuery plugin using Vitest and jsdom. It tests initialization, toggle behavior, various options (preventDefault, custom selectors), dispose functionality, and the jQuery plugin interface. The tests are well-organized with proper beforeEach/afterEach setup and teardown, including DOM cleanup and instance disposal. This file serves as a high-quality example of how to test a jQuery plugin in a modern headless environment, and its patterns can be reused for testing other jQuery-based components.