@bluevolt-tech/lumen 2.1.0 → 2.2.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.
@@ -21,8 +21,7 @@ function adoptStyles(shadow, css) {
21
21
 
22
22
  // components/_shared/dropdown-controller.ts
23
23
  function bindDropdownController(host, options = {}) {
24
- const shadow = host.shadowRoot;
25
- if (!shadow) {
24
+ if (!host.shadowRoot) {
26
25
  throw new Error("bindDropdownController requires the host to have an open shadow root.");
27
26
  }
28
27
  const syncExpanded = () => {
@@ -37,24 +36,27 @@ function bindDropdownController(host, options = {}) {
37
36
  syncExpanded();
38
37
  host.dispatchEvent(new CustomEvent("bv-open", { bubbles: true, composed: true }));
39
38
  };
40
- const close = () => {
39
+ const closeWithReason = (reason) => {
40
+ var _a;
41
41
  if (!host.hasAttribute("open")) return;
42
+ if (options.canClose && !options.canClose(reason)) return;
42
43
  host.removeAttribute("open");
43
44
  syncExpanded();
45
+ (_a = options.onAfterClose) == null ? void 0 : _a.call(options);
44
46
  };
47
+ const close = () => closeWithReason("programmatic");
45
48
  const toggle = () => {
46
- if (host.hasAttribute("open")) close();
49
+ if (host.hasAttribute("open")) closeWithReason("programmatic");
47
50
  else open();
48
51
  };
49
52
  const offClick = (e) => {
50
53
  if (!host.hasAttribute("open")) return;
51
- const target = e.target;
52
- if (host.contains(target) || shadow.contains(target)) return;
53
- close();
54
+ if (e.composedPath().includes(host)) return;
55
+ closeWithReason("outside-click");
54
56
  };
55
57
  document.addEventListener("click", offClick);
56
58
  const onKeyDown = (e) => {
57
- if (e.key === "Escape") close();
59
+ if (e.key === "Escape") closeWithReason("escape");
58
60
  };
59
61
  host.addEventListener("keydown", onKeyDown);
60
62
  const observer = new MutationObserver(syncExpanded);
@@ -21,8 +21,7 @@ function adoptStyles(shadow, css) {
21
21
 
22
22
  // components/_shared/dropdown-controller.ts
23
23
  function bindDropdownController(host, options = {}) {
24
- const shadow = host.shadowRoot;
25
- if (!shadow) {
24
+ if (!host.shadowRoot) {
26
25
  throw new Error("bindDropdownController requires the host to have an open shadow root.");
27
26
  }
28
27
  const syncExpanded = () => {
@@ -37,24 +36,27 @@ function bindDropdownController(host, options = {}) {
37
36
  syncExpanded();
38
37
  host.dispatchEvent(new CustomEvent("bv-open", { bubbles: true, composed: true }));
39
38
  };
40
- const close = () => {
39
+ const closeWithReason = (reason) => {
40
+ var _a;
41
41
  if (!host.hasAttribute("open")) return;
42
+ if (options.canClose && !options.canClose(reason)) return;
42
43
  host.removeAttribute("open");
43
44
  syncExpanded();
45
+ (_a = options.onAfterClose) == null ? void 0 : _a.call(options);
44
46
  };
47
+ const close = () => closeWithReason("programmatic");
45
48
  const toggle = () => {
46
- if (host.hasAttribute("open")) close();
49
+ if (host.hasAttribute("open")) closeWithReason("programmatic");
47
50
  else open();
48
51
  };
49
52
  const offClick = (e) => {
50
53
  if (!host.hasAttribute("open")) return;
51
- const target = e.target;
52
- if (host.contains(target) || shadow.contains(target)) return;
53
- close();
54
+ if (e.composedPath().includes(host)) return;
55
+ closeWithReason("outside-click");
54
56
  };
55
57
  document.addEventListener("click", offClick);
56
58
  const onKeyDown = (e) => {
57
- if (e.key === "Escape") close();
59
+ if (e.key === "Escape") closeWithReason("escape");
58
60
  };
59
61
  host.addEventListener("keydown", onKeyDown);
60
62
  const observer = new MutationObserver(syncExpanded);
@@ -100,6 +100,7 @@ var BvTooltip = class extends HTMLElement {
100
100
  popup.style.transform = "none";
101
101
  popup.style.display = "block";
102
102
  popup.style.visibility = "hidden";
103
+ void popup.offsetHeight;
103
104
  const tRect = trigger.getBoundingClientRect();
104
105
  const pRect = popup.getBoundingClientRect();
105
106
  const vw = window.innerWidth;
@@ -97,6 +97,7 @@ var BvTooltip = class extends HTMLElement {
97
97
  popup.style.transform = "none";
98
98
  popup.style.display = "block";
99
99
  popup.style.visibility = "hidden";
100
+ void popup.offsetHeight;
100
101
  const tRect = trigger.getBoundingClientRect();
101
102
  const pRect = popup.getBoundingClientRect();
102
103
  const vw = window.innerWidth;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 29 Jul 2026 02:00:42 GMT
3
+ * Generated on Thu, 30 Jul 2026 05:33:55 GMT
4
4
  */
5
5
 
6
6
  :root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluevolt-tech/lumen",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
package/themes/base.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 29 Jul 2026 02:00:42 GMT
3
+ * Generated on Thu, 30 Jul 2026 05:33:55 GMT
4
4
  */
5
5
 
6
6
  :root {