@orbitkit/components 0.2.0 → 0.3.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.
Files changed (62) hide show
  1. package/dist/astro/accordion/Accordion.astro +34 -34
  2. package/dist/astro/accordion/AccordionItem.astro +19 -19
  3. package/dist/astro/accordion/AccordionTrigger.astro +33 -33
  4. package/dist/astro/accordion/AcordionContent.astro +23 -23
  5. package/dist/astro/accordion/accordion.ts +151 -151
  6. package/dist/astro/accordion/index.ts +6 -6
  7. package/dist/astro/collapsible/Collapsible.astro +34 -34
  8. package/dist/astro/collapsible/CollapsibleContent.astro +20 -20
  9. package/dist/astro/collapsible/collapsible.ts +81 -81
  10. package/dist/astro/collapsible/index.ts +4 -4
  11. package/dist/astro/drawer/DrawerContent.astro +74 -74
  12. package/dist/astro/drawer/drawer.ts +104 -104
  13. package/dist/astro/drawer/index.ts +17 -17
  14. package/dist/astro/dropdown/DropdownMenu.astro +19 -19
  15. package/dist/astro/dropdown/DropdownMenuContent.astro +42 -42
  16. package/dist/astro/dropdown/DropdownMenuGroup.astro +3 -3
  17. package/dist/astro/dropdown/DropdownMenuItem.astro +27 -27
  18. package/dist/astro/dropdown/DropdownMenuLabel.astro +3 -3
  19. package/dist/astro/dropdown/DropdownMenuSeparator.astro +6 -6
  20. package/dist/astro/dropdown/dropdown.ts +157 -157
  21. package/dist/astro/dropdown/dropdownVariants.ts +134 -134
  22. package/dist/astro/dropdown/index.ts +23 -23
  23. package/dist/astro/marquee/Marquee.astro +53 -0
  24. package/dist/astro/marquee/index.ts +3 -0
  25. package/dist/astro/modal/Modal.astro +19 -19
  26. package/dist/astro/modal/ModalContent.astro +71 -71
  27. package/dist/astro/modal/ModalDescription.astro +12 -12
  28. package/dist/astro/modal/ModalFooter.astro +15 -15
  29. package/dist/astro/modal/ModalHeader.astro +12 -12
  30. package/dist/astro/modal/ModalTitle.astro +18 -18
  31. package/dist/astro/modal/index.ts +15 -15
  32. package/dist/astro/modal/modal.ts +101 -101
  33. package/dist/astro/pagination/index.ts +15 -15
  34. package/dist/astro/popover/Popover.astro +17 -17
  35. package/dist/astro/popover/PopoverContent.astro +39 -39
  36. package/dist/astro/popover/index.ts +5 -5
  37. package/dist/astro/popover/popover.ts +113 -113
  38. package/dist/astro/popover/popoverVariants.ts +115 -115
  39. package/dist/astro/scroll-progress/ScrollProgress.astro +41 -0
  40. package/dist/astro/scroll-progress/ScrollProgressBar.astro +19 -0
  41. package/dist/astro/scroll-progress/index.ts +4 -0
  42. package/dist/astro/stat/Stat.astro +12 -12
  43. package/dist/astro/stat/StatDescription.astro +12 -12
  44. package/dist/astro/stat/StatTitle.astro +18 -18
  45. package/dist/astro/stat/StatValue.astro +12 -12
  46. package/dist/astro/stat/index.ts +6 -6
  47. package/dist/astro/tab/TabList.astro +19 -19
  48. package/dist/astro/toast/Toast.astro +36 -0
  49. package/dist/astro/toast/ToastDescription.astro +10 -0
  50. package/dist/astro/toast/ToastTitle.astro +18 -0
  51. package/dist/astro/toast/Toaster.astro +78 -0
  52. package/dist/astro/toast/assets.ts +6 -0
  53. package/dist/astro/toast/index.ts +30 -0
  54. package/dist/astro/toast/toast.ts +277 -0
  55. package/dist/astro/tooltip/Tooltip.astro +40 -40
  56. package/dist/astro/tooltip/TooltipContent.astro +39 -39
  57. package/dist/astro/tooltip/index.ts +5 -5
  58. package/dist/astro/tooltip/tooltip.ts +137 -137
  59. package/dist/astro/tooltip/tooltipVariants.ts +115 -115
  60. package/dist/index.js +12 -0
  61. package/dist/index.js.map +1 -1
  62. package/package.json +54 -54
