-
-
Timeline Title Here.
-
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
+
+
Timeline Title Here.
+
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
-
+
+
-
-
Timeline Title Here.
-
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
+
+
Timeline Title Here.
+
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
-
+
+
-
-
Timeline Title Here.
-
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
+
+
Timeline Title Here.
+
The key to more success is to have a lot of pillows. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I'm never giving up, I'm just getting started. I'm up to something. Fan luv.
diff --git a/docs/accordion.mdx b/docs/accordion.mdx
index 3e6d145..2716f83 100644
--- a/docs/accordion.mdx
+++ b/docs/accordion.mdx
@@ -6,6 +6,10 @@ prev: docs/react/text-area
next: docs/react/avatar
---
+
+
+
+
# Tailwind CSS Accordion
David UI's accordion component is built with Tailwind CSS and HTML to create sleek expand/collapse sections. Perfect for FAQs, menus, and content toggling, it provides an interactive way to organize information.
@@ -17,7 +21,7 @@ Customize styles effortlessly and explore examples to integrate this versatile,
## Basic Accordion
-Learn how to create a straightforward, responsive `Accordion` component. It's a versatile tool, perfect for including FAQ sections on your site.
+Create an SEO-optimized accordion component with exclusive mode using `data-dui-accordion-mode="exclusive"`. This ensures only one section stays open at a time, ideal for FAQ pages and content organization. The semantic HTML and ARIA attributes enhance both accessibility and search engine visibility while providing an excellent user experience.
@@ -25,7 +29,7 @@ Learn how to create a straightforward, responsive `Accordion` component. It's a
## Accordion All Open
-Initialize all Accordion sections as expanded by default by providing an array of values to the `defaultValue` property.
+Enhance content accessibility and SEO with the "all-open" accordion mode. Using `data-dui-accordion-mode="all-open"` allows users to view multiple sections simultaneously while maintaining collapse functionality. This feature optimizes content visibility and user engagement by displaying information upfront. Ideal for documentation and content-rich pages, the semantic HTML and ARIA attributes ensure proper accessibility and search engine indexing.
@@ -41,7 +45,7 @@ The Accordion component can operate in both controlled and uncontrolled modes. I
## Accordion Custom Icon
-Personalize the icon for the Accordion trigger using the `Accordion.Trigger` component. By leveraging the `group-data-[open=true]` attribute, you can dynamically show or hide icons based on the Accordion state.
+Customize the accordion's toggle icons using `data-dui-accordion-icon-close` and `data-dui-accordion-icon-open` attributes. These allow you to seamlessly switch between different icons based on the accordion's open/closed state, enhancing visual feedback and user experience.
@@ -57,6 +61,78 @@ Tailor the appearance of your Accordion by applying styles through the `classNam
## Accordion Disabled
-Prevent user interaction with specific Accordion sections by applying the `disabled` property. Disabled items will not respond to user actions.
+Enhance accessibility and user experience by disabling specific accordion sections using `aria-disabled="true"`. This attribute prevents user interaction and clearly indicates non-interactive content, improving both SEO and usability. Disabled sections maintain visual consistency while being properly marked up for screen readers and search engines.
+
+---
+
+## Required Script
+
+The Accordion component in david-ai requires JavaScript to handle the accordion functionality. The library provides smooth transitions and collapse/expand behavior through data attributes.
+
+### Installation
+
+To use the Accordion component in your project, you first need to install the `david-ai` library via npm:
+
+
+
+### Basic Usage
+
+
+
+### Using with Global Access
+If you prefer, you can use the DavidAI global object instead of directly importing initAccordion:
+
+
+
+### Using with CDN
+You can include david-ai via a CDN and initialize accordion functionality globally in the browser. Add the following script to your HTML file:
+
+
`}/>
+
+### HTML Code Example
+
+
+
+ What is David UI?
+
+
+
+
+
+
David UI is a comprehensive UI library built with Tailwind CSS, offering modern and customizable components for web development.
+
+
+
+ Why choose David UI?
+
+
+
+
+
+
David UI provides an extensive collection of ready-to-use components with seamless integration and excellent developer experience.
+
+ `
+}/>
\ No newline at end of file
diff --git a/docs/badge.mdx b/docs/badge.mdx
index 8c88890..8d510cc 100644
--- a/docs/badge.mdx
+++ b/docs/badge.mdx
@@ -26,7 +26,8 @@ Start with this simple badge setup, featuring a notification button and a small
## Badge Colors
-Choose from a variety of badge colors, including `primary`, `secondary`, `info`, `success`, `warning`, and `error`. Easily apply these colors to your badge by using the corresponding classes. The example below showcases the available options for integrating badge colors into your project.
+Explore different badge color options to match your design needs. From default dark and light themes to vibrant colors like blue, green, amber, and red, these badges can be used to indicate different states, priorities, or categories in your interface.
+
diff --git a/docs/button-group.mdx b/docs/button-group.mdx
index e7794b7..8bdbe85 100644
--- a/docs/button-group.mdx
+++ b/docs/button-group.mdx
@@ -76,14 +76,3 @@ Learn how to create pill-shaped button groups using styles like ghost, outline,
Leverage Tailwind CSS classes to design bespoke button groups for various purposes. This example shows how to create a button group tailored for social media integrations.
-
----
-
-## Required Script
-
-The button groups component needs a required script file for ripple effect to work, you just need to add the below script file to the bottom of your html file.
-
-If you don't want to have the ripple effect for the button groups you can skip this step.
-
-
-
diff --git a/docs/button.mdx b/docs/button.mdx
index fd80a4b..c74f17d 100644
--- a/docs/button.mdx
+++ b/docs/button.mdx
@@ -93,16 +93,3 @@ Leverage Tailwind CSS classes to design buttons for authentication purposes, inc
---
-
-## Required Script
-
-To enable the ripple effect for buttons, include the provided script file at the bottom of your HTML document. If you prefer buttons without the ripple effect, this step is optional.
-
-
-
-
-
-
-
----
-
diff --git a/docs/checkbox.mdx b/docs/checkbox.mdx
index 6207733..940e5d4 100644
--- a/docs/checkbox.mdx
+++ b/docs/checkbox.mdx
@@ -24,7 +24,7 @@ This straightforward checkbox example is perfect for incorporating into forms or
## Checkbox Colors
-Tailor your David UI checkbox to align with your design aesthetic by selecting from color options like primary, secondary, info, success, warning, and error.
+Customize your checkbox with different colors to match your brand identity and provide visual feedback. Choose from a variety of colors to indicate different states or actions. The example below showcases checkboxes in stone (default), blue, green, red, amber - allowing you to select colors that best represent your application's visual hierarchy and meaning.
diff --git a/docs/gallery.mdx b/docs/gallery.mdx
index 892f819..ee1cfae 100644
--- a/docs/gallery.mdx
+++ b/docs/gallery.mdx
@@ -6,6 +6,10 @@ prev: docs/react/inputs
next: docs/react/Gallery-group
---
+
+
+
+
# Tailwind CSS Image Gallery
Showcase images effectively with the gallery component in David UI. Tailwind CSS styling supports grids, layouts, and responsiveness, making it ideal for portfolios or media-heavy pages.
@@ -56,3 +60,63 @@ This gallery example features a horizontal scrolling format on smaller screens a
Organize images into categories with this tabbed gallery. Users can toggle between tabs like "App," "Messages," and "Settings" to view different sets of images. This design is perfect for applications requiring a structured and user-friendly approach to presenting grouped visuals.
+
+---
+
+## Required Script
+
+The Gallery component in david-ai requires JavaScript to handle image switching and thumbnail interactions. The library provides smooth transitions and interactive behavior through data attributes.
+
+### Installation
+
+To use the Gallery component in your project, you first need to install the `david-ai` library via npm:
+
+
+
+### Basic Usage
+
+
+
+### Using with Global Access
+If you prefer, you can use the DavidAI global object instead of directly importing initGallery:
+
+
+
+### Using with CDN
+You can include david-ai via a CDN and initialize gallery functionality globally in the browser. Add the following script to your HTML file:
+
+
`}/>
+
+### HTML Code Example
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `
+}/>
+
+### Gallery with tab
+
+The gallery with tabs component requires the same JavaScript from the Tabs component to function properly. Please refer to the [Tabs JavaScript](/docs/html/tabs#required-script) documentation for the required initialization code.
diff --git a/docs/icon-button.mdx b/docs/icon-button.mdx
index 82726e5..3206529 100644
--- a/docs/icon-button.mdx
+++ b/docs/icon-button.mdx
@@ -68,11 +68,3 @@ Learn how to create icon buttons that double as links. This design integrates cl
Design social media buttons using this customizable icon button example. Each button features platform-specific icons and colors, providing a cohesive way to represent different social media platforms.
-
----
-
-## Required Script
-
-To add a ripple effect to your icon buttons, include the required script file at the bottom of your HTML. This step is optional if you prefer buttons without the ripple animation.
-
-
diff --git a/docs/installation.mdx b/docs/installation.mdx
index 6583a8b..fbd81de 100644
--- a/docs/installation.mdx
+++ b/docs/installation.mdx
@@ -102,6 +102,8 @@ Optimize your application's performance with our cleanup utilities, perfect for
| Component | Cleanup Function |
|-----------|--------------|
+| Accordion | `cleanupAccordions()` |
+| Stepper | `cleanupSteppers()` |
| Dropdown | `cleanupDropdowns()` |
| Tooltip | `cleanupTooltips()` |
| Popover | `cleanupPopovers()` |
diff --git a/docs/stepper.mdx b/docs/stepper.mdx
index 6738f17..f5c3d31 100644
--- a/docs/stepper.mdx
+++ b/docs/stepper.mdx
@@ -6,6 +6,10 @@ prev: docs/react/inputs
next: docs/react/Stepper-group
---
+
+
+
+
# Tailwind CSS Stepper
Guide users through multi-step workflows with the stepper component from David UI. Styled with Tailwind CSS, it’s ideal for forms, tutorials, or processes.
@@ -53,3 +57,101 @@ This stepper pairs each step with additional content such as a title and descrip
A customizable stepper with a unique style, including rounded edges and tailored colors, offering a modern look to fit diverse design requirements.
+
+---
+
+## Required Script
+
+The Stepper component in david-ai requires JavaScript to handle the step functionality. The library provides smooth transitions and navigation behavior through data attributes.
+
+### Installation
+
+To use the Stepper component in your project, you first need to install the `david-ai` library via npm:
+
+
+
+### Basic Usage
+
+
+
+### Using with Global Access
+If you prefer, you can use the DavidAI global object instead of directly importing initStepper:
+
+
+
+### Using with CDN
+You can include david-ai via a CDN and initialize stepper functionality globally in the browser. Add the following script to your HTML file:
+
+
`}/>
+
+### HTML Code Example
+
+
+
+
+
+
+
Step 1 Content
+
This is the content for step 1. Add whatever content you need here.
+
+
+
Step 2 Content
+
This is the content for step 2. Add whatever content you need here.
+
+
+
Step 3 Content
+
This is the content for step 3. Add whatever content you need here.
+
+
+
+
+
+ Previous
+
+
+ Next
+
+
+ `
+}/>
\ No newline at end of file
diff --git a/packages/dist/david-ai.esm.js b/packages/dist/david-ai.esm.js
index a2fff25..98a07ad 100644
--- a/packages/dist/david-ai.esm.js
+++ b/packages/dist/david-ai.esm.js
@@ -1,3 +1,10 @@
+
+/*!
+ * David AI JavaScript Library v1.0.5
+ * (c) 2024 David AI - Creative Tim
+ * Released under the MIT License.
+ */
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
@@ -899,7 +906,7 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
}
// Alert component
-var initializedElements$1 = new WeakSet();
+var initializedElements$2 = new WeakSet();
function closeAlert(event) {
var button = event.currentTarget;
var alert = button.closest('[role="alert"]');
@@ -909,9 +916,9 @@ function closeAlert(event) {
}
function initAlert() {
document.querySelectorAll("[data-dui-dismiss='alert']").forEach(function (button) {
- if (!initializedElements$1.has(button)) {
+ if (!initializedElements$2.has(button)) {
button.addEventListener("click", closeAlert);
- initializedElements$1.add(button);
+ initializedElements$2.add(button);
}
});
}
@@ -933,7 +940,7 @@ if (typeof window !== "undefined") {
}
// Collapse component
-var initializedElements = new WeakSet();
+var initializedElements$1 = new WeakSet();
function toggleCollapse(event) {
var collapseID = event.currentTarget.getAttribute("data-dui-target");
if (collapseID && collapseID.startsWith("#")) {
@@ -956,9 +963,9 @@ function toggleCollapse(event) {
}
function initCollapse() {
document.querySelectorAll("[data-dui-toggle='collapse']").forEach(function (button) {
- if (!initializedElements.has(button)) {
+ if (!initializedElements$1.has(button)) {
button.addEventListener("click", toggleCollapse);
- initializedElements.add(button); // Mark as initialized
+ initializedElements$1.add(button); // Mark as initialized
}
});
}
@@ -1194,6 +1201,296 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
});
}
+// Accordion Component
+var initializedAccordionElements = new WeakSet();
+
+// Helper function to handle icons
+var handleIcons = function handleIcons(button, isExpanded) {
+ var isRotating = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
+ var openIcon = button.querySelector("[data-dui-accordion-icon-open]");
+ var closeIcon = button.querySelector("[data-dui-accordion-icon-close]");
+ var rotatingIcon = button.querySelector("[data-dui-accordion-icon]");
+ if (openIcon && closeIcon) {
+ openIcon.style.display = isExpanded ? "block" : "none";
+ closeIcon.style.display = isExpanded ? "none" : "block";
+ }
+ if (rotatingIcon) {
+ rotatingIcon.classList.toggle("rotate-180", isRotating ? isExpanded : !isExpanded);
+ }
+};
+
+// Helper function to toggle accordion state
+var toggleAccordionState = function toggleAccordionState(targetElement, button, isExpanded) {
+ targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + "px" : "0";
+ button.setAttribute("aria-expanded", isExpanded);
+ handleIcons(button, isExpanded);
+};
+
+// Function to toggle accordion items
+function toggleAccordion(event) {
+ if (event.currentTarget.getAttribute("aria-disabled") === "true") return;
+ var targetID = event.currentTarget.getAttribute("data-dui-accordion-target");
+ var parentElement = event.currentTarget.closest("[data-dui-accordion-container]");
+ var mode = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute("data-dui-accordion-mode");
+ if (targetID !== null && targetID !== void 0 && targetID.startsWith("#")) {
+ var targetElement = document.querySelector(targetID);
+ var isExpanded = event.currentTarget.getAttribute("aria-expanded") === "true";
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ var otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetID) {
+ var otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+ if (targetElement) {
+ toggleAccordionState(targetElement, event.currentTarget, !isExpanded);
+ }
+ }
+}
+
+// Function to manually toggle accordion item by ID
+function toggleAccordionById(targetId) {
+ targetId = targetId.startsWith('#') ? targetId : '#' + targetId;
+ var targetElement = document.querySelector(targetId);
+ var toggleButton = document.querySelector("[data-dui-accordion-target=\"".concat(targetId, "\"]"));
+ if ((toggleButton === null || toggleButton === void 0 ? void 0 : toggleButton.getAttribute("aria-disabled")) === "true" || !targetElement || !toggleButton) return;
+ var isExpanded = toggleButton.getAttribute("aria-expanded") === "true";
+ var parentElement = toggleButton.closest("[data-dui-accordion-container]");
+ var mode = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute("data-dui-accordion-mode");
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ var otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetId) {
+ var otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+ toggleAccordionState(targetElement, toggleButton, !isExpanded);
+}
+
+// Function to initialize accordion functionality
+function initAccordion() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ if (!initializedAccordionElements.has(button)) {
+ button.addEventListener("click", toggleAccordion);
+ initializedAccordionElements.add(button);
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ var isExpanded = button.getAttribute("aria-expanded") === "true";
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, isExpanded);
+ }
+ }
+ });
+ document.querySelectorAll("[data-dui-accordion-container]").forEach(function (container) {
+ var mode = container.getAttribute("data-dui-accordion-mode");
+ var buttons = container.querySelectorAll("[data-dui-accordion-toggle]");
+ if (mode === "exclusive") {
+ var expandedButtons = Array.from(buttons).filter(function (btn) {
+ return btn.getAttribute("aria-expanded") === "true";
+ });
+ expandedButtons.slice(1).forEach(function (button) {
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, false);
+ }
+ });
+ } else if (mode === "all-open") {
+ buttons.forEach(function (button) {
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, true);
+ }
+ });
+ }
+ });
+}
+
+// Function to cleanup accordion functionality
+function cleanupAccordions() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ if (initializedAccordionElements.has(button)) {
+ button.removeEventListener("click", toggleAccordion);
+ initializedAccordionElements["delete"](button);
+ }
+ });
+}
+
+// Make toggleAccordionById available globally
+if (typeof window !== "undefined") {
+ window.toggleAccordionById = toggleAccordionById;
+ document.addEventListener("DOMContentLoaded", function () {
+ initAccordion();
+ new MutationObserver(initAccordion).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+}
+
+// Stepper Component
+var initializedStepperElements = new WeakSet();
+function updateStepperState(container) {
+ var steps = container.querySelectorAll("[data-step]");
+ var stepContents = container.querySelectorAll("[data-step-content]");
+ var prevButtons = container.querySelectorAll("[data-stepper-prev]");
+ var nextButtons = container.querySelectorAll("[data-stepper-next]");
+ var currentStep = parseInt(container.dataset.currentStep || "1", 10);
+ function updateState() {
+ // Update step circles and connector lines
+ steps.forEach(function (step, index) {
+ var stepNumber = index + 1;
+ step.dataset.active = stepNumber === currentStep;
+ step.dataset.completed = stepNumber < currentStep;
+ step.setAttribute("aria-disabled", stepNumber > currentStep);
+ });
+
+ // Update step content visibility
+ stepContents.forEach(function (content) {
+ var contentStep = parseInt(content.dataset.stepContent, 10);
+ if (contentStep === currentStep) {
+ content.classList.remove("hidden");
+ } else {
+ content.classList.add("hidden");
+ }
+ });
+
+ // Enable/disable buttons based on step
+ prevButtons.forEach(function (button) {
+ button.disabled = currentStep === 1;
+ });
+ nextButtons.forEach(function (button) {
+ button.disabled = currentStep === steps.length;
+ });
+ }
+
+ // Event listeners for buttons
+ function onNextButtonClick() {
+ if (currentStep < steps.length) {
+ currentStep++;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+ function onPrevButtonClick() {
+ if (currentStep > 1) {
+ currentStep--;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+ nextButtons.forEach(function (button) {
+ button.addEventListener("click", onNextButtonClick);
+ });
+ prevButtons.forEach(function (button) {
+ button.addEventListener("click", onPrevButtonClick);
+ });
+
+ // Store references to cleanup
+ container.__stepperCleanup = function () {
+ nextButtons.forEach(function (button) {
+ button.removeEventListener("click", onNextButtonClick);
+ });
+ prevButtons.forEach(function (button) {
+ button.removeEventListener("click", onPrevButtonClick);
+ });
+ };
+
+ // Initialize the state
+ updateState();
+}
+
+// Function to initialize all steppers
+function initStepper() {
+ document.querySelectorAll("[data-stepper-container]").forEach(function (container) {
+ if (!initializedStepperElements.has(container)) {
+ initializedStepperElements.add(container);
+
+ // Set initial step based on attribute
+ var initialStep = parseInt(container.getAttribute("data-initial-step") || "1", 10);
+ container.dataset.currentStep = initialStep;
+ updateStepperState(container);
+ }
+ });
+}
+
+// Cleanup function to remove all steppers
+function cleanupSteppers() {
+ document.querySelectorAll("[data-stepper-container]").forEach(function (container) {
+ if (container.__stepperCleanup) {
+ container.__stepperCleanup();
+ delete container.__stepperCleanup;
+ }
+ initializedStepperElements["delete"](container);
+ });
+}
+
+// Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements
+if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", function () {
+ initStepper();
+ new MutationObserver(initStepper).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+}
+
+// Gallery component
+var initializedElements = new WeakSet();
+function changeMainImage(event) {
+ var thumbnail = event.currentTarget;
+ var mainImage = document.querySelector('[data-main-image]');
+ if (mainImage) {
+ // Change the main image's src to the clicked thumbnail's src
+ mainImage.src = thumbnail.src;
+
+ // Optional: Add an "active" class to the clicked thumbnail
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumb) {
+ thumb.classList.remove('active-thumbnail');
+ });
+ thumbnail.classList.add('active-thumbnail');
+ }
+}
+function initGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumbnail) {
+ if (!initializedElements.has(thumbnail)) {
+ thumbnail.addEventListener('click', changeMainImage);
+ initializedElements.add(thumbnail);
+ }
+ });
+}
+function cleanupGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumbnail) {
+ if (initializedElements.has(thumbnail)) {
+ thumbnail.removeEventListener('click', changeMainImage);
+ initializedElements["delete"](thumbnail);
+ }
+ });
+}
+
+// Auto-initialize on DOMContentLoaded and observe dynamically added elements
+if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", function () {
+ initGallery(); // Initialize gallery after DOM is loaded
+
+ // Observe the DOM for dynamically added thumbnails
+ var observer = new MutationObserver(function () {
+ initGallery(); // Re-initialize gallery when new elements are added
+ });
+ observer.observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+}
+
// Combine all features into a global object
var DavidAI = {
initAlert: initAlert,
@@ -1207,7 +1504,13 @@ var DavidAI = {
initTabs: initTabs,
cleanupTabs: cleanupTabs,
initModal: initModal,
- cleanupModals: cleanupModals
+ cleanupModals: cleanupModals,
+ initAccordion: initAccordion,
+ cleanupAccordions: cleanupAccordions,
+ initStepper: initStepper,
+ cleanupSteppers: cleanupSteppers,
+ initGallery: initGallery,
+ cleanupGallery: cleanupGallery
};
// **Global Initialization Function**
@@ -1217,7 +1520,9 @@ function initDavidAI() {
initCollapse();
initTabs();
initModal();
-
+ initAccordion();
+ initStepper();
+ initGallery();
// Load Popper.js once, then initialize Popper-dependent components
loadPopperJs().then(function () {
initDropdowns();
@@ -1238,11 +1543,14 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
var observer = new MutationObserver(function () {
initAlert();
initCollapse();
+ initAccordion();
+ initStepper();
initTabs();
initModal();
initDropdowns();
initPopovers();
initTooltips();
+ initGallery();
});
observer.observe(document.body, {
childList: true,
@@ -1259,5 +1567,5 @@ var index = _objectSpread2(_objectSpread2({}, DavidAI), {}, {
initDavidAI: initDavidAI
});
-export { cleanupDropdowns, cleanupModals, cleanupPopovers, cleanupTabs, cleanupTooltips, index as default, initAlert, initCollapse, initDavidAI, initDropdowns, initModal, initPopovers, initTabs, initTooltips };
+export { cleanupAccordions, cleanupDropdowns, cleanupGallery, cleanupModals, cleanupPopovers, cleanupSteppers, cleanupTabs, cleanupTooltips, index as default, initAccordion, initAlert, initCollapse, initDavidAI, initDropdowns, initGallery, initModal, initPopovers, initStepper, initTabs, initTooltips };
//# sourceMappingURL=david-ai.esm.js.map
diff --git a/packages/dist/david-ai.esm.js.map b/packages/dist/david-ai.esm.js.map
index 74e2236..70ee289 100644
--- a/packages/dist/david-ai.esm.js.map
+++ b/packages/dist/david-ai.esm.js.map
@@ -1 +1 @@
-{"version":3,"file":"david-ai.esm.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","_createClass","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_callee$","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","isExpanded","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","loadAndInitDropdowns","_loadAndInitDropdowns","_callee2","_callee2$","_context2","observer","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","closePopover","filter","p","event","cleanupPopovers","loadAndInitPopovers","_loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","showTooltip","_showTooltip","contentClone","warn","hideTooltip","t","cleanupTooltips","loadAndInitTooltips","_loadAndInitTooltips","initializedElements","closeAlert","currentTarget","alert","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","tabList","tabLinks","tabContents","indicator","isVertical","updateIndicator","link","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","activateTab","item","content","targetContent","getElementById","initializeTabGroup","activeLink","length","preventDefault","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","DavidAI","initDavidAI","then","_objectSpread"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;;AAEA;AACA,IAAI,OAAOvG,MAAM,KAAK,WAAW,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AACpEA,EAAAA,QAAQ,CAAC0C,gBAAgB,CAAC,kBAAkB,EAAE,YAAM;AAClD;AACAsJ,IAAAA,WAAW,EAAE,CAAA;;AAEb;AACA,IAAA,IAAMvH,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;AAC1C6D,MAAAA,SAAS,EAAE,CAAA;AACXS,MAAAA,YAAY,EAAE,CAAA;AACdE,MAAAA,QAAQ,EAAE,CAAA;AACV2C,MAAAA,SAAS,EAAE,CAAA;AACXhI,MAAAA,aAAa,EAAE,CAAA;AACfoB,MAAAA,YAAY,EAAE,CAAA;AACdkC,MAAAA,YAAY,EAAE,CAAA;AAChB,KAAC,CAAC,CAAA;AAEF1C,IAAAA,QAAQ,CAACE,OAAO,CAAC3E,QAAQ,CAAC4E,IAAI,EAAE;AAAEC,MAAAA,SAAS,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;;AAEnE;AACAjF,IAAAA,MAAM,CAACkM,OAAO,GAAAG,cAAA,CAAAA,cAAA,KAAQH,OAAO,CAAA,EAAA,EAAA,EAAA;AAAEC,MAAAA,WAAW,EAAXA,WAAAA;KAAa,CAAA,CAAA;AAC9C,GAAC,CAAC,CAAA;AACJ,CAAA;AAEA,YAAAE,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAoBH,OAAO,CAAA,EAAA,EAAA,EAAA;AAAEC,EAAAA,WAAW,EAAXA,WAAAA;AAAW,CAAA,CAAA;;;;"}
\ No newline at end of file
+{"version":3,"file":"david-ai.esm.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/accordion/accordion.js","../src/stepper/stepper.js","../src/gallery/gallery.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Accordion Component\nconst initializedAccordionElements = new WeakSet();\n\n// Helper function to handle icons\nconst handleIcons = (button, isExpanded, isRotating = false) => {\n const openIcon = button.querySelector(\"[data-dui-accordion-icon-open]\");\n const closeIcon = button.querySelector(\"[data-dui-accordion-icon-close]\");\n const rotatingIcon = button.querySelector(\"[data-dui-accordion-icon]\");\n\n if (openIcon && closeIcon) {\n openIcon.style.display = isExpanded ? \"block\" : \"none\";\n closeIcon.style.display = isExpanded ? \"none\" : \"block\";\n }\n if (rotatingIcon) {\n rotatingIcon.classList.toggle(\"rotate-180\", isRotating ? isExpanded : !isExpanded);\n }\n};\n\n// Helper function to toggle accordion state\nconst toggleAccordionState = (targetElement, button, isExpanded) => {\n targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + \"px\" : \"0\";\n button.setAttribute(\"aria-expanded\", isExpanded);\n handleIcons(button, isExpanded);\n};\n\n// Function to toggle accordion items\nexport function toggleAccordion(event) {\n if (event.currentTarget.getAttribute(\"aria-disabled\") === \"true\") return;\n\n const targetID = event.currentTarget.getAttribute(\"data-dui-accordion-target\");\n const parentElement = event.currentTarget.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (targetID?.startsWith(\"#\")) {\n const targetElement = document.querySelector(targetID);\n const isExpanded = event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetID) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n if (targetElement) {\n toggleAccordionState(targetElement, event.currentTarget, !isExpanded);\n }\n }\n}\n\n// Function to manually toggle accordion item by ID\nexport function toggleAccordionById(targetId) {\n targetId = targetId.startsWith('#') ? targetId : '#' + targetId;\n \n const targetElement = document.querySelector(targetId);\n const toggleButton = document.querySelector(`[data-dui-accordion-target=\"${targetId}\"]`);\n \n if (toggleButton?.getAttribute(\"aria-disabled\") === \"true\" || !targetElement || !toggleButton) return;\n \n const isExpanded = toggleButton.getAttribute(\"aria-expanded\") === \"true\";\n const parentElement = toggleButton.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetId) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n toggleAccordionState(targetElement, toggleButton, !isExpanded);\n}\n\n// Function to initialize accordion functionality\nexport function initAccordion() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (!initializedAccordionElements.has(button)) {\n button.addEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.add(button);\n\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n const isExpanded = button.getAttribute(\"aria-expanded\") === \"true\";\n \n if (targetElement) {\n toggleAccordionState(targetElement, button, isExpanded);\n }\n }\n });\n\n document.querySelectorAll(\"[data-dui-accordion-container]\").forEach(container => {\n const mode = container.getAttribute(\"data-dui-accordion-mode\");\n const buttons = container.querySelectorAll(\"[data-dui-accordion-toggle]\");\n\n if (mode === \"exclusive\") {\n const expandedButtons = Array.from(buttons).filter(btn => \n btn.getAttribute(\"aria-expanded\") === \"true\"\n );\n \n expandedButtons.slice(1).forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, false);\n }\n });\n } else if (mode === \"all-open\") {\n buttons.forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, true);\n }\n });\n }\n });\n}\n\n// Function to cleanup accordion functionality\nexport function cleanupAccordions() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (initializedAccordionElements.has(button)) {\n button.removeEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.delete(button);\n }\n });\n}\n\n// Make toggleAccordionById available globally\nif (typeof window !== \"undefined\") {\n window.toggleAccordionById = toggleAccordionById;\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n initAccordion();\n new MutationObserver(initAccordion).observe(document.body, { \n childList: true, \n subtree: true \n });\n });\n}\n","// Stepper Component\nconst initializedStepperElements = new WeakSet();\n\nfunction updateStepperState(container) {\n const steps = container.querySelectorAll(\"[data-step]\");\n const stepContents = container.querySelectorAll(\"[data-step-content]\");\n const prevButtons = container.querySelectorAll(\"[data-stepper-prev]\");\n const nextButtons = container.querySelectorAll(\"[data-stepper-next]\");\n let currentStep = parseInt(container.dataset.currentStep || \"1\", 10);\n\n function updateState() {\n // Update step circles and connector lines\n steps.forEach((step, index) => {\n const stepNumber = index + 1;\n step.dataset.active = stepNumber === currentStep;\n step.dataset.completed = stepNumber < currentStep;\n step.setAttribute(\"aria-disabled\", stepNumber > currentStep);\n });\n\n // Update step content visibility\n stepContents.forEach((content) => {\n const contentStep = parseInt(content.dataset.stepContent, 10);\n if (contentStep === currentStep) {\n content.classList.remove(\"hidden\");\n } else {\n content.classList.add(\"hidden\");\n }\n });\n\n // Enable/disable buttons based on step\n prevButtons.forEach((button) => {\n button.disabled = currentStep === 1;\n });\n\n nextButtons.forEach((button) => {\n button.disabled = currentStep === steps.length;\n });\n }\n\n // Event listeners for buttons\n function onNextButtonClick() {\n if (currentStep < steps.length) {\n currentStep++;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n function onPrevButtonClick() {\n if (currentStep > 1) {\n currentStep--;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n nextButtons.forEach((button) => {\n button.addEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.addEventListener(\"click\", onPrevButtonClick);\n });\n\n // Store references to cleanup\n container.__stepperCleanup = () => {\n nextButtons.forEach((button) => {\n button.removeEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.removeEventListener(\"click\", onPrevButtonClick);\n });\n };\n\n // Initialize the state\n updateState();\n}\n\n// Function to initialize all steppers\nexport function initStepper() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (!initializedStepperElements.has(container)) {\n initializedStepperElements.add(container);\n\n // Set initial step based on attribute\n const initialStep = parseInt(container.getAttribute(\"data-initial-step\") || \"1\", 10);\n container.dataset.currentStep = initialStep;\n\n updateStepperState(container);\n }\n });\n}\n\n// Cleanup function to remove all steppers\nexport function cleanupSteppers() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (container.__stepperCleanup) {\n container.__stepperCleanup();\n delete container.__stepperCleanup;\n }\n\n initializedStepperElements.delete(container);\n });\n}\n\n// Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initStepper();\n new MutationObserver(initStepper).observe(document.body, {\n childList: true,\n subtree: true,\n });\n });\n}","// Gallery component\nconst initializedElements = new WeakSet();\n\nexport function changeMainImage(event) {\n const thumbnail = event.currentTarget;\n const mainImage = document.querySelector('[data-main-image]');\n\n if (mainImage) {\n // Change the main image's src to the clicked thumbnail's src\n mainImage.src = thumbnail.src;\n\n // Optional: Add an \"active\" class to the clicked thumbnail\n document.querySelectorAll('[data-thumbnail]').forEach((thumb) => {\n thumb.classList.remove('active-thumbnail');\n });\n thumbnail.classList.add('active-thumbnail');\n }\n}\n\nexport function initGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (!initializedElements.has(thumbnail)) {\n thumbnail.addEventListener('click', changeMainImage);\n initializedElements.add(thumbnail);\n }\n });\n}\n\nexport function cleanupGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (initializedElements.has(thumbnail)) {\n thumbnail.removeEventListener('click', changeMainImage);\n initializedElements.delete(thumbnail);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initGallery(); // Initialize gallery after DOM is loaded\n\n // Observe the DOM for dynamically added thumbnails\n const observer = new MutationObserver(() => {\n initGallery(); // Re-initialize gallery when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\nimport { initAccordion, cleanupAccordions } from './accordion/accordion.js';\nimport { initStepper, cleanupSteppers } from './stepper/stepper.js';\nimport { initGallery, cleanupGallery } from './gallery/gallery.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initAccordion();\n initStepper();\n initGallery();\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initAccordion();\n initStepper();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n initGallery();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","_createClass","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_callee$","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","isExpanded","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","loadAndInitDropdowns","_loadAndInitDropdowns","_callee2","_callee2$","_context2","observer","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","closePopover","filter","p","event","cleanupPopovers","loadAndInitPopovers","_loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","showTooltip","_showTooltip","contentClone","warn","hideTooltip","t","cleanupTooltips","loadAndInitTooltips","_loadAndInitTooltips","initializedElements","closeAlert","currentTarget","alert","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","tabList","tabLinks","tabContents","indicator","isVertical","updateIndicator","link","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","activateTab","item","content","targetContent","getElementById","initializeTabGroup","activeLink","length","preventDefault","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","initializedAccordionElements","handleIcons","isRotating","undefined","openIcon","closeIcon","rotatingIcon","display","toggleAccordionState","targetElement","toggleAccordion","targetID","parentElement","mode","otherTargetID","otherElement","toggleAccordionById","targetId","toggleButton","initAccordion","container","buttons","expandedButtons","Array","from","btn","slice","cleanupAccordions","initializedStepperElements","updateStepperState","steps","stepContents","prevButtons","nextButtons","currentStep","parseInt","dataset","updateState","step","index","stepNumber","active","completed","contentStep","stepContent","disabled","onNextButtonClick","onPrevButtonClick","__stepperCleanup","initStepper","initialStep","cleanupSteppers","changeMainImage","thumbnail","mainImage","thumb","initGallery","cleanupGallery","DavidAI","initDavidAI","then","_objectSpread"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,YAAY,GAAG,KAAK,CAAC;AACzB,IAAIC,WAAW,GAAG,IAAI,CAAC;;AAEhB,SAASC,YAAYA,GAAG;AAC7B,EAAA,IAAIF,YAAY,E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O,CAAC3E,QAAQ,CAAC4E,IAAI,EAAE;AAAEC,MAAAA,SAAS,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;;AAEnE;AACAjF,IAAAA,MAAM,CAAC4P,OAAO,GAAAG,cAAA,CAAAA,cAAA,KAAQH,OAAO,CAAA,EAAA,EAAA,EAAA;AAAEC,MAAAA,WAAW,EAAXA,WAAAA;KAAa,CAAA,CAAA;AAC9C,GAAC,CAAC,CAAA;AACJ,CAAA;AAEA,YAAAE,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAoBH,OAAO,CAAA,EAAA,EAAA,EAAA;AAAEC,EAAAA,WAAW,EAAXA,WAAAA;AAAW,CAAA,CAAA;;;;"}
\ No newline at end of file
diff --git a/packages/dist/david-ai.js b/packages/dist/david-ai.js
index 31b497d..725df6c 100644
--- a/packages/dist/david-ai.js
+++ b/packages/dist/david-ai.js
@@ -1,3 +1,10 @@
+
+/*!
+ * David AI JavaScript Library v1.0.5
+ * (c) 2024 David AI - Creative Tim
+ * Released under the MIT License.
+ */
+
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -905,7 +912,7 @@
}
// Alert component
- var initializedElements$1 = new WeakSet();
+ var initializedElements$2 = new WeakSet();
function closeAlert(event) {
var button = event.currentTarget;
var alert = button.closest('[role="alert"]');
@@ -915,9 +922,9 @@
}
function initAlert() {
document.querySelectorAll("[data-dui-dismiss='alert']").forEach(function (button) {
- if (!initializedElements$1.has(button)) {
+ if (!initializedElements$2.has(button)) {
button.addEventListener("click", closeAlert);
- initializedElements$1.add(button);
+ initializedElements$2.add(button);
}
});
}
@@ -939,7 +946,7 @@
}
// Collapse component
- var initializedElements = new WeakSet();
+ var initializedElements$1 = new WeakSet();
function toggleCollapse(event) {
var collapseID = event.currentTarget.getAttribute("data-dui-target");
if (collapseID && collapseID.startsWith("#")) {
@@ -962,9 +969,9 @@
}
function initCollapse() {
document.querySelectorAll("[data-dui-toggle='collapse']").forEach(function (button) {
- if (!initializedElements.has(button)) {
+ if (!initializedElements$1.has(button)) {
button.addEventListener("click", toggleCollapse);
- initializedElements.add(button); // Mark as initialized
+ initializedElements$1.add(button); // Mark as initialized
}
});
}
@@ -1200,6 +1207,296 @@
});
}
+ // Accordion Component
+ var initializedAccordionElements = new WeakSet();
+
+ // Helper function to handle icons
+ var handleIcons = function handleIcons(button, isExpanded) {
+ var isRotating = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
+ var openIcon = button.querySelector("[data-dui-accordion-icon-open]");
+ var closeIcon = button.querySelector("[data-dui-accordion-icon-close]");
+ var rotatingIcon = button.querySelector("[data-dui-accordion-icon]");
+ if (openIcon && closeIcon) {
+ openIcon.style.display = isExpanded ? "block" : "none";
+ closeIcon.style.display = isExpanded ? "none" : "block";
+ }
+ if (rotatingIcon) {
+ rotatingIcon.classList.toggle("rotate-180", isRotating ? isExpanded : !isExpanded);
+ }
+ };
+
+ // Helper function to toggle accordion state
+ var toggleAccordionState = function toggleAccordionState(targetElement, button, isExpanded) {
+ targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + "px" : "0";
+ button.setAttribute("aria-expanded", isExpanded);
+ handleIcons(button, isExpanded);
+ };
+
+ // Function to toggle accordion items
+ function toggleAccordion(event) {
+ if (event.currentTarget.getAttribute("aria-disabled") === "true") return;
+ var targetID = event.currentTarget.getAttribute("data-dui-accordion-target");
+ var parentElement = event.currentTarget.closest("[data-dui-accordion-container]");
+ var mode = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute("data-dui-accordion-mode");
+ if (targetID !== null && targetID !== void 0 && targetID.startsWith("#")) {
+ var targetElement = document.querySelector(targetID);
+ var isExpanded = event.currentTarget.getAttribute("aria-expanded") === "true";
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ var otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetID) {
+ var otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+ if (targetElement) {
+ toggleAccordionState(targetElement, event.currentTarget, !isExpanded);
+ }
+ }
+ }
+
+ // Function to manually toggle accordion item by ID
+ function toggleAccordionById(targetId) {
+ targetId = targetId.startsWith('#') ? targetId : '#' + targetId;
+ var targetElement = document.querySelector(targetId);
+ var toggleButton = document.querySelector("[data-dui-accordion-target=\"".concat(targetId, "\"]"));
+ if ((toggleButton === null || toggleButton === void 0 ? void 0 : toggleButton.getAttribute("aria-disabled")) === "true" || !targetElement || !toggleButton) return;
+ var isExpanded = toggleButton.getAttribute("aria-expanded") === "true";
+ var parentElement = toggleButton.closest("[data-dui-accordion-container]");
+ var mode = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute("data-dui-accordion-mode");
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ var otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetId) {
+ var otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+ toggleAccordionState(targetElement, toggleButton, !isExpanded);
+ }
+
+ // Function to initialize accordion functionality
+ function initAccordion() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ if (!initializedAccordionElements.has(button)) {
+ button.addEventListener("click", toggleAccordion);
+ initializedAccordionElements.add(button);
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ var isExpanded = button.getAttribute("aria-expanded") === "true";
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, isExpanded);
+ }
+ }
+ });
+ document.querySelectorAll("[data-dui-accordion-container]").forEach(function (container) {
+ var mode = container.getAttribute("data-dui-accordion-mode");
+ var buttons = container.querySelectorAll("[data-dui-accordion-toggle]");
+ if (mode === "exclusive") {
+ var expandedButtons = Array.from(buttons).filter(function (btn) {
+ return btn.getAttribute("aria-expanded") === "true";
+ });
+ expandedButtons.slice(1).forEach(function (button) {
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, false);
+ }
+ });
+ } else if (mode === "all-open") {
+ buttons.forEach(function (button) {
+ var targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, true);
+ }
+ });
+ }
+ });
+ }
+
+ // Function to cleanup accordion functionality
+ function cleanupAccordions() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(function (button) {
+ if (initializedAccordionElements.has(button)) {
+ button.removeEventListener("click", toggleAccordion);
+ initializedAccordionElements["delete"](button);
+ }
+ });
+ }
+
+ // Make toggleAccordionById available globally
+ if (typeof window !== "undefined") {
+ window.toggleAccordionById = toggleAccordionById;
+ document.addEventListener("DOMContentLoaded", function () {
+ initAccordion();
+ new MutationObserver(initAccordion).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+ }
+
+ // Stepper Component
+ var initializedStepperElements = new WeakSet();
+ function updateStepperState(container) {
+ var steps = container.querySelectorAll("[data-step]");
+ var stepContents = container.querySelectorAll("[data-step-content]");
+ var prevButtons = container.querySelectorAll("[data-stepper-prev]");
+ var nextButtons = container.querySelectorAll("[data-stepper-next]");
+ var currentStep = parseInt(container.dataset.currentStep || "1", 10);
+ function updateState() {
+ // Update step circles and connector lines
+ steps.forEach(function (step, index) {
+ var stepNumber = index + 1;
+ step.dataset.active = stepNumber === currentStep;
+ step.dataset.completed = stepNumber < currentStep;
+ step.setAttribute("aria-disabled", stepNumber > currentStep);
+ });
+
+ // Update step content visibility
+ stepContents.forEach(function (content) {
+ var contentStep = parseInt(content.dataset.stepContent, 10);
+ if (contentStep === currentStep) {
+ content.classList.remove("hidden");
+ } else {
+ content.classList.add("hidden");
+ }
+ });
+
+ // Enable/disable buttons based on step
+ prevButtons.forEach(function (button) {
+ button.disabled = currentStep === 1;
+ });
+ nextButtons.forEach(function (button) {
+ button.disabled = currentStep === steps.length;
+ });
+ }
+
+ // Event listeners for buttons
+ function onNextButtonClick() {
+ if (currentStep < steps.length) {
+ currentStep++;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+ function onPrevButtonClick() {
+ if (currentStep > 1) {
+ currentStep--;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+ nextButtons.forEach(function (button) {
+ button.addEventListener("click", onNextButtonClick);
+ });
+ prevButtons.forEach(function (button) {
+ button.addEventListener("click", onPrevButtonClick);
+ });
+
+ // Store references to cleanup
+ container.__stepperCleanup = function () {
+ nextButtons.forEach(function (button) {
+ button.removeEventListener("click", onNextButtonClick);
+ });
+ prevButtons.forEach(function (button) {
+ button.removeEventListener("click", onPrevButtonClick);
+ });
+ };
+
+ // Initialize the state
+ updateState();
+ }
+
+ // Function to initialize all steppers
+ function initStepper() {
+ document.querySelectorAll("[data-stepper-container]").forEach(function (container) {
+ if (!initializedStepperElements.has(container)) {
+ initializedStepperElements.add(container);
+
+ // Set initial step based on attribute
+ var initialStep = parseInt(container.getAttribute("data-initial-step") || "1", 10);
+ container.dataset.currentStep = initialStep;
+ updateStepperState(container);
+ }
+ });
+ }
+
+ // Cleanup function to remove all steppers
+ function cleanupSteppers() {
+ document.querySelectorAll("[data-stepper-container]").forEach(function (container) {
+ if (container.__stepperCleanup) {
+ container.__stepperCleanup();
+ delete container.__stepperCleanup;
+ }
+ initializedStepperElements["delete"](container);
+ });
+ }
+
+ // Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements
+ if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", function () {
+ initStepper();
+ new MutationObserver(initStepper).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+ }
+
+ // Gallery component
+ var initializedElements = new WeakSet();
+ function changeMainImage(event) {
+ var thumbnail = event.currentTarget;
+ var mainImage = document.querySelector('[data-main-image]');
+ if (mainImage) {
+ // Change the main image's src to the clicked thumbnail's src
+ mainImage.src = thumbnail.src;
+
+ // Optional: Add an "active" class to the clicked thumbnail
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumb) {
+ thumb.classList.remove('active-thumbnail');
+ });
+ thumbnail.classList.add('active-thumbnail');
+ }
+ }
+ function initGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumbnail) {
+ if (!initializedElements.has(thumbnail)) {
+ thumbnail.addEventListener('click', changeMainImage);
+ initializedElements.add(thumbnail);
+ }
+ });
+ }
+ function cleanupGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach(function (thumbnail) {
+ if (initializedElements.has(thumbnail)) {
+ thumbnail.removeEventListener('click', changeMainImage);
+ initializedElements["delete"](thumbnail);
+ }
+ });
+ }
+
+ // Auto-initialize on DOMContentLoaded and observe dynamically added elements
+ if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", function () {
+ initGallery(); // Initialize gallery after DOM is loaded
+
+ // Observe the DOM for dynamically added thumbnails
+ var observer = new MutationObserver(function () {
+ initGallery(); // Re-initialize gallery when new elements are added
+ });
+ observer.observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+ }
+
// Combine all features into a global object
var DavidAI = {
initAlert: initAlert,
@@ -1213,7 +1510,13 @@
initTabs: initTabs,
cleanupTabs: cleanupTabs,
initModal: initModal,
- cleanupModals: cleanupModals
+ cleanupModals: cleanupModals,
+ initAccordion: initAccordion,
+ cleanupAccordions: cleanupAccordions,
+ initStepper: initStepper,
+ cleanupSteppers: cleanupSteppers,
+ initGallery: initGallery,
+ cleanupGallery: cleanupGallery
};
// **Global Initialization Function**
@@ -1223,7 +1526,9 @@
initCollapse();
initTabs();
initModal();
-
+ initAccordion();
+ initStepper();
+ initGallery();
// Load Popper.js once, then initialize Popper-dependent components
loadPopperJs().then(function () {
initDropdowns();
@@ -1244,11 +1549,14 @@
var observer = new MutationObserver(function () {
initAlert();
initCollapse();
+ initAccordion();
+ initStepper();
initTabs();
initModal();
initDropdowns();
initPopovers();
initTooltips();
+ initGallery();
});
observer.observe(document.body, {
childList: true,
@@ -1265,18 +1573,24 @@
initDavidAI: initDavidAI
});
+ exports.cleanupAccordions = cleanupAccordions;
exports.cleanupDropdowns = cleanupDropdowns;
+ exports.cleanupGallery = cleanupGallery;
exports.cleanupModals = cleanupModals;
exports.cleanupPopovers = cleanupPopovers;
+ exports.cleanupSteppers = cleanupSteppers;
exports.cleanupTabs = cleanupTabs;
exports.cleanupTooltips = cleanupTooltips;
exports.default = index;
+ exports.initAccordion = initAccordion;
exports.initAlert = initAlert;
exports.initCollapse = initCollapse;
exports.initDavidAI = initDavidAI;
exports.initDropdowns = initDropdowns;
+ exports.initGallery = initGallery;
exports.initModal = initModal;
exports.initPopovers = initPopovers;
+ exports.initStepper = initStepper;
exports.initTabs = initTabs;
exports.initTooltips = initTooltips;
diff --git a/packages/dist/david-ai.js.map b/packages/dist/david-ai.js.map
index 7e4d00a..9e445c9 100644
--- a/packages/dist/david-ai.js.map
+++ b/packages/dist/david-ai.js.map
@@ -1 +1 @@
-{"version":3,"file":"david-ai.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","_createClass","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_callee$","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","isExpanded","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","loadAndInitDropdowns","_loadAndInitDropdowns","_callee2","_callee2$","_context2","observer","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","closePopover","filter","p","event","cleanupPopovers","loadAndInitPopovers","_loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","showTooltip","_showTooltip","contentClone","warn","hideTooltip","t","cleanupTooltips","loadAndInitTooltips","_loadAndInitTooltips","initializedElements","closeAlert","currentTarget","alert","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","tabList","tabLinks","tabContents","indicator","isVertical","updateIndicator","link","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","activateTab","item","content","targetContent","getElementById","initializeTabGroup","activeLink","length","preventDefault","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","DavidAI","initDavidAI","then","_objectSpread"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAIA,YAAY,GAAG,KAAK,CAAC;EACzB,IAAIC,WAAW,GAAG,IAAI,CAAC;;EAEhB,SAASC,YAAYA,GAAG;EAC7B,EAAA,IAAIF,YAAY,EAAE;MAChB,OAAOC,WAAW,CAAC;EACrB,GAAA;IACAD,YAAY,GAAG,IAAI,CAAC;;IAEpBC,WAAW,GAAG,IAAIE,OAAO,CAAC,UAAUC,OAAO,EAAEC,MAAM,EAAE;MACnD,IAA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AA,SAAS,EAAE,IAAI;EAAEC,MAAAA,OAAO,EAAE,IAAA;EAAK,KAAC,CAAC,CAAA;;EAEnE;EACAjF,IAAAA,MAAM,CAACkM,OAAO,GAAAG,cAAA,CAAAA,cAAA,KAAQH,OAAO,CAAA,EAAA,EAAA,EAAA;EAAEC,MAAAA,WAAW,EAAXA,WAAAA;OAAa,CAAA,CAAA;EAC9C,GAAC,CAAC,CAAA;EACJ,CAAA;AAEA,cAAAE,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAoBH,OAAO,CAAA,EAAA,EAAA,EAAA;EAAEC,EAAAA,WAAW,EAAXA,WAAAA;EAAW,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
+{"version":3,"file":"david-ai.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/accordion/accordion.js","../src/stepper/stepper.js","../src/gallery/gallery.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Accordion Component\nconst initializedAccordionElements = new WeakSet();\n\n// Helper function to handle icons\nconst handleIcons = (button, isExpanded, isRotating = false) => {\n const openIcon = button.querySelector(\"[data-dui-accordion-icon-open]\");\n const closeIcon = button.querySelector(\"[data-dui-accordion-icon-close]\");\n const rotatingIcon = button.querySelector(\"[data-dui-accordion-icon]\");\n\n if (openIcon && closeIcon) {\n openIcon.style.display = isExpanded ? \"block\" : \"none\";\n closeIcon.style.display = isExpanded ? \"none\" : \"block\";\n }\n if (rotatingIcon) {\n rotatingIcon.classList.toggle(\"rotate-180\", isRotating ? isExpanded : !isExpanded);\n }\n};\n\n// Helper function to toggle accordion state\nconst toggleAccordionState = (targetElement, button, isExpanded) => {\n targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + \"px\" : \"0\";\n button.setAttribute(\"aria-expanded\", isExpanded);\n handleIcons(button, isExpanded);\n};\n\n// Function to toggle accordion items\nexport function toggleAccordion(event) {\n if (event.currentTarget.getAttribute(\"aria-disabled\") === \"true\") return;\n\n const targetID = event.currentTarget.getAttribute(\"data-dui-accordion-target\");\n const parentElement = event.currentTarget.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (targetID?.startsWith(\"#\")) {\n const targetElement = document.querySelector(targetID);\n const isExpanded = event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetID) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n if (targetElement) {\n toggleAccordionState(targetElement, event.currentTarget, !isExpanded);\n }\n }\n}\n\n// Function to manually toggle accordion item by ID\nexport function toggleAccordionById(targetId) {\n targetId = targetId.startsWith('#') ? targetId : '#' + targetId;\n \n const targetElement = document.querySelector(targetId);\n const toggleButton = document.querySelector(`[data-dui-accordion-target=\"${targetId}\"]`);\n \n if (toggleButton?.getAttribute(\"aria-disabled\") === \"true\" || !targetElement || !toggleButton) return;\n \n const isExpanded = toggleButton.getAttribute(\"aria-expanded\") === \"true\";\n const parentElement = toggleButton.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetId) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n toggleAccordionState(targetElement, toggleButton, !isExpanded);\n}\n\n// Function to initialize accordion functionality\nexport function initAccordion() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (!initializedAccordionElements.has(button)) {\n button.addEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.add(button);\n\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n const isExpanded = button.getAttribute(\"aria-expanded\") === \"true\";\n \n if (targetElement) {\n toggleAccordionState(targetElement, button, isExpanded);\n }\n }\n });\n\n document.querySelectorAll(\"[data-dui-accordion-container]\").forEach(container => {\n const mode = container.getAttribute(\"data-dui-accordion-mode\");\n const buttons = container.querySelectorAll(\"[data-dui-accordion-toggle]\");\n\n if (mode === \"exclusive\") {\n const expandedButtons = Array.from(buttons).filter(btn => \n btn.getAttribute(\"aria-expanded\") === \"true\"\n );\n \n expandedButtons.slice(1).forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, false);\n }\n });\n } else if (mode === \"all-open\") {\n buttons.forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, true);\n }\n });\n }\n });\n}\n\n// Function to cleanup accordion functionality\nexport function cleanupAccordions() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (initializedAccordionElements.has(button)) {\n button.removeEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.delete(button);\n }\n });\n}\n\n// Make toggleAccordionById available globally\nif (typeof window !== \"undefined\") {\n window.toggleAccordionById = toggleAccordionById;\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n initAccordion();\n new MutationObserver(initAccordion).observe(document.body, { \n childList: true, \n subtree: true \n });\n });\n}\n","// Stepper Component\nconst initializedStepperElements = new WeakSet();\n\nfunction updateStepperState(container) {\n const steps = container.querySelectorAll(\"[data-step]\");\n const stepContents = container.querySelectorAll(\"[data-step-content]\");\n const prevButtons = container.querySelectorAll(\"[data-stepper-prev]\");\n const nextButtons = container.querySelectorAll(\"[data-stepper-next]\");\n let currentStep = parseInt(container.dataset.currentStep || \"1\", 10);\n\n function updateState() {\n // Update step circles and connector lines\n steps.forEach((step, index) => {\n const stepNumber = index + 1;\n step.dataset.active = stepNumber === currentStep;\n step.dataset.completed = stepNumber < currentStep;\n step.setAttribute(\"aria-disabled\", stepNumber > currentStep);\n });\n\n // Update step content visibility\n stepContents.forEach((content) => {\n const contentStep = parseInt(content.dataset.stepContent, 10);\n if (contentStep === currentStep) {\n content.classList.remove(\"hidden\");\n } else {\n content.classList.add(\"hidden\");\n }\n });\n\n // Enable/disable buttons based on step\n prevButtons.forEach((button) => {\n button.disabled = currentStep === 1;\n });\n\n nextButtons.forEach((button) => {\n button.disabled = currentStep === steps.length;\n });\n }\n\n // Event listeners for buttons\n function onNextButtonClick() {\n if (currentStep < steps.length) {\n currentStep++;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n function onPrevButtonClick() {\n if (currentStep > 1) {\n currentStep--;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n nextButtons.forEach((button) => {\n button.addEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.addEventListener(\"click\", onPrevButtonClick);\n });\n\n // Store references to cleanup\n container.__stepperCleanup = () => {\n nextButtons.forEach((button) => {\n button.removeEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.removeEventListener(\"click\", onPrevButtonClick);\n });\n };\n\n // Initialize the state\n updateState();\n}\n\n// Function to initialize all steppers\nexport function initStepper() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (!initializedStepperElements.has(container)) {\n initializedStepperElements.add(container);\n\n // Set initial step based on attribute\n const initialStep = parseInt(container.getAttribute(\"data-initial-step\") || \"1\", 10);\n container.dataset.currentStep = initialStep;\n\n updateStepperState(container);\n }\n });\n}\n\n// Cleanup function to remove all steppers\nexport function cleanupSteppers() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (container.__stepperCleanup) {\n container.__stepperCleanup();\n delete container.__stepperCleanup;\n }\n\n initializedStepperElements.delete(container);\n });\n}\n\n// Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initStepper();\n new MutationObserver(initStepper).observe(document.body, {\n childList: true,\n subtree: true,\n });\n });\n}","// Gallery component\nconst initializedElements = new WeakSet();\n\nexport function changeMainImage(event) {\n const thumbnail = event.currentTarget;\n const mainImage = document.querySelector('[data-main-image]');\n\n if (mainImage) {\n // Change the main image's src to the clicked thumbnail's src\n mainImage.src = thumbnail.src;\n\n // Optional: Add an \"active\" class to the clicked thumbnail\n document.querySelectorAll('[data-thumbnail]').forEach((thumb) => {\n thumb.classList.remove('active-thumbnail');\n });\n thumbnail.classList.add('active-thumbnail');\n }\n}\n\nexport function initGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (!initializedElements.has(thumbnail)) {\n thumbnail.addEventListener('click', changeMainImage);\n initializedElements.add(thumbnail);\n }\n });\n}\n\nexport function cleanupGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (initializedElements.has(thumbnail)) {\n thumbnail.removeEventListener('click', changeMainImage);\n initializedElements.delete(thumbnail);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initGallery(); // Initialize gallery after DOM is loaded\n\n // Observe the DOM for dynamically added thumbnails\n const observer = new MutationObserver(() => {\n initGallery(); // Re-initialize gallery when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\nimport { initAccordion, cleanupAccordions } from './accordion/accordion.js';\nimport { initStepper, cleanupSteppers } from './stepper/stepper.js';\nimport { initGallery, cleanupGallery } from './gallery/gallery.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initAccordion();\n initStepper();\n initGallery();\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initAccordion();\n initStepper();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n initGallery();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","_createClass","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_callee$","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","isExpanded","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","loadAndInitDropdowns","_loadAndInitDropdowns","_callee2","_callee2$","_context2","observer","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","closePopover","filter","p","event","cleanupPopovers","loadAndInitPopovers","_loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","showTooltip","_showTooltip","contentClone","warn","hideTooltip","t","cleanupTooltips","loadAndInitTooltips","_loadAndInitTooltips","initializedElements","closeAlert","currentTarget","alert","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","tabList","tabLinks","tabContents","indicator","isVertical","updateIndicator","link","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","activateTab","item","content","targetContent","getElementById","initializeTabGroup","activeLink","length","preventDefault","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","initializedAccordionElements","handleIcons","isRotating","undefined","openIcon","closeIcon","rotatingIcon","display","toggleAccordionState","targetElement","toggleAccordion","targetID","parentElement","mode","otherTargetID","otherElement","toggleAccordionById","targetId","toggleButton","initAccordion","container","buttons","expandedButtons","Array","from","btn","slice","cleanupAccordions","initializedStepperElements","updateStepperState","steps","stepContents","prevButtons","nextButtons","currentStep","parseInt","dataset","updateState","step","index","stepNumber","active","completed","contentStep","stepContent","disabled","onNextButtonClick","onPrevButtonClick","__stepperCleanup","initStepper","initialStep","cleanupSteppers","changeMainImage","thumbnail","mainIm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david-ai.min.js
index 0ef55fc..5c669c9 100644
--- a/packages/dist/david-ai.min.js
+++ b/packages/dist/david-ai.min.js
@@ -1,2 +1,7 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).DavidAI={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))}}function r(t,e){for(var n=0;n
=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:q(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var s=!1,l=null;function d(){return s?l:(s=!0,l=new Promise((function(t,e){if(window.Popper)t(window.Popper);else{var n=document.createElement("script");n.src="https://unpkg.com/@popperjs/core@2",n.defer=!0,n.onload=function(){window.Popper=window.Popper||window.Popper,t(window.Popper)},n.onerror=function(){e(new Error("Failed to load Popper.js"))},document.head.appendChild(n)}})))}var f=new WeakSet,p=[],h=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dropdown=e,this.button=this.dropdown.querySelector('[data-dui-toggle="dropdown"]'),this.menu=this.dropdown.querySelector('[data-dui-role="menu"]'),this.popperInstance=null,this.placement=this.dropdown.getAttribute("data-dui-placement")||"bottom-start",this.init()},e=[{key:"init",value:(i=n(c().mark((function t(){var e=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:this.popperInstance=Popper.createPopper(this.button,this.menu,{placement:this.placement,modifiers:[{name:"offset",options:{offset:[0,5]}}]}),this.button.addEventListener("click",(function(t){t.stopPropagation(),e.toggleDropdown()})),document.addEventListener("click",(function(t){e.dropdown.contains(t.target)||e.closeDropdown()})),p.push({dropdown:this.dropdown,popperInstance:this.popperInstance});case 6:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"toggleDropdown",value:function(){"true"===this.button.getAttribute("aria-expanded")?this.closeDropdown():this.openDropdown()}},{key:"openDropdown",value:function(){this.button.setAttribute("aria-expanded","true"),this.menu.hidden=!1,this.menu.classList.remove("hidden"),this.popperInstance.update()}},{key:"closeDropdown",value:function(){this.button.setAttribute("aria-expanded","false"),this.menu.hidden=!0,this.menu.classList.add("hidden")}}],e&&r(t.prototype,e),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,o,i}();function v(){document.querySelectorAll(".dropdown").forEach((function(t){f.has(t)||(new h(t),f.add(t))}))}function y(){p.forEach((function(t){var e=t.dropdown,n=t.popperInstance;n&&n.destroy(),e&&f.delete(e)})),p=[]}function m(){return(m=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:v();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){m.apply(this,arguments)}(),new MutationObserver((function(){v()})).observe(document.body,{childList:!0,subtree:!0})}));var g=new WeakSet,b=[];function w(){document.querySelectorAll("[data-dui-toggle='popover']").forEach((function(t){var e;if(!g.has(t)){var r=t.getAttribute("data-dui-placement")||"top",o=t.getAttribute("data-dui-popover-class")||"popover-default",i=t.getAttribute("data-dui-popover-content"),a=t.hasAttribute("data-dui-open"),u=null,s=null,l=null,f=null!==(e=t.nextElementSibling)&&void 0!==e&&e.matches("[data-dui-popover-content]")?t.nextElementSibling:null;t.addEventListener("click",(function(e){e.stopPropagation(),u?(u&&(u.destroy(),u=null,l&&l.classList.add("hidden"),s.remove(),s=null),b=b.filter((function(e){return e.trigger!==t}))):p()})),a&&p(),g.add(t)}function p(){return h.apply(this,arguments)}function h(){return(h=n(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d();case 2:if((s=document.createElement("div")).className=o,!f){e.next=10;break}(l=f.cloneNode(!0)).classList.remove("hidden"),s.appendChild(l),e.next=16;break;case 10:if(!i){e.next=14;break}s.textContent=i,e.next=16;break;case 14:return console.error("No content provided for popover:",t),e.abrupt("return");case 16:document.body.appendChild(s),u=Popper.createPopper(t,s,{placement:r,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),setTimeout((function(){s.style.opacity="1",s.style.transform="scale(1)",u.update()}),0),b.push({trigger:t,popoverElement:s,popoverInstance:u});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}))}function L(){b.forEach((function(t){var e=t.popoverElement,n=t.popoverInstance;n&&n.destroy(),e&&e.remove()})),b=[],g.delete()}function E(){return(E=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:w();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){E.apply(this,arguments)}(),new MutationObserver((function(){w()})).observe(document.body,{childList:!0,subtree:!0})}));var x=new WeakSet,k=[];function O(){document.querySelectorAll("[data-dui-toggle='tooltip']").forEach((function(t){var e;if(!x.has(t)){var r=t.getAttribute("data-dui-title"),o=t.getAttribute("data-dui-placement")||"top",i=t.getAttribute("data-dui-tooltip-class")||"tooltip-default",a=null,u=null,s=null;null!==(e=t.nextElementSibling)&&void 0!==e&&e.matches("[data-dui-tooltip-content]")&&(s=t.nextElementSibling),t.addEventListener("mouseenter",(function(){return l.apply(this,arguments)})),t.addEventListener("mouseleave",(function(){a&&(a.destroy(),a=null),u&&(u.remove(),u=null),k=k.filter((function(e){return e.trigger!==t}))})),x.add(t)}function l(){return(l=n(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,d();case 4:if((u=document.createElement("div")).className=i,!s){e.next=12;break}(n=s.cloneNode(!0)).classList.remove("hidden"),u.appendChild(n),e.next=18;break;case 12:if(!r){e.next=16;break}u.textContent=r,e.next=18;break;case 16:return console.warn("No tooltip content provided for:",t),e.abrupt("return");case 18:document.body.appendChild(u),a=Popper.createPopper(t,u,{placement:o,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),k.push({trigger:t,tooltipElement:u,tooltipInstance:a});case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}))}function P(){k.forEach((function(t){var e=t.tooltipElement,n=t.tooltipInstance;n&&n.destroy(),e&&e.remove()})),k=[]}function S(){return(S=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:O();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){S.apply(this,arguments)}(),new MutationObserver((function(){O()})).observe(document.body,{childList:!0,subtree:!0})}));var A=new WeakSet;function j(t){var e=t.currentTarget.closest('[role="alert"]');e&&e.remove()}function T(){document.querySelectorAll("[data-dui-dismiss='alert']").forEach((function(t){A.has(t)||(t.addEventListener("click",j),A.add(t))}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){T(),new MutationObserver((function(){T()})).observe(document.body,{childList:!0,subtree:!0})}));var D=new WeakSet;function q(t){var e=t.currentTarget.getAttribute("data-dui-target");if(e&&e.startsWith("#")){var n=document.querySelector(e),r="true"===t.currentTarget.getAttribute("aria-expanded");if(n){n.style.maxHeight=r?"0":n.scrollHeight+"px",t.currentTarget.setAttribute("aria-expanded",!r);var o=t.currentTarget.querySelector("[data-dui-icon]");o&&o.classList.toggle("rotate-180",!r)}}}function C(){document.querySelectorAll("[data-dui-toggle='collapse']").forEach((function(t){D.has(t)||(t.addEventListener("click",q),D.add(t))}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){C(),new MutationObserver((function(){C()})).observe(document.body,{childList:!0,subtree:!0})}));var M=new WeakSet;function I(){document.querySelectorAll(".tab-group").forEach((function(t){if(!M.has(t)){var e,n=t.querySelector("[role='tablist']"),r=n.querySelectorAll(".tab-link"),o=t.querySelectorAll(".tab-content"),i=n.querySelector(".tab-indicator"),a="vertical"===t.getAttribute("data-dui-orientation");(e=n.querySelector(".tab-link.active"))?c(e):r.length>0&&c(r[0]),r.forEach((function(t){t.addEventListener("click",(function(e){e.preventDefault(),c(t)}))})),M.add(t)}function c(t){r.forEach((function(t){return t.classList.remove("active")})),o.forEach((function(t){t.classList.add("hidden"),t.classList.remove("block")})),t.classList.add("active");var e=document.getElementById(t.getAttribute("data-dui-tab-target"));e&&(e.classList.add("block"),e.classList.remove("hidden")),function(t){var e=t.getBoundingClientRect(),r=n.getBoundingClientRect();requestAnimationFrame((function(){a?(i.style.transform="translateY(".concat(e.top-r.top,"px)"),i.style.height="".concat(e.height,"px")):(i.style.transform="translateX(".concat(e.left-r.left,"px)"),i.style.width="".concat(e.width,"px")),i.classList.remove("hidden"),i.style.opacity="1",i.style.scale="1"}))}(t)}}))}function N(){M.forEach((function(t){t.querySelector("[role='tablist']").querySelectorAll(".tab-link").forEach((function(t){var e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)}))})),M.delete()}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){I(),new MutationObserver((function(){I()})).observe(document.body,{childList:!0,subtree:!0})}));var _=new WeakSet,F=[];function G(t){var e=t.currentTarget.getAttribute("data-dui-target"),n=document.querySelector(e);if(n){var r=n.classList.contains("pointer-events-none");n.classList.toggle("opacity-0",!r),r?n.classList.remove("pointer-events-none"):setTimeout((function(){return n.classList.add("pointer-events-none")}),300),n.classList.toggle("opacity-100",r);var o=n.querySelector(r?".scale-95":".scale-100");o.classList.toggle("scale-95",!r),o.classList.toggle("scale-100",r),n.setAttribute("aria-hidden",!r),r?n.addEventListener("click",B):n.removeEventListener("click",B),r?F.push(n):F=F.filter((function(t){return t!==n}))}}function W(t){var e=t.currentTarget.closest(".fixed");if(e){e.classList.add("opacity-0"),e.classList.remove("opacity-100");var n=e.querySelector(".scale-100");n.classList.add("scale-95"),n.classList.remove("scale-100"),setTimeout((function(){e.classList.add("pointer-events-none"),e.setAttribute("aria-hidden","true")}),300),e.removeEventListener("click",B),F=F.filter((function(t){return t!==e}))}}function B(t){t.currentTarget.querySelector(".scale-100, .scale-95").contains(t.target)||W({currentTarget:t.currentTarget})}function Y(){document.querySelectorAll("[data-dui-toggle='modal']").forEach((function(t){_.has(t)||(t.addEventListener("click",G),_.add(t))})),document.querySelectorAll("[data-dui-dismiss='modal']").forEach((function(t){_.has(t)||(t.addEventListener("click",W),_.add(t))}))}function H(){F.forEach((function(t){t.removeEventListener("click",B)})),F=[],_.delete()}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){Y(),new MutationObserver((function(){Y()})).observe(document.body,{childList:!0,subtree:!0})}));var R={initAlert:T,initCollapse:C,initDropdowns:v,cleanupDropdowns:y,initPopovers:w,cleanupPopovers:L,initTooltips:O,cleanupTooltips:P,initTabs:I,cleanupTabs:N,initModal:Y,cleanupModals:H};function X(){T(),C(),I(),Y(),d().then((function(){v(),w(),O()})).catch((function(t){console.error("Failed to load Popper.js:",t)}))}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){X(),new MutationObserver((function(){T(),C(),I(),Y(),v(),w(),O()})).observe(document.body,{childList:!0,subtree:!0}),window.DavidAI=a(a({},R),{},{initDavidAI:X})}));var z=a(a({},R),{},{initDavidAI:X});t.cleanupDropdowns=y,t.cleanupModals=H,t.cleanupPopovers=L,t.cleanupTabs=N,t.cleanupTooltips=P,t.default=z,t.initAlert=T,t.initCollapse=C,t.initDavidAI=X,t.initDropdowns=v,t.initModal=Y,t.initPopovers=w,t.initTabs=I,t.initTooltips=O,Object.defineProperty(t,"__esModule",{value:!0})}));
+/*!
+ * David AI JavaScript Library v1.0.5
+ * (c) 2024 David AI - Creative Tim
+ * Released under the MIT License.
+ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).DavidAI={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))}}function r(t,e){for(var n=0;n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),d=r.call(a,"finallyLoc");if(u&&d){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var d=!1,s=null;function l(){return d?s:(d=!0,s=new Promise((function(t,e){if(window.Popper)t(window.Popper);else{var n=document.createElement("script");n.src="https://unpkg.com/@popperjs/core@2",n.defer=!0,n.onload=function(){window.Popper=window.Popper||window.Popper,t(window.Popper)},n.onerror=function(){e(new Error("Failed to load Popper.js"))},document.head.appendChild(n)}})))}var f=new WeakSet,p=[],h=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dropdown=e,this.button=this.dropdown.querySelector('[data-dui-toggle="dropdown"]'),this.menu=this.dropdown.querySelector('[data-dui-role="menu"]'),this.popperInstance=null,this.placement=this.dropdown.getAttribute("data-dui-placement")||"bottom-start",this.init()},e=[{key:"init",value:(i=n(c().mark((function t(){var e=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l();case 2:this.popperInstance=Popper.createPopper(this.button,this.menu,{placement:this.placement,modifiers:[{name:"offset",options:{offset:[0,5]}}]}),this.button.addEventListener("click",(function(t){t.stopPropagation(),e.toggleDropdown()})),document.addEventListener("click",(function(t){e.dropdown.contains(t.target)||e.closeDropdown()})),p.push({dropdown:this.dropdown,popperInstance:this.popperInstance});case 6:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"toggleDropdown",value:function(){"true"===this.button.getAttribute("aria-expanded")?this.closeDropdown():this.openDropdown()}},{key:"openDropdown",value:function(){this.button.setAttribute("aria-expanded","true"),this.menu.hidden=!1,this.menu.classList.remove("hidden"),this.popperInstance.update()}},{key:"closeDropdown",value:function(){this.button.setAttribute("aria-expanded","false"),this.menu.hidden=!0,this.menu.classList.add("hidden")}}],e&&r(t.prototype,e),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,o,i}();function v(){document.querySelectorAll(".dropdown").forEach((function(t){f.has(t)||(new h(t),f.add(t))}))}function y(){p.forEach((function(t){var e=t.dropdown,n=t.popperInstance;n&&n.destroy(),e&&f.delete(e)})),p=[]}function m(){return(m=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l();case 2:v();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){m.apply(this,arguments)}(),new MutationObserver((function(){v()})).observe(document.body,{childList:!0,subtree:!0})}));var g=new WeakSet,b=[];function w(){document.querySelectorAll("[data-dui-toggle='popover']").forEach((function(t){var e;if(!g.has(t)){var r=t.getAttribute("data-dui-placement")||"top",o=t.getAttribute("data-dui-popover-class")||"popover-default",i=t.getAttribute("data-dui-popover-content"),a=t.hasAttribute("data-dui-open"),u=null,d=null,s=null,f=null!==(e=t.nextElementSibling)&&void 0!==e&&e.matches("[data-dui-popover-content]")?t.nextElementSibling:null;t.addEventListener("click",(function(e){e.stopPropagation(),u?(u&&(u.destroy(),u=null,s&&s.classList.add("hidden"),d.remove(),d=null),b=b.filter((function(e){return e.trigger!==t}))):p()})),a&&p(),g.add(t)}function p(){return h.apply(this,arguments)}function h(){return(h=n(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l();case 2:if((d=document.createElement("div")).className=o,!f){e.next=10;break}(s=f.cloneNode(!0)).classList.remove("hidden"),d.appendChild(s),e.next=16;break;case 10:if(!i){e.next=14;break}d.textContent=i,e.next=16;break;case 14:return console.error("No content provided for popover:",t),e.abrupt("return");case 16:document.body.appendChild(d),u=Popper.createPopper(t,d,{placement:r,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),setTimeout((function(){d.style.opacity="1",d.style.transform="scale(1)",u.update()}),0),b.push({trigger:t,popoverElement:d,popoverInstance:u});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}))}function L(){b.forEach((function(t){var e=t.popoverElement,n=t.popoverInstance;n&&n.destroy(),e&&e.remove()})),b=[],g.delete()}function E(){return(E=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l();case 2:w();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){E.apply(this,arguments)}(),new MutationObserver((function(){w()})).observe(document.body,{childList:!0,subtree:!0})}));var S=new WeakSet,A=[];function x(){document.querySelectorAll("[data-dui-toggle='tooltip']").forEach((function(t){var e;if(!S.has(t)){var r=t.getAttribute("data-dui-title"),o=t.getAttribute("data-dui-placement")||"top",i=t.getAttribute("data-dui-tooltip-class")||"tooltip-default",a=null,u=null,d=null;null!==(e=t.nextElementSibling)&&void 0!==e&&e.matches("[data-dui-tooltip-content]")&&(d=t.nextElementSibling),t.addEventListener("mouseenter",(function(){return s.apply(this,arguments)})),t.addEventListener("mouseleave",(function(){a&&(a.destroy(),a=null),u&&(u.remove(),u=null),A=A.filter((function(e){return e.trigger!==t}))})),S.add(t)}function s(){return(s=n(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,l();case 4:if((u=document.createElement("div")).className=i,!d){e.next=12;break}(n=d.cloneNode(!0)).classList.remove("hidden"),u.appendChild(n),e.next=18;break;case 12:if(!r){e.next=16;break}u.textContent=r,e.next=18;break;case 16:return console.warn("No tooltip content provided for:",t),e.abrupt("return");case 18:document.body.appendChild(u),a=Popper.createPopper(t,u,{placement:o,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),A.push({trigger:t,tooltipElement:u,tooltipInstance:a});case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}))}function k(){A.forEach((function(t){var e=t.tooltipElement,n=t.tooltipInstance;n&&n.destroy(),e&&e.remove()})),A=[]}function O(){return(O=n(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l();case 2:x();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){!function(){O.apply(this,arguments)}(),new MutationObserver((function(){x()})).observe(document.body,{childList:!0,subtree:!0})}));var q=new WeakSet;function P(t){var e=t.currentTarget.closest('[role="alert"]');e&&e.remove()}function T(){document.querySelectorAll("[data-dui-dismiss='alert']").forEach((function(t){q.has(t)||(t.addEventListener("click",P),q.add(t))}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){T(),new MutationObserver((function(){T()})).observe(document.body,{childList:!0,subtree:!0})}));var j=new WeakSet;function D(t){var e=t.currentTarget.getAttribute("data-dui-target");if(e&&e.startsWith("#")){var n=document.querySelector(e),r="true"===t.currentTarget.getAttribute("aria-expanded");if(n){n.style.maxHeight=r?"0":n.scrollHeight+"px",t.currentTarget.setAttribute("aria-expanded",!r);var o=t.currentTarget.querySelector("[data-dui-icon]");o&&o.classList.toggle("rotate-180",!r)}}}function C(){document.querySelectorAll("[data-dui-toggle='collapse']").forEach((function(t){j.has(t)||(t.addEventListener("click",D),j.add(t))}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){C(),new MutationObserver((function(){C()})).observe(document.body,{childList:!0,subtree:!0})}));var M=new WeakSet;function _(){document.querySelectorAll(".tab-group").forEach((function(t){if(!M.has(t)){var e,n=t.querySelector("[role='tablist']"),r=n.querySelectorAll(".tab-link"),o=t.querySelectorAll(".tab-content"),i=n.querySelector(".tab-indicator"),a="vertical"===t.getAttribute("data-dui-orientation");(e=n.querySelector(".tab-link.active"))?c(e):r.length>0&&c(r[0]),r.forEach((function(t){t.addEventListener("click",(function(e){e.preventDefault(),c(t)}))})),M.add(t)}function c(t){r.forEach((function(t){return t.classList.remove("active")})),o.forEach((function(t){t.classList.add("hidden"),t.classList.remove("block")})),t.classList.add("active");var e=document.getElementById(t.getAttribute("data-dui-tab-target"));e&&(e.classList.add("block"),e.classList.remove("hidden")),function(t){var e=t.getBoundingClientRect(),r=n.getBoundingClientRect();requestAnimationFrame((function(){a?(i.style.transform="translateY(".concat(e.top-r.top,"px)"),i.style.height="".concat(e.height,"px")):(i.style.transform="translateX(".concat(e.left-r.left,"px)"),i.style.width="".concat(e.width,"px")),i.classList.remove("hidden"),i.style.opacity="1",i.style.scale="1"}))}(t)}}))}function I(){M.forEach((function(t){t.querySelector("[role='tablist']").querySelectorAll(".tab-link").forEach((function(t){var e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)}))})),M.delete()}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){_(),new MutationObserver((function(){_()})).observe(document.body,{childList:!0,subtree:!0})}));var N=new WeakSet,W=[];function G(t){var e=t.currentTarget.getAttribute("data-dui-target"),n=document.querySelector(e);if(n){var r=n.classList.contains("pointer-events-none");n.classList.toggle("opacity-0",!r),r?n.classList.remove("pointer-events-none"):setTimeout((function(){return n.classList.add("pointer-events-none")}),300),n.classList.toggle("opacity-100",r);var o=n.querySelector(r?".scale-95":".scale-100");o.classList.toggle("scale-95",!r),o.classList.toggle("scale-100",r),n.setAttribute("aria-hidden",!r),r?n.addEventListener("click",B):n.removeEventListener("click",B),r?W.push(n):W=W.filter((function(t){return t!==n}))}}function F(t){var e=t.currentTarget.closest(".fixed");if(e){e.classList.add("opacity-0"),e.classList.remove("opacity-100");var n=e.querySelector(".scale-100");n.classList.add("scale-95"),n.classList.remove("scale-100"),setTimeout((function(){e.classList.add("pointer-events-none"),e.setAttribute("aria-hidden","true")}),300),e.removeEventListener("click",B),W=W.filter((function(t){return t!==e}))}}function B(t){t.currentTarget.querySelector(".scale-100, .scale-95").contains(t.target)||F({currentTarget:t.currentTarget})}function H(){document.querySelectorAll("[data-dui-toggle='modal']").forEach((function(t){N.has(t)||(t.addEventListener("click",G),N.add(t))})),document.querySelectorAll("[data-dui-dismiss='modal']").forEach((function(t){N.has(t)||(t.addEventListener("click",F),N.add(t))}))}function Y(){W.forEach((function(t){t.removeEventListener("click",B)})),W=[],N.delete()}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){H(),new MutationObserver((function(){H()})).observe(document.body,{childList:!0,subtree:!0})}));var R=new WeakSet,X=function(t,e,n){t.style.maxHeight=n?t.scrollHeight+"px":"0",e.setAttribute("aria-expanded",n),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.querySelector("[data-dui-accordion-icon-open]"),o=t.querySelector("[data-dui-accordion-icon-close]"),i=t.querySelector("[data-dui-accordion-icon]");r&&o&&(r.style.display=e?"block":"none",o.style.display=e?"none":"block"),i&&i.classList.toggle("rotate-180",n?e:!e)}(e,n)};function z(t){if("true"!==t.currentTarget.getAttribute("aria-disabled")){var e=t.currentTarget.getAttribute("data-dui-accordion-target"),n=t.currentTarget.closest("[data-dui-accordion-container]"),r=null==n?void 0:n.getAttribute("data-dui-accordion-mode");if(null!=e&&e.startsWith("#")){var o=document.querySelector(e),i="true"===t.currentTarget.getAttribute("aria-expanded");"exclusive"===r&&n&&n.querySelectorAll("[data-dui-accordion-toggle]").forEach((function(t){var n=t.getAttribute("data-dui-accordion-target");if(n!==e){var r=document.querySelector(n);r&&X(r,t,!1)}})),o&&X(o,t.currentTarget,!i)}}}function J(){document.querySelectorAll("[data-dui-accordion-toggle]").forEach((function(t){if(!R.has(t)){t.addEventListener("click",z),R.add(t);var e=document.querySelector(t.getAttribute("data-dui-accordion-target")),n="true"===t.getAttribute("aria-expanded");e&&X(e,t,n)}})),document.querySelectorAll("[data-dui-accordion-container]").forEach((function(t){var e=t.getAttribute("data-dui-accordion-mode"),n=t.querySelectorAll("[data-dui-accordion-toggle]");"exclusive"===e?Array.from(n).filter((function(t){return"true"===t.getAttribute("aria-expanded")})).slice(1).forEach((function(t){var e=document.querySelector(t.getAttribute("data-dui-accordion-target"));e&&X(e,t,!1)})):"all-open"===e&&n.forEach((function(t){var e=document.querySelector(t.getAttribute("data-dui-accordion-target"));e&&X(e,t,!0)}))}))}function K(){document.querySelectorAll("[data-dui-accordion-toggle]").forEach((function(t){R.has(t)&&(t.removeEventListener("click",z),R.delete(t))}))}"undefined"!=typeof window&&(window.toggleAccordionById=function(t){t=t.startsWith("#")?t:"#"+t;var e=document.querySelector(t),n=document.querySelector('[data-dui-accordion-target="'.concat(t,'"]'));if("true"!==(null==n?void 0:n.getAttribute("aria-disabled"))&&e&&n){var r="true"===n.getAttribute("aria-expanded"),o=n.closest("[data-dui-accordion-container]");"exclusive"===(null==o?void 0:o.getAttribute("data-dui-accordion-mode"))&&o&&o.querySelectorAll("[data-dui-accordion-toggle]").forEach((function(e){var n=e.getAttribute("data-dui-accordion-target");if(n!==t){var r=document.querySelector(n);r&&X(r,e,!1)}})),X(e,n,!r)}},document.addEventListener("DOMContentLoaded",(function(){J(),new MutationObserver(J).observe(document.body,{childList:!0,subtree:!0})})));var Q=new WeakSet;function U(){document.querySelectorAll("[data-stepper-container]").forEach((function(t){if(!Q.has(t)){Q.add(t);var e=parseInt(t.getAttribute("data-initial-step")||"1",10);t.dataset.currentStep=e,function(t){var e=t.querySelectorAll("[data-step]"),n=t.querySelectorAll("[data-step-content]"),r=t.querySelectorAll("[data-stepper-prev]"),o=t.querySelectorAll("[data-stepper-next]"),i=parseInt(t.dataset.currentStep||"1",10);function a(){e.forEach((function(t,e){var n=e+1;t.dataset.active=n===i,t.dataset.completed=ni)})),n.forEach((function(t){parseInt(t.dataset.stepContent,10)===i?t.classList.remove("hidden"):t.classList.add("hidden")})),r.forEach((function(t){t.disabled=1===i})),o.forEach((function(t){t.disabled=i===e.length}))}function c(){i1&&(i--,t.dataset.currentStep=i,a())}o.forEach((function(t){t.addEventListener("click",c)})),r.forEach((function(t){t.addEventListener("click",u)})),t.__stepperCleanup=function(){o.forEach((function(t){t.removeEventListener("click",c)})),r.forEach((function(t){t.removeEventListener("click",u)}))},a()}(t)}}))}function V(){document.querySelectorAll("[data-stepper-container]").forEach((function(t){t.__stepperCleanup&&(t.__stepperCleanup(),delete t.__stepperCleanup),Q.delete(t)}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){U(),new MutationObserver(U).observe(document.body,{childList:!0,subtree:!0})}));var Z=new WeakSet;function $(t){var e=t.currentTarget,n=document.querySelector("[data-main-image]");n&&(n.src=e.src,document.querySelectorAll("[data-thumbnail]").forEach((function(t){t.classList.remove("active-thumbnail")})),e.classList.add("active-thumbnail"))}function tt(){document.querySelectorAll("[data-thumbnail]").forEach((function(t){Z.has(t)||(t.addEventListener("click",$),Z.add(t))}))}function et(){document.querySelectorAll("[data-thumbnail]").forEach((function(t){Z.has(t)&&(t.removeEventListener("click",$),Z.delete(t))}))}"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",(function(){tt(),new MutationObserver((function(){tt()})).observe(document.body,{childList:!0,subtree:!0})}));var nt={initAlert:T,initCollapse:C,initDropdowns:v,cleanupDropdowns:y,initPopovers:w,cleanupPopovers:L,initTooltips:x,cleanupTooltips:k,initTabs:_,cleanupTabs:I,initModal:H,cleanupModals:Y,initAccordion:J,cleanupAccordions:K,initStepper:U,cleanupSteppers:V,initGallery:tt,cleanupGallery:et};function rt(){T(),C(),_(),H(),J(),U(),tt(),l().then((function(){v(),w(),x()})).catch((function(t){console.error("Failed to load Popper.js:",t)}))}"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",(function(){rt(),new MutationObserver((function(){T(),C(),J(),U(),_(),H(),v(),w(),x(),tt()})).observe(document.body,{childList:!0,subtree:!0}),window.DavidAI=a(a({},nt),{},{initDavidAI:rt})}));var ot=a(a({},nt),{},{initDavidAI:rt});t.cleanupAccordions=K,t.cleanupDropdowns=y,t.cleanupGallery=et,t.cleanupModals=Y,t.cleanupPopovers=L,t.cleanupSteppers=V,t.cleanupTabs=I,t.cleanupTooltips=k,t.default=ot,t.initAccordion=J,t.initAlert=T,t.initCollapse=C,t.initDavidAI=rt,t.initDropdowns=v,t.initGallery=tt,t.initModal=H,t.initPopovers=w,t.initStepper=U,t.initTabs=_,t.initTooltips=x,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=david-ai.min.js.map
diff --git a/packages/dist/david-ai.min.js.map b/packages/dist/david-ai.min.js.map
index b5996df..4629b7c 100644
--- a/packages/dist/david-ai.min.js.map
+++ b/packages/dist/david-ai.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"david-ai.min.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","this","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","_loadAndInitDropdowns","_callee2","_context2","loadAndInitDropdowns","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","event","filter","p","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","cleanupPopovers","_loadAndInitPopovers","loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","_showTooltip","t","contentClone","warn","cleanupTooltips","_loadAndInitTooltips","loadAndInitTooltips","initializedElements","closeAlert","alert","currentTarget","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","isExpanded","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","activeLink","tabList","tabLinks","tabContents","indicator","isVertical","activateTab","length","link","preventDefault","item","content","targetContent","getElementById","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","updateIndicator","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","DavidAI","initDavidAI","then","_objectSpread"],"mappings":"yjQAAA,IAAIA,GAAe,EACfC,EAAc,KAEX,SAASC,IACd,OAAIF,EACKC,GAETD,GAAe,EAEfC,EAAc,IAAIE,SAAQ,SAAUC,EAASC,GAC3C,GAAIC,OAAOC,OACTH,EAAQE,OAAOC,YADjB,CAIA,IAAIC,EAASC,SAASC,cAAc,UACpCF,EAAOG,IAAM,qCACbH,EAAOI,OAAQ,EACfJ,EAAOK,OAAS,WACdP,OAAOC,OAASD,OAAOC,QAAUD,OAAOC,OACxCH,EAAQE,OAAOC,SAEjBC,EAAOM,QAAU,WACfT,EAAO,IAAIU,MAAM,8BAEnBN,SAASO,KAAKC,YAAYT,EAX1B,CAYF,IAGF,CCzBA,IAAMU,EAAuB,IAAIC,QAC7BC,EAAkB,GAETC,EAAQ,WAUlB,SATD,SAAAA,EAAYC,gGAAiBC,MAAAF,GAC3BG,KAAKC,SAAWH,EAChBE,KAAKE,OAASF,KAAKC,SAASE,cAAc,gCAC1CH,KAAKI,KAAOJ,KAAKC,SAASE,cAAc,0BACxCH,KAAKK,eAAiB,KAEtBL,KAAKM,UAAYN,KAAKC,SAASM,aAAa,uBAAyB,eAErEP,KAAKQ,MACP,IAAC,CAAA,CAAAC,IAAA,OAAAC,OAAAC,EAAAC,EAAAC,IAAAC,MAED,SAAAC,IAAA,IAAAC,EAAAhB,KAAA,OAAAa,IAAAI,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAE,KAAA,EAEQ1C,IAAc,KAAA,EAGpBsB,KAAKK,eAA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A,KAAQH,GAAO,GAAA,CAAEC,YAAAA,GACjC,IAGFE,IAAAA,EAAAA,EAAAA,EAAA,CAAA,EAAoBH,GAAO,CAAA,EAAA,CAAEC,YAAAA"}
\ No newline at end of file
+{"version":3,"file":"david-ai.min.js","sources":["../src/utils/loadPopper.js","../src/dropdown/dropdown.js","../src/popover/popover.js","../src/tooltip/tooltip.js","../src/alert/alert.js","../src/collapse/collapse.js","../src/tabs/tabs.js","../src/modal/modal.js","../src/accordion/accordion.js","../src/stepper/stepper.js","../src/gallery/gallery.js","../src/index.js"],"sourcesContent":["var popperLoaded = false; // Singleton flag to track loading state\nvar popperReady = null; // Promise to handle loading Popper.js once\n\nexport function loadPopperJs() {\n if (popperLoaded) {\n return popperReady; // Return the existing Promise if already loading or loaded\n }\n popperLoaded = true; // Mark Popper.js as being loaded\n\n popperReady = new Promise(function (resolve, reject) {\n if (window.Popper) {\n resolve(window.Popper); // If already loaded globally, resolve immediately\n return;\n }\n var script = document.createElement(\"script\");\n script.src = \"https://unpkg.com/@popperjs/core@2\";\n script.defer = true;\n script.onload = function () {\n window.Popper = window.Popper || window.Popper; // Expose Popper globally\n resolve(window.Popper); // Resolve once Popper.js is loaded\n };\n script.onerror = function () {\n reject(new Error(\"Failed to load Popper.js\"));\n };\n document.head.appendChild(script);\n });\n\n return popperReady;\n}\n","// Dropdown Component\nimport { loadPopperJs } from '../utils/loadPopper'; // Centralized loader\n\nconst initializedDropdowns = new WeakSet(); // Prevent duplicate initialization\nlet activeDropdowns = []; // Track active dropdowns for cleanup\n\nexport class Dropdown {\n constructor(dropdownElement) {\n this.dropdown = dropdownElement;\n this.button = this.dropdown.querySelector('[data-dui-toggle=\"dropdown\"]');\n this.menu = this.dropdown.querySelector('[data-dui-role=\"menu\"]');\n this.popperInstance = null;\n\n this.placement = this.dropdown.getAttribute(\"data-dui-placement\") || \"bottom-start\";\n\n this.init();\n }\n\n async init() {\n // Ensure Popper.js is loaded\n await loadPopperJs();\n\n // Initialize Popper.js\n this.popperInstance = Popper.createPopper(this.button, this.menu, {\n placement: this.placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 5] } }],\n });\n\n // Add event listeners\n this.button.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n this.toggleDropdown();\n });\n\n document.addEventListener(\"click\", (e) => {\n if (!this.dropdown.contains(e.target)) {\n this.closeDropdown();\n }\n });\n\n // Track active dropdown for cleanup\n activeDropdowns.push({ dropdown: this.dropdown, popperInstance: this.popperInstance });\n }\n\n toggleDropdown() {\n const isExpanded = this.button.getAttribute(\"aria-expanded\") === \"true\";\n isExpanded ? this.closeDropdown() : this.openDropdown();\n }\n\n openDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"true\");\n this.menu.hidden = false;\n this.menu.classList.remove(\"hidden\");\n this.popperInstance.update();\n }\n\n closeDropdown() {\n this.button.setAttribute(\"aria-expanded\", \"false\");\n this.menu.hidden = true;\n this.menu.classList.add(\"hidden\");\n }\n}\n\nexport function initDropdowns() {\n document.querySelectorAll(\".dropdown\").forEach((dropdownElement) => {\n if (!initializedDropdowns.has(dropdownElement)) {\n new Dropdown(dropdownElement);\n initializedDropdowns.add(dropdownElement);\n }\n });\n}\n\n// Cleanup function to destroy all active dropdowns\nexport function cleanupDropdowns() {\n activeDropdowns.forEach(({ dropdown, popperInstance }) => {\n if (popperInstance) popperInstance.destroy();\n if (dropdown) initializedDropdowns.delete(dropdown);\n });\n activeDropdowns = [];\n}\n\n// Combined initialization function\nexport async function loadAndInitDropdowns() {\n await loadPopperJs();\n initDropdowns();\n}\n\n// Auto-initialize Dropdowns in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitDropdowns();\n\n // Observe the DOM for dynamically added dropdowns\n const observer = new MutationObserver(() => {\n initDropdowns();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedPopovers = new WeakSet(); // Prevent duplicate initialization\nlet activePopovers = []; // Track active popovers for cleanup\n\nexport function initPopovers() {\n document.querySelectorAll(\"[data-dui-toggle='popover']\").forEach((trigger) => {\n if (initializedPopovers.has(trigger)) return; // Avoid re-initializing\n\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const popoverClasses = trigger.getAttribute(\"data-dui-popover-class\") || \"popover-default\";\n const plainContent = trigger.getAttribute(\"data-dui-popover-content\");\n const isOpenByDefault = trigger.hasAttribute(\"data-dui-open\");\n\n let popoverInstance = null;\n let popoverElement = null;\n let originalContentElement = null;\n\n // Find content element next to the trigger\n const contentElement = trigger.nextElementSibling?.matches(\"[data-dui-popover-content]\")\n ? trigger.nextElementSibling\n : null;\n\n // Function to open the popover\n async function openPopover() {\n await loadPopperJs();\n\n // Create the popover element\n popoverElement = document.createElement(\"div\");\n popoverElement.className = popoverClasses;\n\n // Use custom HTML content or plain text\n if (contentElement) {\n originalContentElement = contentElement.cloneNode(true);\n originalContentElement.classList.remove(\"hidden\");\n popoverElement.appendChild(originalContentElement);\n } else if (plainContent) {\n popoverElement.textContent = plainContent;\n } else {\n console.error(\"No content provided for popover:\", trigger);\n return;\n }\n\n // Append the popover element to the body\n document.body.appendChild(popoverElement);\n\n // Initialize Popper.js\n popoverInstance = Popper.createPopper(trigger, popoverElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Add a small delay to ensure Popper.js calculations are correct\n setTimeout(() => {\n popoverElement.style.opacity = \"1\"; // Make the popover visible\n popoverElement.style.transform = \"scale(1)\"; // Apply scaling animation\n popoverInstance.update(); // Ensure Popper.js recalculates position\n }, 0);\n\n // Track active popovers for cleanup\n activePopovers.push({ trigger, popoverElement, popoverInstance });\n }\n\n\n // Function to close the popover\n function closePopover() {\n if (popoverInstance) {\n popoverInstance.destroy();\n popoverInstance = null;\n\n if (originalContentElement) {\n originalContentElement.classList.add(\"hidden\");\n }\n\n popoverElement.remove();\n popoverElement = null;\n }\n\n // Remove from active popovers\n activePopovers = activePopovers.filter((p) => p.trigger !== trigger);\n }\n\n // Toggle popover on click\n trigger.addEventListener(\"click\", (event) => {\n event.stopPropagation();\n if (popoverInstance) {\n closePopover();\n } else {\n openPopover();\n }\n });\n\n // Open popover by default if specified\n if (isOpenByDefault) {\n openPopover();\n }\n\n // Mark as initialized\n initializedPopovers.add(trigger);\n });\n}\n\n// Cleanup function to destroy all active popovers\nexport function cleanupPopovers() {\n activePopovers.forEach(({ popoverElement, popoverInstance }) => {\n if (popoverInstance) popoverInstance.destroy();\n if (popoverElement) popoverElement.remove();\n });\n activePopovers = [];\n initializedPopovers.delete(); // Clear initialized elements\n}\n\n// Combined initialization function\nexport async function loadAndInitPopovers() {\n await loadPopperJs();\n initPopovers();\n}\n\n// Auto-initialize Popovers in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitPopovers();\n\n // Observe the DOM for dynamically added popovers\n const observer = new MutationObserver(() => {\n initPopovers(); // Reinitialize popovers when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","import { loadPopperJs } from '../utils/loadPopper';\n\nconst initializedTooltips = new WeakSet(); // Track initialized tooltips\nlet activeTooltips = []; // Track active tooltips for cleanup\n\nexport function initTooltips() {\n document.querySelectorAll(\"[data-dui-toggle='tooltip']\").forEach((trigger) => {\n if (initializedTooltips.has(trigger)) return; // Skip already initialized tooltips\n\n const title = trigger.getAttribute(\"data-dui-title\"); // Tooltip text content\n const placement = trigger.getAttribute(\"data-dui-placement\") || \"top\";\n const tooltipClasses = trigger.getAttribute(\"data-dui-tooltip-class\") || \"tooltip-default\";\n let tooltipInstance = null;\n let tooltipElement = null;\n let customContentElement = null;\n\n // Check for custom HTML content in sibling\n if (trigger.nextElementSibling?.matches(\"[data-dui-tooltip-content]\")) {\n customContentElement = trigger.nextElementSibling;\n }\n\n // Function to show the tooltip\n async function showTooltip() {\n if (tooltipElement) return; // Avoid creating multiple tooltips\n await loadPopperJs(); // Ensure Popper.js is loaded\n\n tooltipElement = document.createElement(\"div\");\n tooltipElement.className = tooltipClasses;\n\n // Add custom HTML or plain text to tooltip\n if (customContentElement) {\n const contentClone = customContentElement.cloneNode(true);\n contentClone.classList.remove(\"hidden\");\n tooltipElement.appendChild(contentClone);\n } else if (title) {\n tooltipElement.textContent = title;\n } else {\n console.warn(\"No tooltip content provided for:\", trigger);\n return;\n }\n\n document.body.appendChild(tooltipElement);\n\n tooltipInstance = Popper.createPopper(trigger, tooltipElement, {\n placement: placement,\n modifiers: [{ name: \"offset\", options: { offset: [0, 8] } }],\n });\n\n // Track active tooltip for cleanup\n activeTooltips.push({ trigger, tooltipElement, tooltipInstance });\n }\n\n // Function to hide the tooltip\n function hideTooltip() {\n if (tooltipInstance) {\n tooltipInstance.destroy();\n tooltipInstance = null;\n }\n\n if (tooltipElement) {\n tooltipElement.remove();\n tooltipElement = null;\n }\n\n // Remove from active tooltips\n activeTooltips = activeTooltips.filter((t) => t.trigger !== trigger);\n }\n\n // Event listeners for showing and hiding tooltips\n trigger.addEventListener(\"mouseenter\", showTooltip);\n trigger.addEventListener(\"mouseleave\", hideTooltip);\n\n // Mark the trigger as initialized\n initializedTooltips.add(trigger);\n });\n}\n\n// Cleanup function to remove all active tooltips\nexport function cleanupTooltips() {\n activeTooltips.forEach(({ tooltipElement, tooltipInstance }) => {\n if (tooltipInstance) tooltipInstance.destroy();\n if (tooltipElement) tooltipElement.remove();\n });\n activeTooltips = [];\n}\n\n// Combined initialization and loading function\nexport async function loadAndInitTooltips() {\n await loadPopperJs();\n initTooltips();\n}\n\n// Auto-initialize Tooltips in the browser\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n loadAndInitTooltips();\n\n // Observe DOM for dynamically added tooltips\n const observer = new MutationObserver(() => {\n initTooltips();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Alert component\nconst initializedElements = new WeakSet();\n\nexport function closeAlert(event) {\n const button = event.currentTarget;\n const alert = button.closest('[role=\"alert\"]');\n if (alert) {\n alert.remove(); // Remove the alert\n }\n}\n\nexport function initAlert() {\n document.querySelectorAll(\"[data-dui-dismiss='alert']\").forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", closeAlert);\n initializedElements.add(button);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initAlert(); // Initialize alerts after DOM is loaded\n\n // Observe the DOM for dynamically added alerts\n const observer = new MutationObserver(() => {\n initAlert(); // Re-initialize alerts when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","// Collapse component\nconst initializedElements = new WeakSet();\n\nexport function toggleCollapse(event) {\n const collapseID = event.currentTarget.getAttribute(\"data-dui-target\");\n\n if (collapseID && collapseID.startsWith(\"#\")) {\n const collapseElement = document.querySelector(collapseID);\n const isExpanded =\n event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (collapseElement) {\n // Toggle max-height for collapsible content\n collapseElement.style.maxHeight = isExpanded\n ? \"0\"\n : collapseElement.scrollHeight + \"px\";\n\n // Update aria-expanded attribute\n event.currentTarget.setAttribute(\"aria-expanded\", !isExpanded);\n\n // Toggle rotate-180 class on the icon\n const icon = event.currentTarget.querySelector(\"[data-dui-icon]\");\n if (icon) {\n icon.classList.toggle(\"rotate-180\", !isExpanded);\n }\n }\n }\n}\n\nexport function initCollapse() {\n document\n .querySelectorAll(\"[data-dui-toggle='collapse']\")\n .forEach((button) => {\n if (!initializedElements.has(button)) {\n button.addEventListener(\"click\", toggleCollapse);\n initializedElements.add(button); // Mark as initialized\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initCollapse(); // Initialize collapsibles after DOM is loaded\n\n // Observe the DOM for dynamically added collapsible elements\n const observer = new MutationObserver(() => {\n initCollapse(); // Re-initialize collapsibles when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedTabs = new WeakSet(); // Track initialized tabs for preventing duplication\n\nexport function initTabs() {\n document.querySelectorAll(\".tab-group\").forEach((tabGroup) => {\n if (initializedTabs.has(tabGroup)) return; // Avoid re-initializing the same tab group\n\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n const tabContents = tabGroup.querySelectorAll(\".tab-content\");\n const indicator = tabList.querySelector(\".tab-indicator\");\n const isVertical = tabGroup.getAttribute(\"data-dui-orientation\") === \"vertical\";\n\n // Function to update the indicator's position dynamically\n function updateIndicator(link) {\n const rect = link.getBoundingClientRect();\n const parentRect = tabList.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n if (isVertical) {\n indicator.style.transform = `translateY(${rect.top - parentRect.top}px)`;\n indicator.style.height = `${rect.height}px`;\n } else {\n indicator.style.transform = `translateX(${rect.left - parentRect.left}px)`;\n indicator.style.width = `${rect.width}px`;\n }\n\n // Make the indicator visible\n indicator.classList.remove(\"hidden\");\n indicator.style.opacity = \"1\";\n indicator.style.scale = \"1\";\n });\n }\n\n // Function to activate the selected tab\n function activateTab(link) {\n // Deactivate all tabs and hide their content\n tabLinks.forEach((item) => item.classList.remove(\"active\"));\n tabContents.forEach((content) => {\n content.classList.add(\"hidden\");\n content.classList.remove(\"block\");\n });\n\n // Activate the clicked tab\n link.classList.add(\"active\");\n const targetContent = document.getElementById(link.getAttribute(\"data-dui-tab-target\"));\n if (targetContent) {\n targetContent.classList.add(\"block\");\n targetContent.classList.remove(\"hidden\");\n }\n\n // Update the indicator position\n updateIndicator(link);\n }\n\n // Initialize the tab group\n function initializeTabGroup() {\n const activeLink = tabList.querySelector(\".tab-link.active\");\n if (activeLink) {\n activateTab(activeLink); // Set indicator for the initially active tab\n } else if (tabLinks.length > 0) {\n activateTab(tabLinks[0]); // Fallback to the first tab if no active tab is defined\n }\n\n // Attach click listeners to each tab link\n tabLinks.forEach((link) => {\n link.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Prevent default browser behavior\n activateTab(link); // Activate the clicked tab and update the indicator\n });\n });\n }\n\n initializeTabGroup();\n initializedTabs.add(tabGroup); // Mark the tab group as initialized\n });\n}\n\n// Cleanup function for tabs\nexport function cleanupTabs() {\n initializedTabs.forEach((tabGroup) => {\n const tabList = tabGroup.querySelector(\"[role='tablist']\");\n const tabLinks = tabList.querySelectorAll(\".tab-link\");\n\n // Remove event listeners from tab links\n tabLinks.forEach((link) => {\n const clone = link.cloneNode(true);\n link.parentNode.replaceChild(clone, link);\n });\n });\n\n initializedTabs.delete(); // Clear the WeakSet\n}\n\n// Auto-initialize tabs in the browser\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initTabs();\n\n // Observe DOM changes to reinitialize tabs dynamically\n const observer = new MutationObserver(() => {\n initTabs();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","const initializedModals = new WeakSet();\nlet activeModals = []; // Track active modals for cleanup\n\nexport function toggleModal(event) {\n const modalID = event.currentTarget.getAttribute(\"data-dui-target\");\n const modal = document.querySelector(modalID);\n\n if (modal) {\n const isHidden = modal.classList.contains(\"pointer-events-none\");\n modal.classList.toggle(\"opacity-0\", !isHidden);\n\n if (isHidden) {\n modal.classList.remove(\"pointer-events-none\");\n } else {\n setTimeout(() => modal.classList.add(\"pointer-events-none\"), 300);\n }\n\n modal.classList.toggle(\"opacity-100\", isHidden);\n const modalContent = modal.querySelector(isHidden ? \".scale-95\" : \".scale-100\");\n modalContent.classList.toggle(\"scale-95\", !isHidden);\n modalContent.classList.toggle(\"scale-100\", isHidden);\n modal.setAttribute(\"aria-hidden\", !isHidden);\n\n // Add or remove event listener for clicks outside modal content\n if (isHidden) {\n modal.addEventListener(\"click\", closeOnOutsideClick);\n } else {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n }\n\n // Track active modal for cleanup\n if (isHidden) {\n activeModals.push(modal);\n } else {\n activeModals = activeModals.filter((m) => m !== modal);\n }\n }\n}\n\nexport function closeModal(event) {\n const modal = event.currentTarget.closest(\".fixed\");\n\n if (modal) {\n modal.classList.add(\"opacity-0\");\n modal.classList.remove(\"opacity-100\");\n const modalContent = modal.querySelector(\".scale-100\");\n modalContent.classList.add(\"scale-95\");\n modalContent.classList.remove(\"scale-100\");\n\n setTimeout(() => {\n modal.classList.add(\"pointer-events-none\");\n modal.setAttribute(\"aria-hidden\", \"true\");\n }, 300);\n\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n\n // Remove from active modals\n activeModals = activeModals.filter((m) => m !== modal);\n }\n}\n\nfunction closeOnOutsideClick(event) {\n const modalContent = event.currentTarget.querySelector(\".scale-100, .scale-95\");\n\n if (!modalContent.contains(event.target)) {\n closeModal({ currentTarget: event.currentTarget });\n }\n}\n\nexport function initModal() {\n document.querySelectorAll(\"[data-dui-toggle='modal']\").forEach((trigger) => {\n if (!initializedModals.has(trigger)) {\n trigger.addEventListener(\"click\", toggleModal);\n initializedModals.add(trigger);\n }\n });\n\n document.querySelectorAll(\"[data-dui-dismiss='modal']\").forEach((button) => {\n if (!initializedModals.has(button)) {\n button.addEventListener(\"click\", closeModal);\n initializedModals.add(button);\n }\n });\n}\n\n// Cleanup function to destroy active modals and event listeners\nexport function cleanupModals() {\n activeModals.forEach((modal) => {\n modal.removeEventListener(\"click\", closeOnOutsideClick);\n });\n activeModals = [];\n initializedModals.delete(); // Clear initialized modals to allow reinitialization\n}\n\n// Auto-initialize Modals in the Browser Environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initModal();\n\n // Observe the DOM for dynamically added modals\n const observer = new MutationObserver(() => {\n initModal(); // Reinitialize modals when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}\n","// Accordion Component\nconst initializedAccordionElements = new WeakSet();\n\n// Helper function to handle icons\nconst handleIcons = (button, isExpanded, isRotating = false) => {\n const openIcon = button.querySelector(\"[data-dui-accordion-icon-open]\");\n const closeIcon = button.querySelector(\"[data-dui-accordion-icon-close]\");\n const rotatingIcon = button.querySelector(\"[data-dui-accordion-icon]\");\n\n if (openIcon && closeIcon) {\n openIcon.style.display = isExpanded ? \"block\" : \"none\";\n closeIcon.style.display = isExpanded ? \"none\" : \"block\";\n }\n if (rotatingIcon) {\n rotatingIcon.classList.toggle(\"rotate-180\", isRotating ? isExpanded : !isExpanded);\n }\n};\n\n// Helper function to toggle accordion state\nconst toggleAccordionState = (targetElement, button, isExpanded) => {\n targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + \"px\" : \"0\";\n button.setAttribute(\"aria-expanded\", isExpanded);\n handleIcons(button, isExpanded);\n};\n\n// Function to toggle accordion items\nexport function toggleAccordion(event) {\n if (event.currentTarget.getAttribute(\"aria-disabled\") === \"true\") return;\n\n const targetID = event.currentTarget.getAttribute(\"data-dui-accordion-target\");\n const parentElement = event.currentTarget.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (targetID?.startsWith(\"#\")) {\n const targetElement = document.querySelector(targetID);\n const isExpanded = event.currentTarget.getAttribute(\"aria-expanded\") === \"true\";\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetID) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n if (targetElement) {\n toggleAccordionState(targetElement, event.currentTarget, !isExpanded);\n }\n }\n}\n\n// Function to manually toggle accordion item by ID\nexport function toggleAccordionById(targetId) {\n targetId = targetId.startsWith('#') ? targetId : '#' + targetId;\n \n const targetElement = document.querySelector(targetId);\n const toggleButton = document.querySelector(`[data-dui-accordion-target=\"${targetId}\"]`);\n \n if (toggleButton?.getAttribute(\"aria-disabled\") === \"true\" || !targetElement || !toggleButton) return;\n \n const isExpanded = toggleButton.getAttribute(\"aria-expanded\") === \"true\";\n const parentElement = toggleButton.closest(\"[data-dui-accordion-container]\");\n const mode = parentElement?.getAttribute(\"data-dui-accordion-mode\");\n\n if (mode === \"exclusive\" && parentElement) {\n parentElement.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n const otherTargetID = button.getAttribute(\"data-dui-accordion-target\");\n if (otherTargetID !== targetId) {\n const otherElement = document.querySelector(otherTargetID);\n if (otherElement) {\n toggleAccordionState(otherElement, button, false);\n }\n }\n });\n }\n\n toggleAccordionState(targetElement, toggleButton, !isExpanded);\n}\n\n// Function to initialize accordion functionality\nexport function initAccordion() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (!initializedAccordionElements.has(button)) {\n button.addEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.add(button);\n\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n const isExpanded = button.getAttribute(\"aria-expanded\") === \"true\";\n \n if (targetElement) {\n toggleAccordionState(targetElement, button, isExpanded);\n }\n }\n });\n\n document.querySelectorAll(\"[data-dui-accordion-container]\").forEach(container => {\n const mode = container.getAttribute(\"data-dui-accordion-mode\");\n const buttons = container.querySelectorAll(\"[data-dui-accordion-toggle]\");\n\n if (mode === \"exclusive\") {\n const expandedButtons = Array.from(buttons).filter(btn => \n btn.getAttribute(\"aria-expanded\") === \"true\"\n );\n \n expandedButtons.slice(1).forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, false);\n }\n });\n } else if (mode === \"all-open\") {\n buttons.forEach(button => {\n const targetElement = document.querySelector(button.getAttribute(\"data-dui-accordion-target\"));\n if (targetElement) {\n toggleAccordionState(targetElement, button, true);\n }\n });\n }\n });\n}\n\n// Function to cleanup accordion functionality\nexport function cleanupAccordions() {\n document.querySelectorAll(\"[data-dui-accordion-toggle]\").forEach(button => {\n if (initializedAccordionElements.has(button)) {\n button.removeEventListener(\"click\", toggleAccordion);\n initializedAccordionElements.delete(button);\n }\n });\n}\n\n// Make toggleAccordionById available globally\nif (typeof window !== \"undefined\") {\n window.toggleAccordionById = toggleAccordionById;\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n initAccordion();\n new MutationObserver(initAccordion).observe(document.body, { \n childList: true, \n subtree: true \n });\n });\n}\n","// Stepper Component\nconst initializedStepperElements = new WeakSet();\n\nfunction updateStepperState(container) {\n const steps = container.querySelectorAll(\"[data-step]\");\n const stepContents = container.querySelectorAll(\"[data-step-content]\");\n const prevButtons = container.querySelectorAll(\"[data-stepper-prev]\");\n const nextButtons = container.querySelectorAll(\"[data-stepper-next]\");\n let currentStep = parseInt(container.dataset.currentStep || \"1\", 10);\n\n function updateState() {\n // Update step circles and connector lines\n steps.forEach((step, index) => {\n const stepNumber = index + 1;\n step.dataset.active = stepNumber === currentStep;\n step.dataset.completed = stepNumber < currentStep;\n step.setAttribute(\"aria-disabled\", stepNumber > currentStep);\n });\n\n // Update step content visibility\n stepContents.forEach((content) => {\n const contentStep = parseInt(content.dataset.stepContent, 10);\n if (contentStep === currentStep) {\n content.classList.remove(\"hidden\");\n } else {\n content.classList.add(\"hidden\");\n }\n });\n\n // Enable/disable buttons based on step\n prevButtons.forEach((button) => {\n button.disabled = currentStep === 1;\n });\n\n nextButtons.forEach((button) => {\n button.disabled = currentStep === steps.length;\n });\n }\n\n // Event listeners for buttons\n function onNextButtonClick() {\n if (currentStep < steps.length) {\n currentStep++;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n function onPrevButtonClick() {\n if (currentStep > 1) {\n currentStep--;\n container.dataset.currentStep = currentStep;\n updateState();\n }\n }\n\n nextButtons.forEach((button) => {\n button.addEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.addEventListener(\"click\", onPrevButtonClick);\n });\n\n // Store references to cleanup\n container.__stepperCleanup = () => {\n nextButtons.forEach((button) => {\n button.removeEventListener(\"click\", onNextButtonClick);\n });\n\n prevButtons.forEach((button) => {\n button.removeEventListener(\"click\", onPrevButtonClick);\n });\n };\n\n // Initialize the state\n updateState();\n}\n\n// Function to initialize all steppers\nexport function initStepper() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (!initializedStepperElements.has(container)) {\n initializedStepperElements.add(container);\n\n // Set initial step based on attribute\n const initialStep = parseInt(container.getAttribute(\"data-initial-step\") || \"1\", 10);\n container.dataset.currentStep = initialStep;\n\n updateStepperState(container);\n }\n });\n}\n\n// Cleanup function to remove all steppers\nexport function cleanupSteppers() {\n document.querySelectorAll(\"[data-stepper-container]\").forEach((container) => {\n if (container.__stepperCleanup) {\n container.__stepperCleanup();\n delete container.__stepperCleanup;\n }\n\n initializedStepperElements.delete(container);\n });\n}\n\n// Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initStepper();\n new MutationObserver(initStepper).observe(document.body, {\n childList: true,\n subtree: true,\n });\n });\n}","// Gallery component\nconst initializedElements = new WeakSet();\n\nexport function changeMainImage(event) {\n const thumbnail = event.currentTarget;\n const mainImage = document.querySelector('[data-main-image]');\n\n if (mainImage) {\n // Change the main image's src to the clicked thumbnail's src\n mainImage.src = thumbnail.src;\n\n // Optional: Add an \"active\" class to the clicked thumbnail\n document.querySelectorAll('[data-thumbnail]').forEach((thumb) => {\n thumb.classList.remove('active-thumbnail');\n });\n thumbnail.classList.add('active-thumbnail');\n }\n}\n\nexport function initGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (!initializedElements.has(thumbnail)) {\n thumbnail.addEventListener('click', changeMainImage);\n initializedElements.add(thumbnail);\n }\n });\n}\n\nexport function cleanupGallery() {\n document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {\n if (initializedElements.has(thumbnail)) {\n thumbnail.removeEventListener('click', changeMainImage);\n initializedElements.delete(thumbnail);\n }\n });\n}\n\n// Auto-initialize on DOMContentLoaded and observe dynamically added elements\nif (typeof window !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n initGallery(); // Initialize gallery after DOM is loaded\n\n // Observe the DOM for dynamically added thumbnails\n const observer = new MutationObserver(() => {\n initGallery(); // Re-initialize gallery when new elements are added\n });\n observer.observe(document.body, { childList: true, subtree: true });\n });\n}","import { loadPopperJs } from './utils/loadPopper.js';\n\n// Import components\nimport { initDropdowns, cleanupDropdowns } from './dropdown/dropdown.js';\nimport { initPopovers, cleanupPopovers } from './popover/popover.js';\nimport { initTooltips, cleanupTooltips } from './tooltip/tooltip.js';\nimport { initAlert } from './alert/alert.js';\nimport { initCollapse } from './collapse/collapse.js';\nimport { initTabs, cleanupTabs } from './tabs/tabs.js';\nimport { initModal, cleanupModals } from './modal/modal.js';\nimport { initAccordion, cleanupAccordions } from './accordion/accordion.js';\nimport { initStepper, cleanupSteppers } from './stepper/stepper.js';\nimport { initGallery, cleanupGallery } from './gallery/gallery.js';\n\n// Export individual components for named imports\nexport {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// Combine all features into a global object\nconst DavidAI = {\n initAlert,\n initCollapse,\n initDropdowns,\n cleanupDropdowns,\n initPopovers,\n cleanupPopovers,\n initTooltips,\n cleanupTooltips,\n initTabs,\n cleanupTabs,\n initModal,\n cleanupModals,\n initAccordion,\n cleanupAccordions,\n initStepper,\n cleanupSteppers,\n initGallery,\n cleanupGallery,\n};\n\n// **Global Initialization Function**\nexport function initDavidAI() {\n // Initialize Popper-independent components\n initAlert();\n initCollapse();\n initTabs();\n initModal();\n initAccordion();\n initStepper();\n initGallery();\n // Load Popper.js once, then initialize Popper-dependent components\n loadPopperJs()\n .then(() => {\n initDropdowns();\n initPopovers();\n initTooltips();\n })\n .catch((error) => {\n console.error(\"Failed to load Popper.js:\", error);\n });\n}\n\n// Auto-initialize components in the browser environment\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Use the global initializer\n initDavidAI();\n\n // Observe DOM for dynamically added elements to auto-initialize\n const observer = new MutationObserver(() => {\n initAlert();\n initCollapse();\n initAccordion();\n initStepper();\n initTabs();\n initModal();\n initDropdowns();\n initPopovers();\n initTooltips();\n initGallery();\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n // Expose DavidAI globally for UMD\n window.DavidAI = { ...DavidAI, initDavidAI };\n });\n}\n\nexport default { ...DavidAI, initDavidAI };\n"],"names":["popperLoaded","popperReady","loadPopperJs","Promise","resolve","reject","window","Popper","script","document","createElement","src","defer","onload","onerror","Error","head","appendChild","initializedDropdowns","WeakSet","activeDropdowns","Dropdown","dropdownElement","_classCallCheck","this","dropdown","button","querySelector","menu","popperInstance","placement","getAttribute","init","key","value","_init","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this","wrap","_context","prev","next","createPopper","modifiers","name","options","offset","addEventListener","e","stopPropagation","toggleDropdown","contains","target","closeDropdown","push","stop","apply","arguments","openDropdown","setAttribute","hidden","classList","remove","update","add","initDropdowns","querySelectorAll","forEach","has","cleanupDropdowns","_ref","destroy","_loadAndInitDropdowns","_callee2","_context2","loadAndInitDropdowns","MutationObserver","observe","body","childList","subtree","initializedPopovers","activePopovers","initPopovers","trigger","_trigger$nextElementS","popoverClasses","plainContent","isOpenByDefault","hasAttribute","popoverInstance","popoverElement","originalContentElement","contentElement","nextElementSibling","matches","event","filter","p","openPopover","_openPopover","className","cloneNode","textContent","console","error","abrupt","setTimeout","style","opacity","transform","cleanupPopovers","_loadAndInitPopovers","loadAndInitPopovers","initializedTooltips","activeTooltips","initTooltips","title","tooltipClasses","tooltipInstance","tooltipElement","customContentElement","_showTooltip","t","contentClone","warn","cleanupTooltips","_loadAndInitTooltips","loadAndInitTooltips","initializedElements","closeAlert","alert","currentTarget","closest","initAlert","toggleCollapse","collapseID","startsWith","collapseElement","isExpanded","maxHeight","scrollHeight","icon","toggle","initCollapse","initializedTabs","initTabs","tabGroup","activeLink","tabList","tabLinks","tabContents","indicator","isVertical","activateTab","length","link","preventDefault","item","content","targetContent","getElementById","rect","getBoundingClientRect","parentRect","requestAnimationFrame","concat","top","height","left","width","scale","updateIndicator","cleanupTabs","clone","parentNode","replaceChild","initializedModals","activeModals","toggleModal","modalID","modal","isHidden","modalContent","closeOnOutsideClick","removeEventListener","m","closeModal","initModal","cleanupModals","initializedAccordionElements","toggleAccordionState","targetElement","isRotating","undefined","openIcon","closeIcon","rotatingIcon","display","handleIcons","toggleAccordion","targetID","parentElement","mode","otherTargetID","otherElement","initAccordion","container","buttons","Array","from","btn","slice","cleanupAccordions","toggleAccordionById","targetId","toggleButton","initializedStepperElements","initStepper","initialStep","parseInt","dataset","currentStep","steps","stepContents","prevButtons","nextButtons","updateState","step","index","stepNumber","active","completed","stepContent","disabled","onNextButtonClick","onPrevButtonClick","__stepperCleanup","updateStepperState","cleanupSteppers","changeMainImage","thumbnail","mainImage","thumb","initGallery","cleanupGallery","DavidAI","initDavidAI","then","_objectSpread"],"mappings":";;;;;yjQAAA,IAAIA,GAAe,EACfC,EAAc,KAEX,SAASC,IACd,OAAIF,EACKC,GAETD,GAAe,EAEfC,EAAc,IAAIE,SAAQ,SAAUC,EAASC,GAC3C,GAAIC,OAAOC,OACTH,EAAQE,OAAOC,YADjB,CAIA,IAAIC,EAASC,SAASC,cAAc,UACpCF,EAAOG,IAAM,qCACbH,EAAOI,OAAQ,EACfJ,EAAOK,OAAS,WACdP,OAAOC,OAASD,OAAOC,QAAUD,OAAOC,OACxCH,EAAQE,OA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AgI,IACF,IAESvK,QAAQvE,SAASwE,KAAM,CAAEC,WAAW,EAAMC,SAAS,IAG5D7E,OAAOmP,QAAOG,EAAAA,KAAQH,IAAO,GAAA,CAAEC,YAAAA,IACjC,IAGFE,IAAAA,GAAAA,EAAAA,EAAA,CAAA,EAAoBH,IAAO,CAAA,EAAA,CAAEC,YAAAA"}
\ No newline at end of file
diff --git a/packages/package.json b/packages/package.json
index f537133..98d56f7 100644
--- a/packages/package.json
+++ b/packages/package.json
@@ -1,6 +1,6 @@
{
"name": "david-ai",
- "version": "1.0.4",
+ "version": "1.0.5",
"description": "David UI is a free and open-source collection of customizable, production-ready UI components built with Tailwind CSS",
"main": "dist/david-ai.js",
"module": "dist/david-ai.esm.js",
diff --git a/packages/rollup.config.js b/packages/rollup.config.js
index 677005e..ed0c181 100644
--- a/packages/rollup.config.js
+++ b/packages/rollup.config.js
@@ -6,6 +6,18 @@ import terser from '@rollup/plugin-terser';
const inputFile = 'src/index.js'; // Entry file
const outputDir = 'dist'; // Output directory
+import { readFileSync } from 'fs';
+
+const pkg = JSON.parse(readFileSync('./package.json'));
+
+const copyrightBanner = `
+/*!
+ * David AI JavaScript Library v${pkg.version}
+ * (c) ${new Date().getFullYear()} David AI - Creative Tim
+ * Released under the MIT License.
+ */
+`;
+
export default [
// UMD Build (Non-minified)
{
@@ -16,6 +28,7 @@ export default [
name: 'DavidAI', // Global variable for browsers
exports: 'named', // Ensure named exports
sourcemap: true,
+ banner: copyrightBanner,
},
plugins: [
resolve(),
@@ -35,6 +48,7 @@ export default [
name: 'DavidAI',
exports: 'named',
sourcemap: true,
+ banner: copyrightBanner,
},
plugins: [
resolve(),
@@ -53,6 +67,7 @@ export default [
file: `${outputDir}/david-ai.esm.js`,
format: 'esm', // ES module format
sourcemap: true,
+ banner: copyrightBanner,
},
plugins: [
resolve(),
diff --git a/packages/src/accordion/accordion.js b/packages/src/accordion/accordion.js
new file mode 100644
index 0000000..417ec1c
--- /dev/null
+++ b/packages/src/accordion/accordion.js
@@ -0,0 +1,147 @@
+// Accordion Component
+const initializedAccordionElements = new WeakSet();
+
+// Helper function to handle icons
+const handleIcons = (button, isExpanded, isRotating = false) => {
+ const openIcon = button.querySelector("[data-dui-accordion-icon-open]");
+ const closeIcon = button.querySelector("[data-dui-accordion-icon-close]");
+ const rotatingIcon = button.querySelector("[data-dui-accordion-icon]");
+
+ if (openIcon && closeIcon) {
+ openIcon.style.display = isExpanded ? "block" : "none";
+ closeIcon.style.display = isExpanded ? "none" : "block";
+ }
+ if (rotatingIcon) {
+ rotatingIcon.classList.toggle("rotate-180", isRotating ? isExpanded : !isExpanded);
+ }
+};
+
+// Helper function to toggle accordion state
+const toggleAccordionState = (targetElement, button, isExpanded) => {
+ targetElement.style.maxHeight = isExpanded ? targetElement.scrollHeight + "px" : "0";
+ button.setAttribute("aria-expanded", isExpanded);
+ handleIcons(button, isExpanded);
+};
+
+// Function to toggle accordion items
+export function toggleAccordion(event) {
+ if (event.currentTarget.getAttribute("aria-disabled") === "true") return;
+
+ const targetID = event.currentTarget.getAttribute("data-dui-accordion-target");
+ const parentElement = event.currentTarget.closest("[data-dui-accordion-container]");
+ const mode = parentElement?.getAttribute("data-dui-accordion-mode");
+
+ if (targetID?.startsWith("#")) {
+ const targetElement = document.querySelector(targetID);
+ const isExpanded = event.currentTarget.getAttribute("aria-expanded") === "true";
+
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(button => {
+ const otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetID) {
+ const otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+
+ if (targetElement) {
+ toggleAccordionState(targetElement, event.currentTarget, !isExpanded);
+ }
+ }
+}
+
+// Function to manually toggle accordion item by ID
+export function toggleAccordionById(targetId) {
+ targetId = targetId.startsWith('#') ? targetId : '#' + targetId;
+
+ const targetElement = document.querySelector(targetId);
+ const toggleButton = document.querySelector(`[data-dui-accordion-target="${targetId}"]`);
+
+ if (toggleButton?.getAttribute("aria-disabled") === "true" || !targetElement || !toggleButton) return;
+
+ const isExpanded = toggleButton.getAttribute("aria-expanded") === "true";
+ const parentElement = toggleButton.closest("[data-dui-accordion-container]");
+ const mode = parentElement?.getAttribute("data-dui-accordion-mode");
+
+ if (mode === "exclusive" && parentElement) {
+ parentElement.querySelectorAll("[data-dui-accordion-toggle]").forEach(button => {
+ const otherTargetID = button.getAttribute("data-dui-accordion-target");
+ if (otherTargetID !== targetId) {
+ const otherElement = document.querySelector(otherTargetID);
+ if (otherElement) {
+ toggleAccordionState(otherElement, button, false);
+ }
+ }
+ });
+ }
+
+ toggleAccordionState(targetElement, toggleButton, !isExpanded);
+}
+
+// Function to initialize accordion functionality
+export function initAccordion() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(button => {
+ if (!initializedAccordionElements.has(button)) {
+ button.addEventListener("click", toggleAccordion);
+ initializedAccordionElements.add(button);
+
+ const targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ const isExpanded = button.getAttribute("aria-expanded") === "true";
+
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, isExpanded);
+ }
+ }
+ });
+
+ document.querySelectorAll("[data-dui-accordion-container]").forEach(container => {
+ const mode = container.getAttribute("data-dui-accordion-mode");
+ const buttons = container.querySelectorAll("[data-dui-accordion-toggle]");
+
+ if (mode === "exclusive") {
+ const expandedButtons = Array.from(buttons).filter(btn =>
+ btn.getAttribute("aria-expanded") === "true"
+ );
+
+ expandedButtons.slice(1).forEach(button => {
+ const targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, false);
+ }
+ });
+ } else if (mode === "all-open") {
+ buttons.forEach(button => {
+ const targetElement = document.querySelector(button.getAttribute("data-dui-accordion-target"));
+ if (targetElement) {
+ toggleAccordionState(targetElement, button, true);
+ }
+ });
+ }
+ });
+}
+
+// Function to cleanup accordion functionality
+export function cleanupAccordions() {
+ document.querySelectorAll("[data-dui-accordion-toggle]").forEach(button => {
+ if (initializedAccordionElements.has(button)) {
+ button.removeEventListener("click", toggleAccordion);
+ initializedAccordionElements.delete(button);
+ }
+ });
+}
+
+// Make toggleAccordionById available globally
+if (typeof window !== "undefined") {
+ window.toggleAccordionById = toggleAccordionById;
+
+ document.addEventListener("DOMContentLoaded", () => {
+ initAccordion();
+ new MutationObserver(initAccordion).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ });
+}
diff --git a/packages/src/gallery/gallery.js b/packages/src/gallery/gallery.js
new file mode 100644
index 0000000..5f63a58
--- /dev/null
+++ b/packages/src/gallery/gallery.js
@@ -0,0 +1,49 @@
+// Gallery component
+const initializedElements = new WeakSet();
+
+export function changeMainImage(event) {
+ const thumbnail = event.currentTarget;
+ const mainImage = document.querySelector('[data-main-image]');
+
+ if (mainImage) {
+ // Change the main image's src to the clicked thumbnail's src
+ mainImage.src = thumbnail.src;
+
+ // Optional: Add an "active" class to the clicked thumbnail
+ document.querySelectorAll('[data-thumbnail]').forEach((thumb) => {
+ thumb.classList.remove('active-thumbnail');
+ });
+ thumbnail.classList.add('active-thumbnail');
+ }
+}
+
+export function initGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {
+ if (!initializedElements.has(thumbnail)) {
+ thumbnail.addEventListener('click', changeMainImage);
+ initializedElements.add(thumbnail);
+ }
+ });
+}
+
+export function cleanupGallery() {
+ document.querySelectorAll('[data-thumbnail]').forEach((thumbnail) => {
+ if (initializedElements.has(thumbnail)) {
+ thumbnail.removeEventListener('click', changeMainImage);
+ initializedElements.delete(thumbnail);
+ }
+ });
+}
+
+// Auto-initialize on DOMContentLoaded and observe dynamically added elements
+if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", () => {
+ initGallery(); // Initialize gallery after DOM is loaded
+
+ // Observe the DOM for dynamically added thumbnails
+ const observer = new MutationObserver(() => {
+ initGallery(); // Re-initialize gallery when new elements are added
+ });
+ observer.observe(document.body, { childList: true, subtree: true });
+ });
+}
\ No newline at end of file
diff --git a/packages/src/index.js b/packages/src/index.js
index a596e53..7e46a97 100644
--- a/packages/src/index.js
+++ b/packages/src/index.js
@@ -8,6 +8,9 @@ import { initAlert } from './alert/alert.js';
import { initCollapse } from './collapse/collapse.js';
import { initTabs, cleanupTabs } from './tabs/tabs.js';
import { initModal, cleanupModals } from './modal/modal.js';
+import { initAccordion, cleanupAccordions } from './accordion/accordion.js';
+import { initStepper, cleanupSteppers } from './stepper/stepper.js';
+import { initGallery, cleanupGallery } from './gallery/gallery.js';
// Export individual components for named imports
export {
@@ -23,6 +26,12 @@ export {
cleanupTabs,
initModal,
cleanupModals,
+ initAccordion,
+ cleanupAccordions,
+ initStepper,
+ cleanupSteppers,
+ initGallery,
+ cleanupGallery,
};
// Combine all features into a global object
@@ -39,6 +48,12 @@ const DavidAI = {
cleanupTabs,
initModal,
cleanupModals,
+ initAccordion,
+ cleanupAccordions,
+ initStepper,
+ cleanupSteppers,
+ initGallery,
+ cleanupGallery,
};
// **Global Initialization Function**
@@ -48,7 +63,9 @@ export function initDavidAI() {
initCollapse();
initTabs();
initModal();
-
+ initAccordion();
+ initStepper();
+ initGallery();
// Load Popper.js once, then initialize Popper-dependent components
loadPopperJs()
.then(() => {
@@ -71,11 +88,14 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
const observer = new MutationObserver(() => {
initAlert();
initCollapse();
+ initAccordion();
+ initStepper();
initTabs();
initModal();
initDropdowns();
initPopovers();
initTooltips();
+ initGallery();
});
observer.observe(document.body, { childList: true, subtree: true });
diff --git a/packages/src/stepper/stepper.js b/packages/src/stepper/stepper.js
new file mode 100644
index 0000000..8aadede
--- /dev/null
+++ b/packages/src/stepper/stepper.js
@@ -0,0 +1,116 @@
+// Stepper Component
+const initializedStepperElements = new WeakSet();
+
+function updateStepperState(container) {
+ const steps = container.querySelectorAll("[data-step]");
+ const stepContents = container.querySelectorAll("[data-step-content]");
+ const prevButtons = container.querySelectorAll("[data-stepper-prev]");
+ const nextButtons = container.querySelectorAll("[data-stepper-next]");
+ let currentStep = parseInt(container.dataset.currentStep || "1", 10);
+
+ function updateState() {
+ // Update step circles and connector lines
+ steps.forEach((step, index) => {
+ const stepNumber = index + 1;
+ step.dataset.active = stepNumber === currentStep;
+ step.dataset.completed = stepNumber < currentStep;
+ step.setAttribute("aria-disabled", stepNumber > currentStep);
+ });
+
+ // Update step content visibility
+ stepContents.forEach((content) => {
+ const contentStep = parseInt(content.dataset.stepContent, 10);
+ if (contentStep === currentStep) {
+ content.classList.remove("hidden");
+ } else {
+ content.classList.add("hidden");
+ }
+ });
+
+ // Enable/disable buttons based on step
+ prevButtons.forEach((button) => {
+ button.disabled = currentStep === 1;
+ });
+
+ nextButtons.forEach((button) => {
+ button.disabled = currentStep === steps.length;
+ });
+ }
+
+ // Event listeners for buttons
+ function onNextButtonClick() {
+ if (currentStep < steps.length) {
+ currentStep++;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+
+ function onPrevButtonClick() {
+ if (currentStep > 1) {
+ currentStep--;
+ container.dataset.currentStep = currentStep;
+ updateState();
+ }
+ }
+
+ nextButtons.forEach((button) => {
+ button.addEventListener("click", onNextButtonClick);
+ });
+
+ prevButtons.forEach((button) => {
+ button.addEventListener("click", onPrevButtonClick);
+ });
+
+ // Store references to cleanup
+ container.__stepperCleanup = () => {
+ nextButtons.forEach((button) => {
+ button.removeEventListener("click", onNextButtonClick);
+ });
+
+ prevButtons.forEach((button) => {
+ button.removeEventListener("click", onPrevButtonClick);
+ });
+ };
+
+ // Initialize the state
+ updateState();
+}
+
+// Function to initialize all steppers
+export function initStepper() {
+ document.querySelectorAll("[data-stepper-container]").forEach((container) => {
+ if (!initializedStepperElements.has(container)) {
+ initializedStepperElements.add(container);
+
+ // Set initial step based on attribute
+ const initialStep = parseInt(container.getAttribute("data-initial-step") || "1", 10);
+ container.dataset.currentStep = initialStep;
+
+ updateStepperState(container);
+ }
+ });
+}
+
+// Cleanup function to remove all steppers
+export function cleanupSteppers() {
+ document.querySelectorAll("[data-stepper-container]").forEach((container) => {
+ if (container.__stepperCleanup) {
+ container.__stepperCleanup();
+ delete container.__stepperCleanup;
+ }
+
+ initializedStepperElements.delete(container);
+ });
+}
+
+// Auto-initialize steppers on DOMContentLoaded and observe dynamically added elements
+if (typeof window !== "undefined") {
+ document.addEventListener("DOMContentLoaded", () => {
+ initStepper();
+ new MutationObserver(initStepper).observe(document.body, {
+ childList: true,
+ subtree: true,
+ });
+ });
+}
\ No newline at end of file