main
js 20 lines 683 Bytes
Raw
1 /**
2 * Build the shared three-bubble loading indicator.
3 *
4 * The caller owns status text and ARIA live-region behavior so this visual can
5 * be reused inside an existing status container without duplicate announcements.
6 */
7 export function createThreeBubbleLoader({ active = true } = {}) {
8 const loader = document.createElement("span");
9 loader.className = "three-bubble-loader";
10 loader.classList.toggle("is-active", active);
11 loader.setAttribute("aria-hidden", "true");
12
13 for (let index = 0; index < 3; index += 1) {
14 const bubble = document.createElement("span");
15 bubble.className = "three-bubble-loader-dot";
16 loader.appendChild(bubble);
17 }
18
19 return loader;
20 }