@@ -1,15 +1,15 @@
1
- import Modal from "./Modal.astro";
2
- import ModalContent from "./ModalContent.astro";
3
- import ModalDescription from "./ModalDescription.astro";
4
- import ModalFooter from "./ModalFooter.astro";
5
- import ModalHeader from "./ModalHeader.astro";
6
- import ModalTitle from "./ModalTitle.astro";
7
-
8
- export {
9
- Modal,
10
- ModalContent,
11
- ModalDescription,
12
- ModalFooter,
13
- ModalHeader,
14
- ModalTitle,
15
- };
1
+ import Modal from "./Modal.astro";
2
+ import ModalContent from "./ModalContent.astro";
3
+ import ModalDescription from "./ModalDescription.astro";
4
+ import ModalFooter from "./ModalFooter.astro";
5
+ import ModalHeader from "./ModalHeader.astro";
6
+ import ModalTitle from "./ModalTitle.astro";
7
+
8
+ export {
9
+ Modal,
10
+ ModalContent,
11
+ ModalDescription,
12
+ ModalFooter,
13
+ ModalHeader,
14
+ ModalTitle,
15
+ };
@@ -1,101 +1,101 @@
1
- export class Modal {
2
- private wrapper: HTMLElement;
3
- private modal: HTMLElement | null;
4
- private trigger: HTMLElement | null;
5
- private backdrop: HTMLElement | null;
6
- private closeButtons: NodeListOf<HTMLElement> | null;
7
-
8
- constructor(wrapper: HTMLElement) {
9
- this.wrapper = wrapper;
10
- this.modal = this.wrapper.querySelector("[data-modal]");
11
- this.backdrop = this.wrapper.querySelector("[data-backdrop]");
12
- this.trigger = this.wrapper.querySelector("[data-trigger]");
13
- this.closeButtons = this.wrapper.querySelectorAll("[data-close]");
14
-
15
- if (!this.modal || !this.trigger) {
16
- console.error("Modal not initialized properly", {
17
- modal: this.modal,
18
- });
19
- return;
20
- }
21
-
22
- this.init();
23
- }
24
-
25
- private init() {
26
- this.setupAccessibility();
27
- this.setupEventListeners();
28
- }
29
-
30
- private setupAccessibility() {
31
- const title = this.modal?.querySelector<HTMLElement>(
32
- "h1, h2, h3, h4, h5, h6",
33
- );
34
-
35
- if (title) {
36
- const id =
37
- title.id || `modal-id-${Math.random().toString(36).substring(2, 9)}`;
38
- title.id = id;
39
- this.modal?.setAttribute("aria-describedby", id);
40
- }
41
-
42
- this.setState("closed");
43
- }
44
-
45
- private setupEventListeners() {
46
- this.trigger!.addEventListener("click", () => this.open());
47
-
48
- if (this.modal?.dataset.allowOutsideClick === "true") {
49
- this.backdrop?.addEventListener("click", () => this.closeModal());
50
- document.addEventListener("click", (e) => {
51
- const target = e.target as HTMLElement;
52
- if (
53
- this.modal &&
54
- !this.modal.contains(target) &&
55
- target !== this.trigger
56
- ) {
57
- this.closeModal();
58
- }
59
- });
60
- }
61
-
62
- this.closeButtons?.forEach((trigger) => {
63
- trigger.addEventListener("click", () => this.closeModal());
64
- });
65
-
66
- document.addEventListener("keydown", (e) => this.handleKeyDown(e));
67
- }
68
-
69
- private open() {
70
- this.backdrop?.classList.remove("hidden");
71
- this.modal?.classList.remove("hidden");
72
- document.body.classList.add("overflow-hidden");
73
- setTimeout(() => {
74
- this.setState("open");
75
- }, 0);
76
- }
77
-
78
- private closeModal() {
79
- this.setState("closed");
80
- setTimeout(() => {
81
- this.backdrop?.classList.add("hidden");
82
- this.modal?.classList.add("hidden");
83
- document.body.classList.remove("overflow-hidden");
84
- }, 200);
85
- }
86
-
87
- private setState(state: "open" | "closed") {
88
- this.trigger?.focus();
89
- this.modal?.setAttribute("aria-hidden", `${state === "closed"}`);
90
- this.modal?.setAttribute("data-state", state);
91
- this.backdrop?.setAttribute("aria-hidden", `${state === "closed"}`);
92
- this.backdrop?.setAttribute("data-state", state);
93
- }
94
-
95
- private handleKeyDown = (event: KeyboardEvent) => {
96
- if (event.key === "Escape" && this.modal!.dataset.status === "open") {
97
- this.closeModal();
98
- event.preventDefault();
99
- }
100
- };
101
- }
1
+ export class Modal {
2
+ private wrapper: HTMLElement;
3
+ private modal: HTMLElement | null;
4
+ private trigger: HTMLElement | null;
5
+ private backdrop: HTMLElement | null;
6
+ private closeButtons: NodeListOf<HTMLElement> | null;
7
+
8
+ constructor(wrapper: HTMLElement) {
9
+ this.wrapper = wrapper;
10
+ this.modal = this.wrapper.querySelector("[data-modal]");
11
+ this.backdrop = this.wrapper.querySelector("[data-backdrop]");
12
+ this.trigger = this.wrapper.querySelector("[data-trigger]");
13
+ this.closeButtons = this.wrapper.querySelectorAll("[data-close]");
14
+
15
+ if (!this.modal || !this.trigger) {
16
+ console.error("Modal not initialized properly", {
17
+ modal: this.modal,
18
+ });
19
+ return;
20
+ }
21
+
22
+ this.init();
23
+ }
24
+
25
+ private init() {
26
+ this.setupAccessibility();
27
+ this.setupEventListeners();
28
+ }
29
+
30
+ private setupAccessibility() {
31
+ const title = this.modal?.querySelector<HTMLElement>(
32
+ "h1, h2, h3, h4, h5, h6",
33
+ );
34
+
35
+ if (title) {
36
+ const id =
37
+ title.id || `modal-id-${Math.random().toString(36).substring(2, 9)}`;
38
+ title.id = id;
39
+ this.modal?.setAttribute("aria-describedby", id);
40
+ }
41
+
42
+ this.setState("closed");
43
+ }
44
+
45
+ private setupEventListeners() {
46
+ this.trigger!.addEventListener("click", () => this.open());
47
+
48
+ if (this.modal?.dataset.allowOutsideClick === "true") {
49
+ this.backdrop?.addEventListener("click", () => this.closeModal());
50
+ document.addEventListener("click", (e) => {
51
+ const target = e.target as HTMLElement;
52
+ if (
53
+ this.modal &&
54
+ !this.modal.contains(target) &&
55
+ target !== this.trigger
56
+ ) {
57
+ this.closeModal();
58
+ }
59
+ });
60
+ }
61
+
62
+ this.closeButtons?.forEach((trigger) => {
63
+ trigger.addEventListener("click", () => this.closeModal());
64
+ });
65
+
66
+ document.addEventListener("keydown", (e) => this.handleKeyDown(e));
67
+ }
68
+
69
+ private open() {
70
+ this.backdrop?.classList.remove("hidden");
71
+ this.modal?.classList.remove("hidden");
72
+ document.body.classList.add("overflow-hidden");
73
+ setTimeout(() => {
74
+ this.setState("open");
75
+ }, 0);
76
+ }
77
+
78
+ private closeModal() {
79
+ this.setState("closed");
80
+ setTimeout(() => {
81
+ this.backdrop?.classList.add("hidden");
82
+ this.modal?.classList.add("hidden");
83
+ document.body.classList.remove("overflow-hidden");
84
+ }, 200);
85
+ }
86
+
87
+ private setState(state: "open" | "closed") {
88
+ this.trigger?.focus();
89
+ this.modal?.setAttribute("aria-hidden", `${state === "closed"}`);
90
+ this.modal?.setAttribute("data-state", state);
91
+ this.backdrop?.setAttribute("aria-hidden", `${state === "closed"}`);
92
+ this.backdrop?.setAttribute("data-state", state);
93
+ }
94
+
95
+ private handleKeyDown = (event: KeyboardEvent) => {
96
+ if (event.key === "Escape" && this.modal!.dataset.status === "open") {
97
+ this.closeModal();
98
+ event.preventDefault();
99
+ }
100
+ };
101
+ }
@@ -1,15 +1,15 @@
1
- import Pagination from "./Pagination.astro";
2
- import PaginationContent from "./PaginationContent.astro";
3
- import PaginationEllipsis from "./PaginationEllipsis.astro";
4
- import PaginationItem from "./PaginationItem.astro";
5
- import PaginationLink from "./PaginationLink.astro";
6
- import { paginationLinkVariants } from "./paginationVariants";
7
-
8
- export {
9
- Pagination,
10
- PaginationContent,
11
- PaginationEllipsis,
12
- PaginationItem,
13
- PaginationLink,
14
- paginationLinkVariants,
15
- };
1
+ import Pagination from "./Pagination.astro";
2
+ import PaginationContent from "./PaginationContent.astro";
3
+ import PaginationEllipsis from "./PaginationEllipsis.astro";
4
+ import PaginationItem from "./PaginationItem.astro";
5
+ import PaginationLink from "./PaginationLink.astro";
6
+ import { paginationLinkVariants } from "./paginationVariants";
7
+
8
+ export {
9
+ Pagination,
10
+ PaginationContent,
11
+ PaginationEllipsis,
12
+ PaginationItem,
13
+ PaginationLink,
14
+ paginationLinkVariants,
15
+ };
@@ -1,17 +1,17 @@
1
- <div class="relative" data-popover>
2
- <slot />
3
- </div>
4
-
5
- <script>
6
- import { Popover } from "./popover";
7
-
8
- function init() {
9
- const popovers = document.querySelectorAll<HTMLElement>("[data-popover]");
10
- popovers.forEach((dropdown) => {
11
- new Popover(dropdown);
12
- });
13
- }
14
-
15
- init();
16
- document.addEventListener("astro:page-load", () => init());
17
- </script>
1
+ <div class="relative" data-popover>
2
+ <slot />
3
+ </div>
4
+
5
+ <script>
6
+ import { Popover } from "./popover";
7
+
8
+ function init() {
9
+ const popovers = document.querySelectorAll<HTMLElement>("[data-popover]");
10
+ popovers.forEach((dropdown) => {
11
+ new Popover(dropdown);
12
+ });
13
+ }
14
+
15
+ init();
16
+ document.addEventListener("astro:page-load", () => init());
17
+ </script>
@@ -1,39 +1,39 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import type { HTMLAttributes } from "astro/types";
4
- import type { VariantProps } from "class-variance-authority";
5
- import { popoverArrowVariants, popoverVariants } from "./popoverVariants";
6
-
7
- interface Props
8
- extends HTMLAttributes<"div">,
9
- VariantProps<typeof popoverVariants> {
10
- sideOffset?: number;
11
- arrow?: boolean;
12
- }
13
-
14
- const {
15
- class: className,
16
- side,
17
- alignment,
18
- sideOffset = 2,
19
- arrow = false,
20
- ...attrs
21
- } = Astro.props;
22
- ---
23
-
24
- <div
25
- {...attrs}
26
- role="dialog"
27
- data-popover-content
28
- aria-hidden="true"
29
- data-state="closed"
30
- data-side={sideOffset}
31
- data-alignment={alignment}
32
- class={cn(popoverVariants({ side, alignment, className }))}
33
- style={{
34
- "--tooltip-offset": `calc(var(--spacing) * ${sideOffset})`,
35
- }}
36
- >
37
- <slot />
38
- {arrow && <span class={cn(popoverArrowVariants({ side, alignment }))} />}
39
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { popoverArrowVariants, popoverVariants } from "./popoverVariants";
6
+
7
+ interface Props
8
+ extends HTMLAttributes<"div">,
9
+ VariantProps<typeof popoverVariants> {
10
+ sideOffset?: number;
11
+ arrow?: boolean;
12
+ }
13
+
14
+ const {
15
+ class: className,
16
+ side,
17
+ alignment,
18
+ sideOffset = 2,
19
+ arrow = false,
20
+ ...attrs
21
+ } = Astro.props;
22
+ ---
23
+
24
+ <div
25
+ {...attrs}
26
+ role="dialog"
27
+ data-popover-content
28
+ aria-hidden="true"
29
+ data-state="closed"
30
+ data-side={sideOffset}
31
+ data-alignment={alignment}
32
+ class={cn(popoverVariants({ side, alignment, className }))}
33
+ style={{
34
+ "--tooltip-offset": `calc(var(--spacing) * ${sideOffset})`,
35
+ }}
36
+ >
37
+ <slot />
38
+ {arrow && <span class={cn(popoverArrowVariants({ side, alignment }))} />}
39
+ </div>
@@ -1,5 +1,5 @@
1
- import Popover from "./Popover.astro";
2
- import PopoverContent from "./PopoverContent.astro";
3
- import { popoverArrowVariants, popoverVariants } from "./popoverVariants";
4
-
5
- export { Popover, popoverArrowVariants, PopoverContent, popoverVariants };
1
+ import Popover from "./Popover.astro";
2
+ import PopoverContent from "./PopoverContent.astro";
3
+ import { popoverArrowVariants, popoverVariants } from "./popoverVariants";
4
+
5
+ export { Popover, popoverArrowVariants, PopoverContent, popoverVariants };
@@ -1,113 +1,113 @@
1
- export class Popover {
2
- // References to tooltip elements
3
- private dropdownMenu: HTMLElement;
4
- private trigger: HTMLElement | null;
5
- private content: HTMLElement | null;
6
-
7
- constructor(dropowndMenu: HTMLElement) {
8
- this.dropdownMenu = dropowndMenu;
9
- this.content = this.dropdownMenu.querySelector("[data-popover-content]");
10
- this.trigger = this.dropdownMenu.querySelector("[data-trigger]");
11
-
12
- if (!this.content || !this.trigger) {
13
- console.error("Popover not initialized properly", {
14
- content: this.content,
15
- trigger: this.trigger,
16
- });
17
- return;
18
- }
19
-
20
- this.init();
21
- }
22
-
23
- private init() {
24
- this.setupAccessibility();
25
- this.setupEventListeners();
26
- }
27
-
28
- private setupAccessibility() {
29
- if (!this.trigger || !this.content) return;
30
-
31
- const id =
32
- this.content.id ||
33
- `popover-id-${Math.random().toString(36).substring(2, 9)}`;
34
- this.content.id = id;
35
- this.trigger.setAttribute("aria-describedby", id);
36
- this.setState("closed");
37
- }
38
-
39
- private setupEventListeners() {
40
- if (!this.trigger || !this.content) return;
41
-
42
- this.trigger.addEventListener("click", () => this.popoverToggle());
43
-
44
- this.content.addEventListener("click", (e) => {
45
- const target = e.target as HTMLElement;
46
- const item = target.closest('[role="menuitem"]') as HTMLElement;
47
-
48
- if (item && item.dataset.disabled !== "true") {
49
- this.closePopover();
50
- }
51
- });
52
-
53
- document.addEventListener("click", (e) => {
54
- const target = e.target as HTMLElement;
55
- if (
56
- this.content &&
57
- !this.content.contains(target) &&
58
- target !== this.trigger
59
- ) {
60
- this.closePopover();
61
- }
62
- });
63
-
64
- this.trigger.addEventListener("keydown", (e) => {
65
- const isOpen = this.content?.dataset.state === "open";
66
- if (e.key === "Enter" || e.key === " ") {
67
- e.preventDefault();
68
- this.popoverToggle();
69
- } else if (e.key === "Escape" && isOpen) {
70
- e.preventDefault();
71
- this.closePopover();
72
- }
73
- });
74
-
75
- document.addEventListener("keydown", (e) => this.handleKeydown(e));
76
- }
77
-
78
- private popoverToggle() {
79
- if (this.content?.dataset.state === "open") {
80
- this.closePopover();
81
- } else {
82
- this.openPopover();
83
- }
84
- }
85
-
86
- private openPopover() {
87
- this.content?.classList.remove("hidden");
88
-
89
- window.setTimeout(() => {
90
- this.setState("open");
91
- }, 0);
92
- }
93
-
94
- private closePopover() {
95
- this.trigger?.focus();
96
- this.setState("closed");
97
- window.setTimeout(() => {
98
- this.content?.classList.add("hidden");
99
- }, 100);
100
- }
101
-
102
- private setState(state: "open" | "closed") {
103
- this.content?.setAttribute("aria-hidden", `${state === "closed"}`);
104
- this.content?.setAttribute("data-state", state);
105
- }
106
-
107
- private handleKeydown = (event: KeyboardEvent) => {
108
- if (event.key === "Escape" && this.content!.dataset.state === "open") {
109
- this.closePopover();
110
- event.preventDefault();
111
- }
112
- };
113
- }
1
+ export class Popover {
2
+ // References to tooltip elements
3
+ private dropdownMenu: HTMLElement;
4
+ private trigger: HTMLElement | null;
5
+ private content: HTMLElement | null;
6
+
7
+ constructor(dropowndMenu: HTMLElement) {
8
+ this.dropdownMenu = dropowndMenu;
9
+ this.content = this.dropdownMenu.querySelector("[data-popover-content]");
10
+ this.trigger = this.dropdownMenu.querySelector("[data-trigger]");
11
+
12
+ if (!this.content || !this.trigger) {
13
+ console.error("Popover not initialized properly", {
14
+ content: this.content,
15
+ trigger: this.trigger,
16
+ });
17
+ return;
18
+ }
19
+
20
+ this.init();
21
+ }
22
+
23
+ private init() {
24
+ this.setupAccessibility();
25
+ this.setupEventListeners();
26
+ }
27
+
28
+ private setupAccessibility() {
29
+ if (!this.trigger || !this.content) return;
30
+
31
+ const id =
32
+ this.content.id ||
33
+ `popover-id-${Math.random().toString(36).substring(2, 9)}`;
34
+ this.content.id = id;
35
+ this.trigger.setAttribute("aria-describedby", id);
36
+ this.setState("closed");
37
+ }
38
+
39
+ private setupEventListeners() {
40
+ if (!this.trigger || !this.content) return;
41
+
42
+ this.trigger.addEventListener("click", () => this.popoverToggle());
43
+
44
+ this.content.addEventListener("click", (e) => {
45
+ const target = e.target as HTMLElement;
46
+ const item = target.closest('[role="menuitem"]') as HTMLElement;
47
+
48
+ if (item && item.dataset.disabled !== "true") {
49
+ this.closePopover();
50
+ }
51
+ });
52
+
53
+ document.addEventListener("click", (e) => {
54
+ const target = e.target as HTMLElement;
55
+ if (
56
+ this.content &&
57
+ !this.content.contains(target) &&
58
+ target !== this.trigger
59
+ ) {
60
+ this.closePopover();
61
+ }
62
+ });
63
+
64
+ this.trigger.addEventListener("keydown", (e) => {
65
+ const isOpen = this.content?.dataset.state === "open";
66
+ if (e.key === "Enter" || e.key === " ") {
67
+ e.preventDefault();
68
+ this.popoverToggle();
69
+ } else if (e.key === "Escape" && isOpen) {
70
+ e.preventDefault();
71
+ this.closePopover();
72
+ }
73
+ });
74
+
75
+ document.addEventListener("keydown", (e) => this.handleKeydown(e));
76
+ }
77
+
78
+ private popoverToggle() {
79
+ if (this.content?.dataset.state === "open") {
80
+ this.closePopover();
81
+ } else {
82
+ this.openPopover();
83
+ }
84
+ }
85
+
86
+ private openPopover() {
87
+ this.content?.classList.remove("hidden");
88
+
89
+ window.setTimeout(() => {
90
+ this.setState("open");
91
+ }, 0);
92
+ }
93
+
94
+ private closePopover() {
95
+ this.trigger?.focus();
96
+ this.setState("closed");
97
+ window.setTimeout(() => {
98
+ this.content?.classList.add("hidden");
99
+ }, 100);
100
+ }
101
+
102
+ private setState(state: "open" | "closed") {
103
+ this.content?.setAttribute("aria-hidden", `${state === "closed"}`);
104
+ this.content?.setAttribute("data-state", state);
105
+ }
106
+
107
+ private handleKeydown = (event: KeyboardEvent) => {
108
+ if (event.key === "Escape" && this.content!.dataset.state === "open") {
109
+ this.closePopover();
110
+ event.preventDefault();
111
+ }
112
+ };
113
+ }