@pnx-mixtape/mxds 0.1.0-rc.4 → 0.1.0-rc.5

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 (199) hide show
  1. package/.claude/skills/create-mxds-component/SKILL.md +77 -0
  2. package/DESIGN.md +595 -0
  3. package/README.md +1 -2
  4. package/dist/build/accordion.entry.js +2 -1
  5. package/dist/build/autocomplete.entry.js +1 -1
  6. package/dist/build/back-to-top.css +1 -0
  7. package/dist/build/back-to-top.entry.js +1 -0
  8. package/dist/build/button.css +1 -1
  9. package/dist/build/card.css +1 -1
  10. package/dist/build/chunks/Accordion-D2wp8hBG.js +44 -0
  11. package/dist/build/chunks/AccordionGroup-BYtoAFxg.js +47 -0
  12. package/dist/build/chunks/AccordionMobile-D3sTeiM5.js +26 -0
  13. package/dist/build/chunks/Autocomplete-kRo8RNbC.js +135 -0
  14. package/dist/build/chunks/BackToTop-4M-Wl7z3.js +64 -0
  15. package/dist/build/chunks/ClosableAlert-yy84gae6.js +55 -0
  16. package/dist/build/chunks/CookieConsent-wd8gQ2Oe.js +18 -0
  17. package/dist/build/chunks/Dialog-DWoXW-7Z.js +48 -0
  18. package/dist/build/chunks/DropMenu-CSTZq0Zt.js +68 -0
  19. package/dist/build/chunks/FeedbackForm-BochXEDx.js +64 -0
  20. package/dist/build/chunks/Gallery-Rkfv7Mbb.js +165 -0
  21. package/dist/build/chunks/GlobalToggle-CzlkpLpc.js +82 -0
  22. package/dist/build/chunks/InPageNavigation-D1Kk-rCm.js +86 -0
  23. package/dist/build/chunks/Navigation-CDQnN61h.js +147 -0
  24. package/dist/build/chunks/Popover-CiTAftNU.js +30 -0
  25. package/dist/build/chunks/Sticky-DoVndENm.js +51 -0
  26. package/dist/build/chunks/Tabs-BDlxCDNh.js +160 -0
  27. package/dist/build/chunks/Translate-bmM38j6z.js +46 -0
  28. package/dist/build/chunks/cookie-compliance-CG6x-TcV.js +119 -0
  29. package/dist/build/chunks/enums-BrHxPZZ_.js +36 -0
  30. package/dist/build/chunks/polyfills-D-qh1a_2.js +33 -0
  31. package/dist/build/chunks/utilities-Dd-08SW6.js +255 -0
  32. package/dist/build/content-block.css +1 -1
  33. package/dist/build/cookie-consent.entry.js +1 -1
  34. package/dist/build/dialog.entry.js +1 -1
  35. package/dist/build/drop-menu.entry.js +1 -1
  36. package/dist/build/elements.js +147 -1
  37. package/dist/build/feedback-form.css +1 -0
  38. package/dist/build/feedback-form.entry.js +1 -0
  39. package/dist/build/filters.entry.js +145 -1
  40. package/dist/build/gallery.entry.js +1 -1
  41. package/dist/build/global-alert.entry.js +1 -1
  42. package/dist/build/header.css +1 -1
  43. package/dist/build/header.entry.js +1 -1
  44. package/dist/build/icon.css +1 -1
  45. package/dist/build/in-page-navigation.entry.js +1 -1
  46. package/dist/build/navigation.entry.js +1 -1
  47. package/dist/build/pagination.css +1 -1
  48. package/dist/build/popover.entry.js +1 -1
  49. package/dist/build/react.js +2270 -1
  50. package/dist/build/sticky.entry.js +1 -1
  51. package/dist/build/tabs.entry.js +1 -1
  52. package/dist/build/translate.css +1 -0
  53. package/dist/build/translate.entry.js +1 -0
  54. package/dist/build/utility-list.entry.js +53 -1
  55. package/dist/types/Component/BackToTop/BackToTop.d.ts +20 -0
  56. package/dist/types/Component/BackToTop/BackToTop.d.ts.map +1 -0
  57. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts +27 -0
  58. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts.map +1 -0
  59. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts +2 -0
  60. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts.map +1 -0
  61. package/dist/types/Component/DropMenu/DropMenu.d.ts +2 -1
  62. package/dist/types/Component/DropMenu/DropMenu.d.ts.map +1 -1
  63. package/dist/types/Component/Tabs/Components/TabDropMenu.d.ts.map +1 -1
  64. package/dist/types/Component/Tabs/Elements/Tabs.d.ts.map +1 -1
  65. package/dist/types/Component/Translate/Elements/Translate.d.ts +23 -0
  66. package/dist/types/Component/Translate/Elements/Translate.d.ts.map +1 -0
  67. package/dist/types/Component/Translate/Translate.d.ts +37 -0
  68. package/dist/types/Component/Translate/Translate.d.ts.map +1 -0
  69. package/dist/types/Component/Translate/languages.d.ts +11 -0
  70. package/dist/types/Component/Translate/languages.d.ts.map +1 -0
  71. package/dist/types/Component/Translate/translate.entry.d.ts +2 -0
  72. package/dist/types/Component/Translate/translate.entry.d.ts.map +1 -0
  73. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts +37 -0
  74. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts.map +1 -0
  75. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts +36 -0
  76. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts.map +1 -0
  77. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts +2 -0
  78. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts.map +1 -0
  79. package/dist/types/Utility/Elements/google-translate-widget.d.ts +91 -0
  80. package/dist/types/Utility/Elements/google-translate-widget.d.ts.map +1 -0
  81. package/dist/types/Utility/utilities.d.ts +2 -0
  82. package/dist/types/Utility/utilities.d.ts.map +1 -1
  83. package/dist/types/elements.d.ts +3 -0
  84. package/dist/types/elements.d.ts.map +1 -1
  85. package/dist/types/enums.d.ts +3 -1
  86. package/dist/types/enums.d.ts.map +1 -1
  87. package/dist/types/react.d.ts +3 -0
  88. package/dist/types/react.d.ts.map +1 -1
  89. package/docs/API.md +1215 -0
  90. package/docs/CSSGuidelines.md +891 -0
  91. package/docs/CodeQuality.md +940 -0
  92. package/docs/ComponentArchitecture.md +714 -0
  93. package/docs/Contributing.md +626 -0
  94. package/docs/MemoryManagement.md +598 -0
  95. package/docs/Migrations.md +6 -0
  96. package/docs/README.md +100 -0
  97. package/docs/Security.md +444 -0
  98. package/docs/Testing.md +739 -0
  99. package/docs/Troubleshooting.md +674 -0
  100. package/package.json +6 -3
  101. package/src/Atom/Button/Button.tsx +1 -1
  102. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
  103. package/src/Atom/Button/_buttons.css +1 -0
  104. package/src/Atom/Icon/README.md +1 -1
  105. package/src/Atom/Icon/_icon.css +1 -0
  106. package/src/Atom/Icon/images/thumb.svg +1 -0
  107. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +4 -9
  108. package/src/Atom/Media/media.twig +4 -5
  109. package/src/Component/BackToTop/BackToTop.stories.ts +127 -0
  110. package/src/Component/BackToTop/BackToTop.stories.tsx +53 -0
  111. package/src/Component/BackToTop/BackToTop.tsx +120 -0
  112. package/src/Component/BackToTop/Elements/BackToTop.ts +119 -0
  113. package/src/Component/BackToTop/README.md +164 -0
  114. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.ts.snap +24 -0
  115. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.tsx.snap +3 -0
  116. package/src/Component/BackToTop/back-to-top.css +70 -0
  117. package/src/Component/BackToTop/back-to-top.entry.js +1 -0
  118. package/src/Component/BackToTop/back-to-top.twig +26 -0
  119. package/src/Component/Card/Components/CardContent.tsx +1 -1
  120. package/src/Component/Card/Components/CardMedia.tsx +1 -1
  121. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
  122. package/src/Component/Card/card.css +1 -1
  123. package/src/Component/Carousel/Carousel.stories.ts +66 -36
  124. package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -5
  125. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -1
  126. package/src/Component/ContentBlock/content-block.css +1 -1
  127. package/src/Component/DropMenu/DropMenu.stories.ts +21 -2
  128. package/src/Component/DropMenu/DropMenu.tsx +14 -4
  129. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +3 -3
  130. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +2 -2
  131. package/src/Component/DropMenu/drop-menu.twig +7 -1
  132. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
  133. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +48 -13
  134. package/src/Component/InPageNavigation/in-page-navigation.twig +4 -6
  135. package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -1
  136. package/src/Component/Pagination/Pagination.stories.ts +57 -27
  137. package/src/Component/Pagination/pagination.css +16 -7
  138. package/src/Component/Popover/__snapshots__/Popover.stories.tsx.snap +3 -3
  139. package/src/Component/Tabs/Components/TabDropMenu.tsx +7 -1
  140. package/src/Component/Tabs/Elements/Tabs.ts +13 -3
  141. package/src/Component/Tabs/Tabs.stories.ts +33 -12
  142. package/src/Component/Tabs/Tabs.stories.tsx +28 -14
  143. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +3 -3
  144. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -2
  145. package/src/Component/Translate/Elements/Translate.ts +76 -0
  146. package/src/Component/Translate/README.md +283 -0
  147. package/src/Component/Translate/Translate.stories.ts +87 -0
  148. package/src/Component/Translate/Translate.stories.tsx +77 -0
  149. package/src/Component/Translate/Translate.tsx +213 -0
  150. package/src/Component/Translate/__snapshots__/Translate.stories.ts.snap +18 -0
  151. package/src/Component/Translate/__snapshots__/Translate.stories.tsx.snap +3 -0
  152. package/src/Component/Translate/languages.ts +39 -0
  153. package/src/Component/Translate/translate.css +62 -0
  154. package/src/Component/Translate/translate.entry.js +1 -0
  155. package/src/Component/Translate/translate.twig +44 -0
  156. package/src/Form/Autocomplete/Autocomplete.stories.tsx +2 -1
  157. package/src/Form/FeedbackForm/Elements/FeedbackForm.ts +122 -0
  158. package/src/Form/FeedbackForm/FeedbackForm.stories.ts +99 -0
  159. package/src/Form/FeedbackForm/FeedbackForm.stories.tsx +73 -0
  160. package/src/Form/FeedbackForm/FeedbackForm.tsx +196 -0
  161. package/src/Form/FeedbackForm/README.md +233 -0
  162. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.ts.snap +125 -0
  163. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.tsx.snap +5 -0
  164. package/src/Form/FeedbackForm/feedback-form.css +74 -0
  165. package/src/Form/FeedbackForm/feedback-form.entry.js +1 -0
  166. package/src/Form/FeedbackForm/feedback-form.twig +80 -0
  167. package/src/Layout/Header/Components/GlobalToggle.tsx +1 -1
  168. package/src/Layout/Header/Header.stories.ts +53 -48
  169. package/src/Layout/Header/Header.stories.tsx +35 -22
  170. package/src/Layout/Header/Header.tsx +2 -2
  171. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +14 -10
  172. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
  173. package/src/Layout/Header/_toggles.css +7 -7
  174. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
  175. package/src/Utility/Elements/google-translate-widget.ts +293 -0
  176. package/src/Utility/global.d.ts +4 -0
  177. package/src/Utility/utilities.ts +2 -0
  178. package/src/elements.ts +3 -0
  179. package/src/enums.ts +2 -0
  180. package/src/react.ts +3 -0
  181. package/dist/build/chunks/Accordion-GN0sME4W.js +0 -1
  182. package/dist/build/chunks/AccordionGroup-Bzqp5__q.js +0 -1
  183. package/dist/build/chunks/AccordionMobile-DG5jSe8Q.js +0 -1
  184. package/dist/build/chunks/Autocomplete-B4RtkAyh.js +0 -1
  185. package/dist/build/chunks/ClosableAlert-DEhj8Nxm.js +0 -1
  186. package/dist/build/chunks/CookieConsent-BkCMRVST.js +0 -1
  187. package/dist/build/chunks/Dialog-Haahn-Yn.js +0 -1
  188. package/dist/build/chunks/DropMenu-1baQc8Yc.js +0 -1
  189. package/dist/build/chunks/Gallery-D8NGXy2Q.js +0 -1
  190. package/dist/build/chunks/GlobalToggle-B52fdBQu.js +0 -1
  191. package/dist/build/chunks/InPageNavigation-Dyn2TR-N.js +0 -1
  192. package/dist/build/chunks/Navigation-hOrfLq7h.js +0 -1
  193. package/dist/build/chunks/Popover-Cxg-s5Jn.js +0 -1
  194. package/dist/build/chunks/Sticky-BGCuuEJK.js +0 -1
  195. package/dist/build/chunks/Tabs-DYy1YTdU.js +0 -15
  196. package/dist/build/chunks/cookie-compliance-Bbm-0vpj.js +0 -1
  197. package/dist/build/chunks/enums-DLV_1NAf.js +0 -1
  198. package/dist/build/chunks/polyfills-C7pRt54M.js +0 -1
  199. package/dist/build/chunks/utilities-_Bq3TxAQ.js +0 -1
