Explore the Salad UI JavaScript File Structure
mainThe JavaScript assets for Salad UI are located in assets/salad_ui/. The structure is divided into core logic and individual UI components:
Core Module (assets/salad_ui/core/)
Contains the foundational logic used by all components:
component.js: The baseComponentclass.state-machine.js: Logic for managing component states.hook.js: The Phoenix LiveView hook implementation.factory.js: The registry and factory for component instantiation.utils.js: DOM, animation, and class utilities.collection.js: Manages selectable/focusable item collections.focus-trap.js: Utility for trapping focus within an element.click-outside.js: Monitors clicks outside a specific element.portal.js: Utility for DOM re-parenting.positioner.js&positioned-element.js: Math and logic for floating elements (popovers, tooltips, etc.).scroll-manager.js: Handles repositioning during scroll/resize events.
Components (assets/salad_ui/components/)
Contains individual component implementations such as accordion.js, dialog.js, dropdown_menu.js, popover.js, select.js, tabs.js, and more.