@kerkhoff-ict/solora 2.0.7 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css CHANGED
@@ -466,10 +466,6 @@
466
466
  .dropdown.open .dropdown-btn:after {
467
467
  transform: rotate(180deg);
468
468
  }
469
- .dropdown-btn:focus {
470
- outline: 2px solid var(--color-primary, #0071e3);
471
- outline-offset: 2px;
472
- }
473
469
  .dropdown-content {
474
470
  position: absolute;
475
471
  top: 100%;
@@ -478,12 +474,14 @@
478
474
  min-width: 10rem;
479
475
  border-radius: 12px;
480
476
  margin-top: 0.5rem;
481
- background: rgba(255, 255, 255, 0.8);
477
+ overflow: hidden;
478
+ overflow-y: auto;
479
+ background: rgba(255, 255, 255, 0);
480
+ border: 1px solid rgba(255, 255, 255, 0.3);
482
481
  backdrop-filter: blur(12px);
483
482
  -webkit-backdrop-filter: blur(12px);
484
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
483
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
485
484
  max-height: 15rem;
486
- overflow-y: auto;
487
485
  scrollbar-width: thin;
488
486
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
489
487
  opacity: 0;
package/dist/index.js CHANGED
@@ -1870,18 +1870,20 @@ function initDropdowns() {
1870
1870
  };
1871
1871
  const initialItem = content.querySelector(".dropdown-item.active") || content.querySelector('.dropdown-item:not([aria-disabled="true"])');
1872
1872
  if (initialItem) setValue(initialItem);
1873
+ const openDropdown = () => drop.classList.add("open");
1874
+ const closeDropdown = () => drop.classList.remove("open");
1873
1875
  btn.addEventListener("click", (e) => {
1874
1876
  if (drop.getAttribute("aria-disabled") === "true") return;
1875
1877
  e.stopPropagation();
1876
1878
  drop.classList.toggle("open");
1877
1879
  });
1878
1880
  document.addEventListener("click", (e) => {
1879
- if (!drop.contains(e.target)) drop.classList.remove("open");
1881
+ if (!drop.contains(e.target)) closeDropdown();
1880
1882
  });
1881
1883
  content.querySelectorAll(".dropdown-item").forEach((item) => {
1882
1884
  item.addEventListener("click", () => {
1883
1885
  setValue(item);
1884
- drop.classList.remove("open");
1886
+ closeDropdown();
1885
1887
  });
1886
1888
  });
1887
1889
  let items = Array.from(content.querySelectorAll('.dropdown-item:not([aria-disabled="true"])'));
@@ -1890,7 +1892,7 @@ function initDropdowns() {
1890
1892
  if (drop.getAttribute("aria-disabled") === "true") return;
1891
1893
  if (!["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.key)) return;
1892
1894
  e.preventDefault();
1893
- drop.classList.add("open");
1895
+ openDropdown();
1894
1896
  if (e.key === "ArrowDown") {
1895
1897
  index = (index + 1) % items.length;
1896
1898
  items.forEach((i) => i.classList.remove("active"));
@@ -1905,10 +1907,10 @@ function initDropdowns() {
1905
1907
  }
1906
1908
  if (e.key === "Enter") {
1907
1909
  setValue(items[index]);
1908
- drop.classList.remove("open");
1910
+ closeDropdown();
1909
1911
  }
1910
1912
  if (e.key === "Escape") {
1911
- drop.classList.remove("open");
1913
+ closeDropdown();
1912
1914
  }
1913
1915
  });
1914
1916
  btn.setAttribute("tabindex", "0");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerkhoff-ict/solora",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "description": "Simple CSS component library",
5
5
  "main": "dist/index.js",
6
6
  "style": "dist/index.css",