@@ -0,0 +1,165 @@
1
+ import { n as e } from "./cookie-compliance-CG6x-TcV.js";
2
+ import { t } from "./utilities-Dd-08SW6.js";
3
+ import { t as n } from "./Dialog-DWoXW-7Z.js";
4
+ //#region src/Component/Carousel/Elements/Carousel.ts
5
+ var r = class extends HTMLElement {
6
+ internals_;
7
+ controller;
8
+ debounced;
9
+ loop;
10
+ paginationType;
11
+ activePage;
12
+ itemMap;
13
+ iO;
14
+ rO;
15
+ mO;
16
+ ioTimeout;
17
+ constructor() {
18
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController();
19
+ }
20
+ connectedCallback() {
21
+ if (!this.track) return;
22
+ this.buttons && (this.buttons.hidden = !1), this.activePage = 0, this.track.scrollLeft = 0, this.debounced = null, this.loop = this.hasAttribute("loop");
23
+ let { signal: e } = this.controller;
24
+ this.prev && (this.prev.disabled = !0, this.prev.addEventListener("click", () => this.handleNavigation(this.activePage - 1), { signal: e })), this.next && this.next.addEventListener("click", () => this.handleNavigation(this.activePage + 1), { signal: e }), this.track.addEventListener("scroll", this.handleScroll, { signal: e }), this.pagination && (this.paginationType = this.pagination.getAttribute("data-pagination"), this.pagination.addEventListener("click", this.handlePagination, { signal: e })), Array.from(this.track.children).forEach((e, t) => {
25
+ e.setAttribute("data-index", String(t));
26
+ });
27
+ let t = this.track.querySelectorAll("[data-index]");
28
+ this.itemMap = /* @__PURE__ */ new Map(), this.iO = new IntersectionObserver((e) => {
29
+ e.forEach(({ target: e, intersectionRatio: t }) => {
30
+ let n = e;
31
+ t > .5 ? (n.removeAttribute("inert"), n.setAttribute("aria-hidden", "false"), this.itemMap.set(n, !0)) : (n.setAttribute("inert", ""), n.setAttribute("aria-hidden", "true"), this.itemMap.set(n, !1));
32
+ });
33
+ }, {
34
+ root: this.track,
35
+ threshold: .5
36
+ }), t.forEach((e) => this.iO.observe(e)), this.rO = new ResizeObserver((e) => {
37
+ e.forEach(() => this.handleOverflow());
38
+ }), this.rO.observe(this.track), this.mO = new MutationObserver((e) => {
39
+ e.forEach(() => this.handleOverflow());
40
+ }), this.mO.observe(this.track, { childList: !0 });
41
+ }
42
+ disconnectedCallback() {
43
+ this.controller.abort(), this.mO.disconnect(), this.iO.disconnect(), this.rO.disconnect(), clearTimeout(this.debounced), clearTimeout(this.ioTimeout);
44
+ }
45
+ handleNavigation = (e, t = "arrow") => {
46
+ let n = e > this.activePage, r = this.loop && this.next.hasAttribute("data-restart");
47
+ if (e === 0 || r && n && t === "arrow") {
48
+ this.activePage = 0, this.items[0].scrollIntoView({
49
+ inline: "start",
50
+ block: "nearest"
51
+ }), this.next.removeAttribute("data-restart");
52
+ return;
53
+ }
54
+ this.activePage = e, this.items[this.visibleCount * e].scrollIntoView({
55
+ inline: "start",
56
+ block: "nearest"
57
+ }), r && !n && this.next.removeAttribute("data-restart");
58
+ let i = new CustomEvent("carousel-slide", {
59
+ bubbles: !0,
60
+ cancelable: !0,
61
+ detail: {
62
+ page: this.activePage,
63
+ type: t
64
+ }
65
+ });
66
+ this.dispatchEvent(i);
67
+ };
68
+ handleDisabled = () => {
69
+ let e = !1;
70
+ if (this.prev && (this.prev.disabled = this.track.scrollLeft < 200), (this.next || this.pagination) && (e = Math.round(this.track.scrollLeft) >= Math.round(this.track.scrollWidth - this.track.offsetWidth)), this.next && (this.loop ? e && this.next.setAttribute("data-restart", "") : this.next.disabled = e), this.pagination) {
71
+ let t = Math.round(this.track.offsetLeft + this.track.scrollLeft);
72
+ if (e) this.activePage = this.pageStartItems.length - 1;
73
+ else {
74
+ let e = 0, n = Infinity;
75
+ this.pageStartItems.forEach((r, i) => {
76
+ let a = Math.abs(Math.round(r.offsetLeft) - t);
77
+ a < n && (n = a, e = i);
78
+ }), this.activePage = e;
79
+ }
80
+ this.pagination.querySelectorAll("button").forEach((e) => {
81
+ let t = e.getAttribute("data-index");
82
+ if (!t) return;
83
+ let n = parseInt(t, 10) === this.activePage;
84
+ e.disabled = n, n ? e.setAttribute("aria-current", "page") : e.removeAttribute("aria-current");
85
+ });
86
+ }
87
+ };
88
+ handleScroll = () => {
89
+ clearTimeout(this.debounced), this.debounced = setTimeout(this.handleDisabled, this.pagination ? 100 : 200);
90
+ };
91
+ handleOverflow = () => {
92
+ let { scrollWidth: e, clientWidth: t } = this.track, n = e > t;
93
+ this.track.classList.toggle("overflowing", n), n ? (this.pagination && (this.ioTimeout = setTimeout(this.buildPagination, 200)), this.track.setAttribute("tabindex", "0")) : this.track.removeAttribute("tabindex");
94
+ };
95
+ buildPagination = () => {
96
+ if (!this.pagination.hidden) {
97
+ let e = this.pagination.querySelectorAll("button");
98
+ if (e.length === this.pageStartItems.length) return;
99
+ e.forEach((e) => e.remove());
100
+ }
101
+ let e = Array.from({ length: this.pageStartItems.length }).fill(null);
102
+ if (e.length <= 0) return;
103
+ e.forEach((n, r) => {
104
+ let i = r + 1, a = t(`<button type="button" data-index="${r}" aria-label="Page ${i}">${i}</button>`);
105
+ this.pagination.append(a), e[r] = a;
106
+ });
107
+ let n = e[0];
108
+ n.disabled = !0, n.setAttribute("aria-current", "page"), this.pagination.hidden = !1;
109
+ };
110
+ handlePagination = (t) => {
111
+ let n = t.target.getAttribute("data-index");
112
+ if (!n || !e.integer(n, 0)) return;
113
+ let r = parseInt(n, 10);
114
+ this.handleNavigation(r, "pagination");
115
+ };
116
+ get track() {
117
+ let e = this.querySelector("[data-track]");
118
+ if (!e) throw Error(`${this.localName} must contain an element with [data-track].`);
119
+ return e;
120
+ }
121
+ get buttons() {
122
+ return this.querySelector("[data-buttons]");
123
+ }
124
+ get prev() {
125
+ return this.buttons?.querySelector(".mx-carousel__prev");
126
+ }
127
+ get next() {
128
+ return this.buttons?.querySelector(".mx-carousel__next");
129
+ }
130
+ get pagination() {
131
+ return this.querySelector("[data-pagination]");
132
+ }
133
+ get items() {
134
+ return [...this.itemMap.keys()];
135
+ }
136
+ get visibleCount() {
137
+ return [...this.itemMap.values()].filter((e) => e).length;
138
+ }
139
+ get pageStartItems() {
140
+ return [...this.items].filter((e, t) => t % this.visibleCount === 0);
141
+ }
142
+ };
143
+ customElements.get("mx-carousel") || customElements.define("mx-carousel", r);
144
+ //#endregion
145
+ //#region src/Component/Gallery/Elements/Gallery.ts
146
+ var i = class extends n {
147
+ connectedCallback() {
148
+ if (super.connectedCallback(), !this.dialog) return;
149
+ let { signal: e } = this.controller;
150
+ this.openBtns?.forEach((t) => t.addEventListener("click", () => this.scrollToTrigger(t), { signal: e }));
151
+ }
152
+ scrollToTrigger = (e) => {
153
+ let t = e.dataset.galleryIndex ?? "0", n = this.carousel?.track?.querySelector(`[data-index="${t}"]`);
154
+ n && (n.removeAttribute("inert"), n.scrollIntoView({
155
+ inline: "start",
156
+ block: "nearest"
157
+ }));
158
+ };
159
+ get carousel() {
160
+ return this.querySelector("mx-carousel");
161
+ }
162
+ };
163
+ customElements.get("mx-gallery") || customElements.define("mx-gallery", i);
164
+ //#endregion
165
+ export { r as n, i as t };
@@ -0,0 +1,82 @@
1
+ import { u as e } from "./utilities-Dd-08SW6.js";
2
+ import { createFocusTrap as t } from "focus-trap";
3
+ //#region src/Layout/Header/Elements/GlobalToggle.ts
4
+ var n = class extends HTMLElement {
5
+ internals_;
6
+ controller;
7
+ widget;
8
+ focusTrap;
9
+ controls;
10
+ mq;
11
+ triggerText;
12
+ isOpen = !1;
13
+ closeIconClass = "mx-icon--close";
14
+ menuIconClass = "mx-icon--menu";
15
+ searchIconClass = "mx-icon--search";
16
+ backgroundClass = "mx-background--primary";
17
+ scrollLockClass = "body--scroll-lock";
18
+ isSearch;
19
+ hideOther = !0;
20
+ otherTrigger;
21
+ rafId;
22
+ focusTrapTimeout;
23
+ constructor() {
24
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController(), this.mq = this.getAttribute("mq") || "(max-width: 720px)";
25
+ }
26
+ connectedCallback() {
27
+ if (!this.trigger || !this.target) return;
28
+ this.trigger.getAttribute("hideOther") === "false" && (this.hideOther = !1), this.isSearch = this.controls.includes("search"), this.otherTrigger = document.querySelector(this.isSearch ? `.${this.menuIconClass}` : `.${this.searchIconClass}`), this.widget = new e(this.trigger, this.target), this.widget.init(), this.focusTrap = t(this.target, {
29
+ escapeDeactivates: !1,
30
+ setReturnFocus: this.trigger,
31
+ allowOutsideClick: !0,
32
+ onActivate: () => document.body.classList.add(this.scrollLockClass),
33
+ onDeactivate: () => document.body.classList.remove(this.scrollLockClass),
34
+ checkCanFocusTrap: ([e]) => new Promise((t) => {
35
+ this.focusTrapTimeout = setTimeout(() => {
36
+ this.rafId &&= (cancelAnimationFrame(this.rafId), null), t();
37
+ }, 2e3);
38
+ let n = () => {
39
+ getComputedStyle(e).visibility === "hidden" ? this.rafId = requestAnimationFrame(n) : (this.focusTrapTimeout &&= (clearTimeout(this.focusTrapTimeout), null), this.rafId = null, t());
40
+ };
41
+ this.rafId = requestAnimationFrame(n);
42
+ })
43
+ });
44
+ let { signal: n } = this.controller;
45
+ this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: n }), document.addEventListener("keydown", this.handleKeyDown, { signal: n });
46
+ }
47
+ disconnectedCallback() {
48
+ this.widget.detach(), this.controller.abort(), this.rafId &&= (cancelAnimationFrame(this.rafId), null), this.focusTrapTimeout &&= (clearTimeout(this.focusTrapTimeout), null), this.focusTrap.deactivate(), document.body.classList.remove(this.scrollLockClass);
49
+ }
50
+ handleBreakpoint = ({ matches: e }) => {
51
+ if (!this.trigger) return;
52
+ let { signal: t } = this.controller;
53
+ e ? (this.widget.attach(), this.target.setAttribute("inert", ""), this.trigger.addEventListener("disclosure-toggle", this.handleDisclosure, { signal: t })) : (this.widget.detach(), this.target.removeAttribute("inert"), document.body.classList.remove(this.scrollLockClass), this.trigger.removeEventListener("disclosure-toggle", this.handleDisclosure), this.focusTrap.deactivate());
54
+ };
55
+ handleDisclosure = async ({ detail: e }) => {
56
+ let { isOpen: t } = e, n = t ? "Open" : "Close", r = t ? "Close" : "Open";
57
+ if (this.trigger.textContent = this.triggerText.replace(n, r), t) try {
58
+ await this.focusTrap.activate();
59
+ } catch {}
60
+ else this.focusTrap.deactivate();
61
+ t && this.hideOther && this.otherTrigger && this.otherTrigger.getAttribute("aria-expanded") === "true" && this.otherTrigger.click(), this.trigger.classList.toggle(this.isSearch ? this.searchIconClass : this.menuIconClass), this.trigger.classList.toggle(this.closeIconClass), this.target.classList.toggle(this.backgroundClass), this.trigger.removeAttribute("no-focus"), this.isOpen = t;
62
+ };
63
+ handleKeyDown = (e) => {
64
+ this.isOpen && e.key === "Escape" && this.widget.handleToggle();
65
+ };
66
+ get trigger() {
67
+ let e = this.querySelector(":scope > button"), t = e.getAttribute("aria-controls");
68
+ if (!e || !t) throw Error(`${this.localName} must contain a <button aria-controls="element-to-trigger"> element.`);
69
+ return e.removeAttribute("disabled"), this.controls = t, this.triggerText = e.textContent, e;
70
+ }
71
+ get target() {
72
+ let e = document.querySelector(`div[id="${this.controls}"]`);
73
+ if (!e) throw Error(`${this.localName} must contain a target <div id="${this.controls}">.`);
74
+ return e.classList.remove("global-nav-up-only"), e;
75
+ }
76
+ get breakpoint() {
77
+ return window.matchMedia(this.mq);
78
+ }
79
+ };
80
+ customElements.get("mx-global-toggle") || customElements.define("mx-global-toggle", n);
81
+ //#endregion
82
+ export { n as t };
@@ -0,0 +1,86 @@
1
+ import { s as e, t } from "./utilities-Dd-08SW6.js";
2
+ //#region src/Component/InPageNavigation/Elements/InPageNavigation.ts
3
+ var n = class extends HTMLElement {
4
+ internals_;
5
+ controller;
6
+ headingLevels;
7
+ title;
8
+ titleClass = "is-excluded mx-heading--m";
9
+ items;
10
+ active;
11
+ constructor() {
12
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController(), this.headingLevels = this.dataset?.levels || "h2", this.title = this.dataset?.title || "On this page", this.items = [];
13
+ }
14
+ connectedCallback() {
15
+ if (!this.menu || !this.headings) return;
16
+ if (this.links.length) this.links.forEach((e) => {
17
+ let t = this.container.querySelector(e.hash);
18
+ t && this.items.push({
19
+ link: e,
20
+ heading: t
21
+ });
22
+ });
23
+ else {
24
+ let e = t(`<h2 class="${this.titleClass}">${this.title}</h2>`);
25
+ this.nav.insertBefore(e, this.menu);
26
+ let n = {};
27
+ this.headings.forEach((e) => {
28
+ let t = this.generateListItem(e), r = this.generateAnchor(e, n);
29
+ this.items.push({
30
+ link: r,
31
+ heading: e
32
+ }), t.appendChild(r), this.menu?.appendChild(t);
33
+ });
34
+ }
35
+ let { signal: e } = this.controller;
36
+ this.menu.addEventListener("click", (e) => {
37
+ let { target: t } = e;
38
+ t instanceof HTMLAnchorElement && this.handleClick(t);
39
+ }, { signal: e });
40
+ }
41
+ disconnectedCallback() {
42
+ this.menu && this.headings && (this.menu.textContent = "", this.items = [], this.controller.abort());
43
+ }
44
+ handleClick = (e) => {
45
+ this.active = this.items.find((t) => t.link === e), this.links && this.active && (this.links.forEach((e) => e.classList.remove("is-active")), this.active.link.classList.add("is-active"));
46
+ };
47
+ get menu() {
48
+ let e = this.querySelector("ul, ol");
49
+ if (e) return e;
50
+ if (!this.nav) throw Error(`${this.localName} must contain a <nav> element.`);
51
+ if (this.items?.length === 0 && this.headings?.length === 0) return null;
52
+ let t = document.createElement("ul");
53
+ return this.nav.appendChild(t), t;
54
+ }
55
+ get nav() {
56
+ return this.querySelector("nav");
57
+ }
58
+ get container() {
59
+ let e = this.getAttribute("data-content");
60
+ if (!e) throw Error(`${this.localName} must have a [data-content] attribute that contains the content selector.`);
61
+ return this.closest(e) || this.parentElement.querySelector(e) || document.querySelector(e);
62
+ }
63
+ get headings() {
64
+ return this.container?.querySelectorAll(`:is(${this.headingLevels}):not(.is-excluded)`);
65
+ }
66
+ get links() {
67
+ return this.menu?.querySelectorAll("a");
68
+ }
69
+ generatedId(t, n) {
70
+ let r = t?.textContent?.trim();
71
+ if (!r) return "";
72
+ let i = e(r), a = n[i] ?? 0;
73
+ return n[i] = a + 1, a > 0 ? `${i}-${a}` : i;
74
+ }
75
+ generateAnchor(e, n) {
76
+ let { textContent: r, id: i } = e, a = e.getAttribute("data-in-page-navigation-title") || r, o = i || this.generatedId(e, n);
77
+ return i || (e.id = o), t(`<a href="#${o}"><span class="mx-icon mx-icon--chevron-right"></span><span>${a}</span></a>`);
78
+ }
79
+ generateListItem(e) {
80
+ let { tagName: n } = e;
81
+ return t(`<li class="mx-in-page-navigation__level--${n.toLowerCase()}"></li>`);
82
+ }
83
+ };
84
+ customElements.get("mx-in-page-navigation") || customElements.define("mx-in-page-navigation", n);
85
+ //#endregion
86
+ export { n as t };
@@ -0,0 +1,147 @@
1
+ import { s as e, u as t } from "./utilities-Dd-08SW6.js";
2
+ //#region src/Utility/Elements/keyboard.ts
3
+ var n = class {
4
+ constructor() {
5
+ window.Mixtape = window.Mixtape || {}, window.Mixtape.Popups = window.Mixtape.Popups || [], window.Mixtape.Menu = window.Mixtape.Menu || {};
6
+ }
7
+ attachPopup = (e, t) => {
8
+ window.Mixtape.Popups.push({
9
+ id: e,
10
+ closefn: t
11
+ });
12
+ };
13
+ detachPopup = (e) => {
14
+ window.Mixtape.Popups = window.Mixtape.Popups.filter((t) => t.id !== e);
15
+ };
16
+ attachMenu = (e, t) => {
17
+ window.Mixtape.Menu = {
18
+ context: e,
19
+ items: t
20
+ };
21
+ };
22
+ detachMenu = () => {
23
+ window.Mixtape.Menu = null;
24
+ };
25
+ getNextFocusableMenuItem = (e, t = !1) => t ? e === 0 ? window.Mixtape.Menu.items.length - 1 : e - 1 : window.Mixtape.Menu.items.length > e + 1 ? e + 1 : 0;
26
+ moveFocus = (e, t = !1) => {
27
+ if (!window.Mixtape.Menu.items) return;
28
+ let n = 0;
29
+ window.Mixtape.Menu.items.forEach((t, r) => {
30
+ t === e && (n = r);
31
+ });
32
+ let r = this.getNextFocusableMenuItem(n, t), i = window.Mixtape.Menu.items[r].getAttribute("tabindex");
33
+ if (i !== "-1") window.Mixtape.Menu.items[r].focus();
34
+ else {
35
+ for (; i === "-1";) r = this.getNextFocusableMenuItem(r, t), i = window.Mixtape.Menu.items[r].getAttribute("tabindex");
36
+ window.Mixtape.Menu.items[r].focus();
37
+ }
38
+ window.Mixtape.Menu.active = r;
39
+ };
40
+ handleGlobalClick = ({ target: e }) => {
41
+ let t = window.Mixtape.Popups ? window.Mixtape.Popups[window.Mixtape.Popups.length - 1] : null;
42
+ if (t && t.id) {
43
+ let n = document.querySelector(`#${t.id}`).parentElement;
44
+ if (n && (e === n || n?.contains(e))) return;
45
+ t.closefn();
46
+ }
47
+ };
48
+ handleGlobalKeydown = (e) => {
49
+ let t = window.Mixtape.Popups ? window.Mixtape.Popups[window.Mixtape.Popups.length - 1] : null, n = e.target;
50
+ switch (e.key) {
51
+ case "Escape":
52
+ t && t.closefn();
53
+ break;
54
+ case "ArrowDown":
55
+ case "ArrowRight":
56
+ window.Mixtape.Menu?.items && (e.preventDefault(), this.moveFocus(n));
57
+ break;
58
+ case "ArrowUp":
59
+ case "ArrowLeft": window.Mixtape.Menu?.items && (e.preventDefault(), this.moveFocus(n, !0));
60
+ }
61
+ };
62
+ attachEventListeners = (e) => {
63
+ window.addEventListener("click", this.handleGlobalClick, { signal: e }), window.addEventListener("keydown", this.handleGlobalKeydown, { signal: e });
64
+ };
65
+ }, r = class extends HTMLElement {
66
+ internals_;
67
+ controller;
68
+ keyboard;
69
+ subNavs;
70
+ flyout;
71
+ edgeCheck;
72
+ mq;
73
+ iO;
74
+ constructor() {
75
+ super(), this.internals_ = this.attachInternals(), this.controller = new AbortController(), this.flyout = this.hasAttribute("flyout");
76
+ }
77
+ connectedCallback() {
78
+ let { signal: r } = this.controller;
79
+ this.keyboard = new n(), this.keyboard.attachEventListeners(r), this.addEventListener("focusin", () => {
80
+ this.keyboard.attachMenu(this, this.links);
81
+ }), this.addEventListener("focusout", () => {
82
+ this.keyboard.detachMenu();
83
+ }), this.lists.length && (this.subNavs = /* @__PURE__ */ new Map(), this.lists.forEach((n, r) => {
84
+ let i = n.closest("li"), a = i.querySelector(":scope > a"), o = e(`subnav-${r}-${a.textContent}`, 30), s = i.querySelector(":scope > button.mx-nav__toggle");
85
+ if (i && a && s) {
86
+ let e = `list-label-${o}`;
87
+ a.setAttribute("id", e), n.setAttribute("id", o), n.setAttribute("aria-labelledby", e);
88
+ let r = new t(s, n);
89
+ r.init(), this.subNavs.set(o, {
90
+ item: i,
91
+ trigger: s,
92
+ list: n,
93
+ link: a,
94
+ widget: r
95
+ });
96
+ }
97
+ }), this.addEventListener("disclosure-toggle", this.handleDisclosure), this.flyout && (this.edgeCheck = this.hasAttribute("edgeCheck"), this.mq = this.getAttribute("mq") || "(min-width: 720px)", this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: r })));
98
+ }
99
+ disconnectedCallback() {
100
+ this.controller.abort(), this.subNavs?.forEach((e) => e.widget.detach()), this.iO?.disconnect();
101
+ }
102
+ handleDisclosure = ({ detail: e }) => {
103
+ let { isOpen: t, id: n } = e, { item: r } = this.subNavs.get(n);
104
+ r.classList.toggle("mx-nav--open"), t ? this.keyboard.attachPopup(n, this.handleCloseAny) : this.keyboard.detachPopup(n);
105
+ };
106
+ handleCloseAny = () => {
107
+ this.subNavs?.forEach(({ widget: e }) => {
108
+ e && e.isOpen && e.handleToggle();
109
+ });
110
+ };
111
+ handleFlyout = (e) => {
112
+ let t = e.target.closest("li");
113
+ if (!t) return;
114
+ let n = t.querySelector(":scope > ul");
115
+ n && this.subNavs?.forEach(({ widget: e, list: t }) => {
116
+ e && (e.isOpen && e.handleToggle(), t.id === n.id && e.handleToggle());
117
+ });
118
+ };
119
+ handleBreakpoint = ({ matches: e }) => {
120
+ let { signal: t } = this.controller;
121
+ e ? (this.addEventListener("mouseover", this.handleFlyout, { signal: t }), this.addEventListener("mouseleave", this.handleCloseAny, { signal: t }), this.edgeCheck && this.handleEdgeCheck()) : (this.removeEventListener("mouseover", this.handleFlyout), this.removeEventListener("mouseleave", this.handleCloseAny));
122
+ };
123
+ handleEdgeCheck() {
124
+ let e = window.innerWidth;
125
+ this.iO = new IntersectionObserver((t, n) => {
126
+ t.forEach(({ boundingClientRect: t, target: r }) => {
127
+ e < t.right && r.classList.add("mx-nav--reverse"), n.unobserve(r);
128
+ });
129
+ }), this.subNavs?.forEach(({ list: e }) => {
130
+ this.iO.observe(e), e.querySelectorAll("ul")?.forEach((e) => this.iO.observe(e));
131
+ });
132
+ }
133
+ get links() {
134
+ let e = this.querySelectorAll("a");
135
+ if (!e.length) throw Error(`${this.localName} must links`);
136
+ return e;
137
+ }
138
+ get lists() {
139
+ return this.querySelectorAll("li > ul");
140
+ }
141
+ get breakpoint() {
142
+ return window.matchMedia(this.mq);
143
+ }
144
+ };
145
+ customElements.get("mx-nav") || customElements.define("mx-nav", r);
146
+ //#endregion
147
+ export { n, r as t };
@@ -0,0 +1,30 @@
1
+ //#region src/Component/Popover/Elements/Popover.ts
2
+ var e = class extends HTMLElement {
3
+ internals_;
4
+ polyfills;
5
+ constructor() {
6
+ super(), this.internals_ = this.attachInternals();
7
+ }
8
+ async connectedCallback() {
9
+ if (this.container && this.trigger && (!("anchorName" in document.documentElement.style) || !("popover" in HTMLElement.prototype))) {
10
+ let { default: e } = await import("./polyfills-D-qh1a_2.js");
11
+ this.polyfills = new e(this.container);
12
+ }
13
+ }
14
+ disconnectedCallback() {
15
+ this.polyfills?.destroy();
16
+ }
17
+ get container() {
18
+ let e = this.querySelector("[popover]");
19
+ if (!e) throw Error(`${this.localName} must contain a <div popover> element.`);
20
+ return e;
21
+ }
22
+ get trigger() {
23
+ let e = this.querySelector(`[popovertarget=${this.container?.id}]`);
24
+ if (!e) throw Error(`${this.localName} must contain a <button popovertarget="${this.container.id}">`);
25
+ return e;
26
+ }
27
+ };
28
+ customElements.get("mx-popover") || customElements.define("mx-popover", e);
29
+ //#endregion
30
+ export { e as t };
@@ -0,0 +1,51 @@
1
+ import { t as e } from "./utilities-Dd-08SW6.js";
2
+ //#region src/Component/Sticky/Elements/Sticky.ts
3
+ var t = class extends HTMLElement {
4
+ internals_;
5
+ iO;
6
+ rO;
7
+ offsetPropName;
8
+ root = null;
9
+ rootMargin = "0px 0px 0px 0px";
10
+ thresholds = [0];
11
+ constructor() {
12
+ super(), this.internals_ = this.attachInternals();
13
+ }
14
+ connectedCallback() {
15
+ this.offsetPropName = this.getAttribute("offsetpropname") || "--sticky-offset";
16
+ let e = {
17
+ root: this.root,
18
+ rootMargin: this.rootMargin,
19
+ thresholds: this.thresholds
20
+ };
21
+ this.iO = new IntersectionObserver(([{ boundingClientRect: t }]) => {
22
+ let n = t.y < 0;
23
+ this.classList.toggle("is-stuck", n);
24
+ let r = new CustomEvent("sticky-toggle", {
25
+ bubbles: !0,
26
+ cancelable: !0,
27
+ detail: {
28
+ isSticky: n,
29
+ options: e,
30
+ target: this
31
+ }
32
+ });
33
+ this.dispatchEvent(r);
34
+ }, e), this.iO.observe(this.trigger), this.offsetPropName && (this.rO = new ResizeObserver((e) => {
35
+ e.forEach(({ borderBoxSize: e }) => {
36
+ let [{ blockSize: t }] = e;
37
+ document.body.style.setProperty(this.offsetPropName, `${t.toFixed(1)}px`);
38
+ });
39
+ }), this.rO.observe(this));
40
+ }
41
+ disconnectedCallback() {
42
+ this.iO.disconnect(), this.rO?.disconnect();
43
+ }
44
+ get trigger() {
45
+ let t = this.querySelector(".mx-sticky__trigger");
46
+ return t || (t = e("<div class=\"mx-sticky__trigger\"></div>"), this.insertAdjacentElement("beforebegin", t)), t;
47
+ }
48
+ };
49
+ customElements.get("mx-sticky") || customElements.define("mx-sticky", t);
50
+ //#endregion
51
+ export { t };