@swisspost/design-system-components 10.0.0-next.48 → 10.0.0-next.50

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 (249) hide show
  1. package/dist/cjs/{event-from-C6kpQwhw.js → event-from-CLvtSUKf.js} +20 -6
  2. package/dist/cjs/{get-root-CfQ2PogP.js → get-root-CyMf3Vsd.js} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-CZyXYkIN.js → package-qtH-QrKv.js} +1 -1
  5. package/dist/cjs/post-accordion_2.cjs.entry.js +5 -5
  6. package/dist/cjs/post-avatar.cjs.entry.js +27 -37
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
  8. package/dist/cjs/post-banner.cjs.entry.js +5 -5
  9. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +5 -5
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +12 -7
  11. package/dist/cjs/post-card-control.cjs.entry.js +5 -5
  12. package/dist/cjs/post-closebutton_15.cjs.entry.js +274 -134
  13. package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -6
  14. package/dist/cjs/post-components.cjs.js +1 -1
  15. package/dist/cjs/post-footer.cjs.entry.js +4 -4
  16. package/dist/cjs/post-linkarea.cjs.entry.js +19 -8
  17. package/dist/cjs/post-popover.cjs.entry.js +4 -4
  18. package/dist/cjs/post-rating.cjs.entry.js +4 -4
  19. package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
  20. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  21. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  22. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
  23. package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
  24. package/dist/collection/animations/pop-in.js +14 -0
  25. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  26. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  27. package/dist/collection/components/post-avatar/post-avatar.css +1 -1
  28. package/dist/collection/components/post-avatar/post-avatar.js +38 -34
  29. package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
  30. package/dist/collection/components/post-banner/post-banner.js +2 -2
  31. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
  32. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
  33. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +30 -4
  34. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  35. package/dist/collection/components/post-card-control/post-card-control.js +2 -2
  36. package/dist/collection/components/post-closebutton/button-types.js +1 -0
  37. package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
  38. package/dist/collection/components/post-closebutton/post-closebutton.js +65 -5
  39. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  40. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
  41. package/dist/collection/components/post-footer/post-footer.css +1 -1
  42. package/dist/collection/components/post-footer/post-footer.js +1 -1
  43. package/dist/collection/components/post-header/post-header.css +1 -1
  44. package/dist/collection/components/post-header/post-header.js +19 -11
  45. package/dist/collection/components/post-icon/post-icon.js +39 -33
  46. package/dist/collection/components/post-language-option/post-language-option.css +1 -1
  47. package/dist/collection/components/post-language-option/post-language-option.js +1 -2
  48. package/dist/collection/components/post-language-switch/post-language-switch.js +1 -2
  49. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
  50. package/dist/collection/components/post-linkarea/post-linkarea.js +24 -6
  51. package/dist/collection/components/post-list/post-list.css +1 -1
  52. package/dist/collection/components/post-list/post-list.js +1 -1
  53. package/dist/collection/components/post-list-item/post-list-item.js +1 -1
  54. package/dist/collection/components/post-logo/post-logo.js +1 -1
  55. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  56. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  57. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  58. package/dist/collection/components/post-megadropdown/post-megadropdown.js +73 -11
  59. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  60. package/dist/collection/components/post-menu/post-menu.css +1 -1
  61. package/dist/collection/components/post-menu/post-menu.js +51 -9
  62. package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
  63. package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
  64. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  65. package/dist/collection/components/post-popover/post-popover.css +1 -1
  66. package/dist/collection/components/post-popover/post-popover.js +1 -1
  67. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  68. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +18 -7
  69. package/dist/collection/components/post-rating/post-rating.css +1 -1
  70. package/dist/collection/components/post-rating/post-rating.js +1 -1
  71. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  72. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  73. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  74. package/dist/collection/components/post-tabs/post-tabs.js +1 -1
  75. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  76. package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
  77. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
  78. package/dist/collection/utils/event-from.js +20 -6
  79. package/dist/component-names.json +39 -0
  80. package/dist/components/event-from.js +20 -6
  81. package/dist/components/package.js +1 -1
  82. package/dist/components/post-accordion-item2.js +1 -1
  83. package/dist/components/post-accordion2.js +1 -1
  84. package/dist/components/post-avatar.js +28 -36
  85. package/dist/components/post-back-to-top.js +1 -1
  86. package/dist/components/post-banner.js +2 -2
  87. package/dist/components/post-breadcrumb-item2.js +1 -1
  88. package/dist/components/post-breadcrumbs.js +14 -7
  89. package/dist/components/post-card-control.js +3 -3
  90. package/dist/components/post-closebutton.js +1 -44
  91. package/dist/components/post-closebutton2.js +77 -0
  92. package/dist/components/post-collapsible-trigger2.js +1 -1
  93. package/dist/components/post-collapsible2.js +1 -1
  94. package/dist/components/post-footer.js +2 -2
  95. package/dist/components/post-header.js +17 -12
  96. package/dist/components/post-icon2.js +39 -33
  97. package/dist/components/post-language-option.js +2 -3
  98. package/dist/components/post-language-switch.js +1 -2
  99. package/dist/components/post-linkarea.js +21 -8
  100. package/dist/components/post-list-item.js +1 -1
  101. package/dist/components/post-list.js +2 -2
  102. package/dist/components/post-logo.js +1 -1
  103. package/dist/components/post-mainnavigation.js +2 -2
  104. package/dist/components/post-megadropdown-trigger.js +1 -1
  105. package/dist/components/post-megadropdown.js +74 -12
  106. package/dist/components/post-menu-item2.js +2 -2
  107. package/dist/components/post-menu-trigger2.js +1 -1
  108. package/dist/components/post-menu2.js +33 -11
  109. package/dist/components/post-popover.js +15 -3
  110. package/dist/components/post-popovercontainer2.js +30 -5
  111. package/dist/components/post-rating.js +2 -2
  112. package/dist/components/post-tab-header.js +2 -2
  113. package/dist/components/post-tab-panel.js +1 -1
  114. package/dist/components/post-tabs.js +1 -1
  115. package/dist/components/post-togglebutton.js +1 -1
  116. package/dist/components/post-tooltip-trigger.js +1 -1
  117. package/dist/components/post-tooltip.js +2 -2
  118. package/dist/components/react/{p-Tg0GNTZM.js → p-B392lG2N.js} +3 -3
  119. package/dist/components/react/{p-Dq9F2i7n.js → p-B9Y7UQKI.js} +3 -3
  120. package/dist/components/react/{p-38PqL5iD.js → p-BXPcgIqO.js} +3 -3
  121. package/dist/components/react/{p-Da5wbVP8.js → p-BcVKzjda.js} +40 -34
  122. package/dist/components/react/{p-CiYSngKM.js → p-BlOv-NDA.js} +6 -6
  123. package/dist/components/react/{p-q8Fvf8A0.js → p-BmpB1vs4.js} +2 -2
  124. package/dist/components/react/p-BuKAaKXE.js +78 -0
  125. package/dist/components/react/{p-JHuJA2Lv.js → p-Bw6vnK1I.js} +36 -14
  126. package/dist/components/react/{p-Ce7jgYmK.js → p-CDsgZHvX.js} +31 -6
  127. package/dist/components/react/{p-kraHE1r3.js → p-CzIKqBrS.js} +20 -6
  128. package/dist/components/react/p-DimG3b3P.js +3 -0
  129. package/dist/components/react/{p-DzYquz3e.js → p-DnHwlsBi.js} +3 -3
  130. package/dist/components/react/{p-CGsAj6ij.js → p-U9MTjvRU.js} +2 -2
  131. package/dist/components/react/post-accordion-item.js +1 -1
  132. package/dist/components/react/post-accordion.js +1 -1
  133. package/dist/components/react/post-avatar.js +29 -37
  134. package/dist/components/react/post-back-to-top.js +3 -3
  135. package/dist/components/react/post-banner.js +4 -4
  136. package/dist/components/react/post-breadcrumb-item.js +1 -1
  137. package/dist/components/react/post-breadcrumbs.js +21 -14
  138. package/dist/components/react/post-card-control.js +5 -5
  139. package/dist/components/react/post-closebutton.js +1 -45
  140. package/dist/components/react/post-collapsible-trigger.js +1 -1
  141. package/dist/components/react/post-collapsible.js +1 -1
  142. package/dist/components/react/post-footer.js +8 -8
  143. package/dist/components/react/post-header.js +19 -14
  144. package/dist/components/react/post-icon.js +1 -1
  145. package/dist/components/react/post-language-option.js +3 -4
  146. package/dist/components/react/post-language-switch.js +7 -8
  147. package/dist/components/react/post-linkarea.js +22 -9
  148. package/dist/components/react/post-list-item.js +2 -2
  149. package/dist/components/react/post-list.js +3 -3
  150. package/dist/components/react/post-logo.js +2 -2
  151. package/dist/components/react/post-mainnavigation.js +4 -4
  152. package/dist/components/react/post-megadropdown-trigger.js +3 -3
  153. package/dist/components/react/post-megadropdown.js +75 -13
  154. package/dist/components/react/post-menu-item.js +1 -1
  155. package/dist/components/react/post-menu-trigger.js +1 -1
  156. package/dist/components/react/post-menu.js +1 -1
  157. package/dist/components/react/post-popover.js +17 -5
  158. package/dist/components/react/post-popovercontainer.js +1 -1
  159. package/dist/components/react/post-rating.js +4 -4
  160. package/dist/components/react/post-tab-header.js +3 -3
  161. package/dist/components/react/post-tab-panel.js +2 -2
  162. package/dist/components/react/post-tabs.js +2 -2
  163. package/dist/components/react/post-togglebutton.js +2 -2
  164. package/dist/components/react/post-tooltip-trigger.js +2 -2
  165. package/dist/components/react/post-tooltip.js +4 -4
  166. package/dist/docs.json +174 -12
  167. package/dist/esm/{event-from-kraHE1r3.js → event-from-CzIKqBrS.js} +20 -6
  168. package/dist/esm/{get-root-hlzxoycr.js → get-root-BkQ3CrLq.js} +1 -1
  169. package/dist/esm/loader.js +1 -1
  170. package/dist/esm/package-DimG3b3P.js +3 -0
  171. package/dist/esm/post-accordion_2.entry.js +5 -5
  172. package/dist/esm/post-avatar.entry.js +27 -37
  173. package/dist/esm/post-back-to-top.entry.js +3 -3
  174. package/dist/esm/post-banner.entry.js +5 -5
  175. package/dist/esm/post-breadcrumb-item_2.entry.js +5 -5
  176. package/dist/esm/post-breadcrumbs.entry.js +13 -8
  177. package/dist/esm/post-card-control.entry.js +5 -5
  178. package/dist/esm/post-closebutton_15.entry.js +274 -134
  179. package/dist/esm/post-collapsible_2.entry.js +6 -6
  180. package/dist/esm/post-components.js +1 -1
  181. package/dist/esm/post-footer.entry.js +4 -4
  182. package/dist/esm/post-linkarea.entry.js +19 -8
  183. package/dist/esm/post-popover.entry.js +4 -4
  184. package/dist/esm/post-rating.entry.js +4 -4
  185. package/dist/esm/post-tab-header.entry.js +4 -4
  186. package/dist/esm/post-tab-panel.entry.js +3 -3
  187. package/dist/esm/post-tabs.entry.js +3 -3
  188. package/dist/esm/post-tooltip-trigger.entry.js +3 -3
  189. package/dist/esm/post-tooltip.entry.js +4 -4
  190. package/dist/post-components/{p-3c71f590.entry.js → p-048d2c1a.entry.js} +1 -1
  191. package/dist/post-components/p-0a4d9f33.entry.js +1 -0
  192. package/dist/post-components/p-11abb64f.entry.js +1 -0
  193. package/dist/post-components/p-1253185c.entry.js +1 -0
  194. package/dist/post-components/p-15e0d4b8.entry.js +1 -0
  195. package/dist/post-components/{p-d61bb2ff.entry.js → p-1d4252ba.entry.js} +1 -1
  196. package/dist/post-components/{p-aad86320.entry.js → p-3d30eafa.entry.js} +1 -1
  197. package/dist/post-components/p-4114fc83.entry.js +1 -0
  198. package/dist/post-components/p-5ddde390.entry.js +1 -0
  199. package/dist/post-components/p-89411986.entry.js +1 -0
  200. package/dist/post-components/{p-6777e505.entry.js → p-9bbf7271.entry.js} +1 -1
  201. package/dist/post-components/{p-BkvZk-PA.js → p-CBFgkSgY.js} +1 -1
  202. package/dist/post-components/p-CJ80BZ06.js +1 -0
  203. package/dist/post-components/p-CzIKqBrS.js +1 -0
  204. package/dist/post-components/p-DimG3b3P.js +1 -0
  205. package/dist/post-components/p-b034d196.entry.js +1 -0
  206. package/dist/post-components/p-b36c129a.entry.js +1 -0
  207. package/dist/post-components/p-b82e7cbe.entry.js +1 -0
  208. package/dist/post-components/{p-6add880f.entry.js → p-e7fbb03d.entry.js} +1 -1
  209. package/dist/post-components/p-f1d53256.entry.js +1 -0
  210. package/dist/post-components/p-f97f3a19.entry.js +1 -0
  211. package/dist/post-components/{p-16772417.entry.js → p-f9d044a3.entry.js} +1 -1
  212. package/dist/post-components/post-components.esm.js +1 -1
  213. package/dist/types/animations/pop-in.d.ts +1 -0
  214. package/dist/types/components/post-avatar/post-avatar.d.ts +5 -4
  215. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +5 -0
  216. package/dist/types/components/post-closebutton/button-types.d.ts +2 -0
  217. package/dist/types/components/post-closebutton/post-closebutton.d.ts +10 -1
  218. package/dist/types/components/post-header/post-header.d.ts +5 -0
  219. package/dist/types/components/post-icon/post-icon.d.ts +11 -0
  220. package/dist/types/components/post-linkarea/post-linkarea.d.ts +6 -0
  221. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +33 -6
  222. package/dist/types/components/post-menu/post-menu.d.ts +7 -1
  223. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +6 -2
  224. package/dist/types/components.d.ts +39 -3
  225. package/dist/types/utils/event-from.d.ts +2 -1
  226. package/hydrate/index.js +357 -184
  227. package/hydrate/index.mjs +357 -184
  228. package/package.json +8 -6
  229. package/dist/components/react/p-0Ltezq5O.js +0 -3
  230. package/dist/esm/package-0Ltezq5O.js +0 -3
  231. package/dist/post-components/p-0Ltezq5O.js +0 -1
  232. package/dist/post-components/p-38d3d441.entry.js +0 -1
  233. package/dist/post-components/p-40f21542.entry.js +0 -1
  234. package/dist/post-components/p-4243cdd1.entry.js +0 -1
  235. package/dist/post-components/p-4c18cb8c.entry.js +0 -1
  236. package/dist/post-components/p-51dc7647.entry.js +0 -1
  237. package/dist/post-components/p-8363fedb.entry.js +0 -1
  238. package/dist/post-components/p-83998038.entry.js +0 -1
  239. package/dist/post-components/p-85bb1b5e.entry.js +0 -1
  240. package/dist/post-components/p-8f4d8685.entry.js +0 -1
  241. package/dist/post-components/p-95ad536d.entry.js +0 -1
  242. package/dist/post-components/p-9d806e89.entry.js +0 -1
  243. package/dist/post-components/p-_0G7tavk.js +0 -1
  244. package/dist/post-components/p-c3e38acf.entry.js +0 -1
  245. package/dist/post-components/p-kraHE1r3.js +0 -1
  246. package/dist/prebuild.js +0 -26
  247. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +0 -1
  248. package/dist/cjs/{breakpoints-DmZ_BQGo.js → breakpoints-CEkeixld.js} +3 -3
  249. package/dist/esm/{breakpoints-_0G7tavk.js → breakpoints-CJ80BZ06.js} +3 -3
@@ -12,10 +12,11 @@ import { h, Host, } from "@stencil/core";
12
12
  import { PLACEMENT_TYPES } from "../../types/index";
13
13
  import { version } from "../../../../package";
14
14
  import { getFocusableChildren } from "../../utils/get-focusable-children";
15
- import { getRoot, checkEmptyOrOneOf, EventFrom } from "../../utils/index";
15
+ import { getRoot, checkEmptyOrOneOf, EventFrom, checkRequiredAndType } from "../../utils/index";
16
16
  /**
17
17
  * @part menu - The container element that holds the list of menu items.
18
- */
18
+ * @slot header - Holds the header part of the menu.
19
+ */
19
20
  export class PostMenu {
20
21
  constructor() {
21
22
  this.lastFocusedElement = null;
@@ -52,18 +53,32 @@ export class PostMenu {
52
53
  }
53
54
  };
54
55
  this.handlePostToggle = (event) => {
55
- this.isVisible = event.detail;
56
+ this.isVisible = event.detail.isOpen;
56
57
  this.toggleMenu.emit(this.isVisible);
57
58
  requestAnimationFrame(() => {
58
59
  if (this.isVisible) {
59
60
  this.lastFocusedElement = this.root?.activeElement;
60
61
  const menuItems = this.getSlottedItems();
61
- if (menuItems.length > 0) {
62
- menuItems[0].focus();
62
+ if (event.detail.first) {
63
+ if (menuItems.length > 0) {
64
+ // Add role="menu" to the popovercontainer
65
+ this.host.setAttribute('role', 'menu');
66
+ // Add role="menuitem" to the focusable elements
67
+ menuItems.forEach(item => {
68
+ item.setAttribute('role', 'menuitem');
69
+ });
70
+ // Add aria-label to the menu
71
+ if (this.label)
72
+ this.host.setAttribute('aria-label', this.label);
73
+ }
63
74
  }
75
+ menuItems[0].focus();
64
76
  }
65
77
  else if (this.lastFocusedElement) {
66
- this.lastFocusedElement.focus();
78
+ setTimeout(() => {
79
+ // This timeout is added for NVDA to announce the menu as collapsed
80
+ this.lastFocusedElement.focus();
81
+ }, 0);
67
82
  }
68
83
  });
69
84
  };
@@ -77,6 +92,9 @@ export class PostMenu {
77
92
  validatePlacement() {
78
93
  checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
79
94
  }
95
+ validateLabel() {
96
+ checkRequiredAndType(this, 'label', 'string');
97
+ }
80
98
  connectedCallback() {
81
99
  this.root = getRoot(this.host);
82
100
  this.host.addEventListener('keydown', this.handleKeyDown);
@@ -89,6 +107,7 @@ export class PostMenu {
89
107
  }
90
108
  componentDidLoad() {
91
109
  this.validatePlacement();
110
+ this.validateLabel();
92
111
  if (this.popoverRef) {
93
112
  this.popoverRef.addEventListener('postToggle', this.handlePostToggle);
94
113
  }
@@ -167,8 +186,9 @@ export class PostMenu {
167
186
  }
168
187
  }
169
188
  getSlottedItems() {
170
- const slot = this.host.shadowRoot.querySelector('slot');
171
- const slottedElements = slot ? slot.assignedElements() : [];
189
+ const slot = this.host.shadowRoot.querySelectorAll('slot');
190
+ const slottedElements = [];
191
+ slot.forEach(slotItem => slottedElements.push(...slotItem.assignedElements()));
172
192
  return (slottedElements
173
193
  // If the element is a slot, get the assigned elements
174
194
  .flatMap(el => (el instanceof HTMLSlotElement ? el.assignedElements() : el))
@@ -176,7 +196,7 @@ export class PostMenu {
176
196
  .flatMap(el => Array.from(getFocusableChildren(el))));
177
197
  }
178
198
  render() {
179
- return (h(Host, { key: 'ee365a30646247563fccd55556f7667cb1591d02', "data-version": version, role: "menu" }, h("post-popovercontainer", { key: 'c649841d408d3f35dfed959cdc6b041163ff80d3', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9f4f145b80c716d27dc51f4bcb0d269b2b2678a8', part: "menu" }, h("slot", { key: '72b53c8f154a4a91541799a789e8618a8d1a9c2c' })))));
199
+ return (h(Host, { key: 'd98d7b0a1c607732ab12c94f8d872408a053c19b', "data-version": version }, h("post-popovercontainer", { key: '669e6062e5ff0dfac0d311cc8fdd0bb51735aac1', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '6bc1abb7b764e9e6985a839904ed5575ea20a519', part: "menu" }, h("slot", { key: '6b8670f2e80ed93761797b9161ddf54bb88f73ec', name: "header" }), h("slot", { key: '971f39ae63f22a503e36aeecb67575304ce14248' })))));
180
200
  }
181
201
  static get is() { return "post-menu"; }
182
202
  static get encapsulation() { return "shadow"; }
@@ -217,6 +237,25 @@ export class PostMenu {
217
237
  "setter": false,
218
238
  "reflect": false,
219
239
  "defaultValue": "'bottom'"
240
+ },
241
+ "label": {
242
+ "type": "string",
243
+ "attribute": "label",
244
+ "mutable": false,
245
+ "complexType": {
246
+ "original": "string",
247
+ "resolved": "string",
248
+ "references": {}
249
+ },
250
+ "required": true,
251
+ "optional": false,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": "An accessible name for the menu."
255
+ },
256
+ "getter": false,
257
+ "setter": false,
258
+ "reflect": false
220
259
  }
221
260
  };
222
261
  }
@@ -322,6 +361,9 @@ export class PostMenu {
322
361
  return [{
323
362
  "propName": "placement",
324
363
  "methodName": "validatePlacement"
364
+ }, {
365
+ "propName": "label",
366
+ "methodName": "validateLabel"
325
367
  }];
326
368
  }
327
369
  }
@@ -1 +1 @@
1
- post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem 1rem;gap:.5rem;font-size:1rem;color:#050400;transition:color 250ms cubic-bezier(0.4, 0, 0.2, 1);outline-offset:0;padding-block:.75rem}post-menu-item button:has(post-icon:last-child),post-menu-item a:has(post-icon:last-child){padding-inline-end:.75rem}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem}}post-menu-item button>post-icon:last-child,post-menu-item a>post-icon:last-child{margin-inline-start:.5rem}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:-2px !important;border-radius:4px}post-menu-item button::after,post-menu-item a::after{content:"";display:block;position:absolute;inset-block-end:0;inset-inline:0;height:3px;background-color:rgba(0,0,0,0);transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-menu-item button:hover,post-menu-item a:hover{color:#504f4b}post-menu-item button:hover::after,post-menu-item a:hover::after{background-color:currentColor}
1
+ post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.5rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1.25rem;height:1.25rem;margin:.125rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.375rem;height:1.375rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
3
  export class PostMenuItem {
4
4
  render() {
5
- return (h(Host, { key: '6be606f22288f655320c5ef58f3d0f4bf39d7f62', role: "menuitem", "data-version": version }, h("slot", { key: 'a6d4b48b8cb09e27b19cc14def007e3754ff06c0' })));
5
+ return (h(Host, { key: '6b2c8542aed22132c627fadb6be036124e37853e', "data-version": version }, h("slot", { key: '8059cb5112270641ef7ba860cdacb2cdaa75fd59' })));
6
6
  }
7
7
  static get is() { return "post-menu-item"; }
8
8
  static get originalStyleUrls() {
@@ -73,7 +73,7 @@ export class PostMenuTrigger {
73
73
  }
74
74
  }
75
75
  render() {
76
- return (h(Host, { key: '76b3c59cdae5c78cefaaf1ea2a9668a77bddd37e', "data-version": version, "tab-index": "-1" }, h("slot", { key: '3835d87c3795e694f7493ceb735bd638bdd2dea1' })));
76
+ return (h(Host, { key: 'e4ab1c0cd7227b83994cbd74f2bb3fe88c48126e', "data-version": version, "tab-index": "-1" }, h("slot", { key: '9c5aa5d42457f6716c7607b50b5453cdce8d50d0' })));
77
77
  }
78
78
  static get is() { return "post-menu-trigger"; }
79
79
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- @keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}.btn-close{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{background-color:ButtonFace !important}.btn-close:hover{background-color:Highlight !important}}.btn-close{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:#999}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:min(var(--post-popover-max-width, 280px),100vw)}.popover-content{padding:.5em;flex-grow:1}.btn-close{color:var(--post-current-fg)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:hover{color:HighlightText !important}}
1
+ *{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:min(var(--post-popover-max-width, 280px),100vw)}.popover-content{padding:.5em;flex-grow:1}
@@ -113,7 +113,7 @@ export class PostPopover {
113
113
  trigger.setAttribute('aria-expanded', force ? 'false' : null);
114
114
  }
115
115
  render() {
116
- return (h(Host, { key: 'fe756429b10af594a621b5769f129ee82b1aa6eb', "data-version": version }, h("post-popovercontainer", { key: '437b8c75fc878b3edb916887cfab3933ed08c7b2', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '082e00cb11a042cad036252743261395874b0a86', class: "popover-container" }, h("div", { key: 'be2e39304472bf351a524dc4f6eeb3ec9da8fc58', class: "popover-content" }, h("slot", { key: 'e1cd722828d3b136ad96553d81334b31de3289f9' })), h("button", { key: 'b6fa750860d95bf223da9224d6fa8531e577b3a5', class: "btn-close", onClick: () => this.hide() }, h("span", { key: 'dd3fb8e0e0e15c58df5b1aacfe5d4a6b90ec3843', class: "visually-hidden" }, this.closeButtonCaption))))));
116
+ return (h(Host, { key: '4224bfe1dc1bdb7fdfb86da67b54816e8cc6fce4', "data-version": version }, h("post-popovercontainer", { key: '3d7e370a89214878d33598cafd3d118c74d16312', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'ed806f93ddec2656a15a1b242246c9c09b34f58a', class: "popover-container" }, h("div", { key: 'd60dd75153f88fc65d56dc9ec7387363e78cb835', class: "popover-content" }, h("slot", { key: 'f37005a225ecde32a80dd5efc3e61ccea7ab6dc5' })), h("post-closebutton", { key: 'c440bc94fb2832a8b8fcc0dd545b5f9d65cf834a', onClick: () => this.hide() }, this.closeButtonCaption)))));
117
117
  }
118
118
  static get is() { return "post-popover"; }
119
119
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- @keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}:where(post-popovercontainer){background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:where(post-popovercontainer)>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px}:where(post-popovercontainer)>div.animate-pop-in{animation:popIn .25s ease-out forwards}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer)>div{border:2px solid rgba(0,0,0,0)}}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer)[safe-space]::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:where(post-popovercontainer)[safe-space=triangle]::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:where(post-popovercontainer)[safe-space=trapezoid]::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:where(post-popovercontainer):not(:has(.arrow))>div{box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow)>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top)>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left)>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right)>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}
1
+ @layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}:where(post-popovercontainer){background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:where(post-popovercontainer)>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer)>div{border:2px solid rgba(0,0,0,0)}}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer)[safe-space]::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:where(post-popovercontainer)[safe-space=triangle]::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:where(post-popovercontainer)[safe-space=trapezoid]::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:where(post-popovercontainer):not(:has(.arrow))>div{box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow)>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top)>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left)>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right)>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}
@@ -5,11 +5,13 @@ import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, s
5
5
  import { PLACEMENT_TYPES } from "../../types/index";
6
6
  // Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
7
7
  import { apply, isSupported } from "@oddbird/popover-polyfill/fn";
8
+ import { popIn } from "../../animations/pop-in";
8
9
  /**
9
10
  * @slot - Default slot for placing content inside the popovercontainer.
10
11
  */
11
12
  export class PostPopovercontainer {
12
13
  constructor() {
14
+ this.firstOpen = true;
13
15
  /**
14
16
  * Defines the placement of the popovercontainer according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
15
17
  * Popovercontainers are automatically flipped to the opposite side if there is not enough available space and are shifted
@@ -109,9 +111,19 @@ export class PostPopovercontainer {
109
111
  this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
110
112
  const isOpen = e.newState === 'open';
111
113
  if (isOpen) {
114
+ const content = this.host.querySelector('.popover-content');
112
115
  this.startAutoupdates();
116
+ if (content && this.animation === 'pop-in') {
117
+ popIn(content);
118
+ }
113
119
  if (this.safeSpace)
114
120
  window.addEventListener('mousemove', this.mouseTrackingHandler.bind(this));
121
+ // Emit event with `first` flag only true on the first open
122
+ if (this.firstOpen) {
123
+ this.postToggle.emit({ isOpen, first: this.firstOpen });
124
+ this.firstOpen = false;
125
+ return;
126
+ }
115
127
  }
116
128
  else {
117
129
  if (typeof this.clearAutoUpdate === 'function')
@@ -119,7 +131,7 @@ export class PostPopovercontainer {
119
131
  if (this.safeSpace)
120
132
  window.removeEventListener('mousemove', this.mouseTrackingHandler.bind(this));
121
133
  }
122
- this.postToggle.emit(isOpen);
134
+ this.postToggle.emit({ isOpen: isOpen, first: false });
123
135
  }
124
136
  /**
125
137
  * Start listening for DOM updates, scroll events etc. that have
@@ -250,10 +262,9 @@ export class PostPopovercontainer {
250
262
  }
251
263
  }
252
264
  render() {
253
- const animationClass = this.animation ? `animate-${this.animation}` : '';
254
- return (h(Host, { key: '357f53696ca28ab2c137d47e2192038dc756c289', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: '9c40bdc5034ccf14157ee1ae8ce33fe58a9049e4', class: animationClass }, this.arrow && (h("span", { key: '6133ab54aaea6f198560ca5cb30f5604318203f6', class: "arrow", ref: el => {
265
+ return (h(Host, { key: '493d032d16ace815b6c031e77dbcc673f26d149b', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: '97bb357cada0456b3aa458e12768d9ad5458ef24', class: "popover-content" }, this.arrow && (h("span", { key: 'f5f2256470edad5a8ca89c32b3a44ef0fe388eea', class: "arrow", ref: el => {
255
266
  this.arrowRef = el;
256
- } })), h("slot", { key: '39f53833a3f570b2c8807a5903b531c6733b0ada' }))));
267
+ } })), h("slot", { key: 'f259b6ad624cf392e0d41026b4eab586009cb3c7' }))));
257
268
  }
258
269
  static get is() { return "post-popovercontainer"; }
259
270
  static get originalStyleUrls() {
@@ -404,11 +415,11 @@ export class PostPopovercontainer {
404
415
  "composed": true,
405
416
  "docs": {
406
417
  "tags": [],
407
- "text": "Fires whenever the popovercontainer gets shown or hidden, passing the new state in event.details as a boolean"
418
+ "text": "Fires whenever the popovercontainer gets shown or hidden, passing in event.detail an object containing two booleans: `isOpen`, which is true if the popovercontainer was opened and false if it was closed, and `first`, which is true if it was opened for the first time."
408
419
  },
409
420
  "complexType": {
410
- "original": "boolean",
411
- "resolved": "boolean",
421
+ "original": "{ isOpen: boolean; first?: boolean }",
422
+ "resolved": "{ isOpen: boolean; first?: boolean; }",
412
423
  "references": {}
413
424
  }
414
425
  }];
@@ -1 +1 @@
1
- @keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 calc(var(--post-core-dimension-4)*-1);border-radius:4px}.rating .star{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.active{--post-rating-star-stroke: hsl(0, 0%, 20%);--post-rating-star-fill: #fc0}.rating .star.hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.after-active{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:var(--post-core-dimension-2);outline:var(--post-core-dimension-2) solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: #fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: hsl(0, 0%, 90%)}
1
+ :host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 calc(var(--post-core-dimension-4)*-1);border-radius:4px}.rating .star{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.active{--post-rating-star-stroke: hsl(0, 0%, 20%);--post-rating-star-fill: #fc0}.rating .star.hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.after-active{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:var(--post-core-dimension-2);outline:var(--post-core-dimension-2) solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: #fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: hsl(0, 0%, 90%)}
@@ -91,7 +91,7 @@ export class PostRating {
91
91
  }
92
92
  }
93
93
  render() {
94
- return (h(Host, { key: '588c5d3c4600faa939cab4b673e27d08182323da', "data-version": version }, h("div", { key: '8fced4724505cdc2f3fb3160cf276ed1280b5431', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
94
+ return (h(Host, { key: 'befb055aff44467d2da231043db28797f843c239', "data-version": version }, h("div", { key: 'c231944ad2638c2b69b6ae9e8ad92a962aa50139', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
95
95
  'star': true,
96
96
  'before-hover': i < this.hoveredIndex,
97
97
  'active': i < Math.round(this.currentRating),
@@ -1 +1 @@
1
- .tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:"";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:#000;font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title{background-color:ButtonFace !important}.tab-title:hover{background-color:Highlight !important}}
1
+ .tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:"";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:#000;font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title{background-color:ButtonFace !important}.tab-title:hover{background-color:Highlight !important}}
@@ -13,7 +13,7 @@ export class PostTabHeader {
13
13
  this.tabId = `tab-${this.host.id || nanoid(6)}`;
14
14
  }
15
15
  render() {
16
- return (h(Host, { key: 'd5f6cd0ceb819b475ec49f8ea66e6b4b25f04f8e', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '8a87fef31572674981dab80e56e6b20163b448ae' })));
16
+ return (h(Host, { key: '387d9db0111153ca4a7da1a9ad600daeafa3b7a1', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '62126f05530776ca45b151b00834fa0c68c5b26e' })));
17
17
  }
18
18
  static get is() { return "post-tab-header"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -15,7 +15,7 @@ export class PostTabPanel {
15
15
  this.panelId = `panel-${this.host.id || nanoid(6)}`;
16
16
  }
17
17
  render() {
18
- return (h(Host, { key: '609dd2b8bf26e58e92a1dbc827e4479ac416d95b', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '121538878e0298f1f16f6e20eeb15d5da8a5ba9c' })));
18
+ return (h(Host, { key: '97ae92b05f495a63bd5ec5f57eb196fdf6772ca8', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '8b36e0849fcd65662a27bc62ac29cec0d8db4f41' })));
19
19
  }
20
20
  static get is() { return "post-tab-panel"; }
21
21
  static get encapsulation() { return "shadow"; }
@@ -145,7 +145,7 @@ export class PostTabs {
145
145
  nextTab.focus();
146
146
  }
147
147
  render() {
148
- return (h(Host, { key: 'dc7228c840d65e3546e0d13e5bcaa78819b5aeb9', "data-version": version }, h("div", { key: '377d592f7c00f3ec0c7aba2a4a8ca2b88cd37927', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '6e79f33d6cd82d55ba9fad2f09f6163ce7e0a372', class: "tabs", role: "tablist" }, h("slot", { key: '65fbf3cb6525f2f2ae97eb60dad313811db4c585', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '675a59a27e79bad06ea2b70c4fc7b0a6f4b020ff', class: "tab-content", part: "content" }, h("slot", { key: 'b559af0fa652e352673fbabb6829a62a5630e809', onSlotchange: () => this.moveMisplacedTabs() }))));
148
+ return (h(Host, { key: 'eb30ee19d073caf4f32e255045eff58c0cb511f5', "data-version": version }, h("div", { key: '0920e0cbb6565ff8a9ff663e938291c050d6c93c', class: "tabs-wrapper", part: "tabs" }, h("div", { key: 'df3a5a698a77719b371879effba16e11709b2c22', class: "tabs", role: "tablist" }, h("slot", { key: 'e6c9592b39e999369eb1b6f43b08e7130872add9', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '14cdae926ce10f854577de34b713c8e269568dbb', class: "tab-content", part: "content" }, h("slot", { key: 'f2aaff6a23f8dd2683963cb25c95d41953e708f5', onSlotchange: () => this.moveMisplacedTabs() }))));
149
149
  }
150
150
  static get is() { return "post-tabs"; }
151
151
  static get encapsulation() { return "shadow"; }
@@ -26,7 +26,7 @@ export class PostTogglebutton {
26
26
  this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
27
27
  }
28
28
  render() {
29
- return (h(Host, { key: '1cebe1d1314e2c89f141869e07521e7f30e58617', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '8b8c33befde8e93eca73a6239170c3786e2cf2f2' })));
29
+ return (h(Host, { key: '190c53c4bbada662698addcb288bcb50a8d179b3', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '544bf7d937386a6e65be75e249f3dcc080054d74' })));
30
30
  }
31
31
  static get is() { return "post-togglebutton"; }
32
32
  static get encapsulation() { return "shadow"; }
@@ -60,11 +60,11 @@ export class PostTooltip {
60
60
  * @param e Popovercontainer toggle event
61
61
  */
62
62
  handleToggle(e) {
63
- this.open = e.detail;
63
+ this.open = e.detail.isOpen;
64
64
  }
65
65
  render() {
66
66
  const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
67
- return (h(Host, { key: 'c5f293812e33520ea5a2c9224e93fe5e5e41cbe0', "data-version": version }, h("post-popovercontainer", { key: '7ec57e1a2315d95e7cb696cf6d2d1a1d8ae77257', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '79c91307707c56345acb136a45acdae859d54c2b' }))));
67
+ return (h(Host, { key: 'cdde276f07efb0916bb3b0cd7cf761788421e251', "data-version": version }, h("post-popovercontainer", { key: '06b4d472448d4083f717ce13e73ff9426f422ec4', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'c5efcac53b6c0fa207ceee34ee86580c7566f8a8' }))));
68
68
  }
69
69
  static get is() { return "post-tooltip"; }
70
70
  static get encapsulation() { return "shadow"; }
@@ -169,7 +169,7 @@ export class PostTooltipTrigger {
169
169
  this.tooltip?.hide();
170
170
  }
171
171
  render() {
172
- return (h(Host, { key: '6106c5a0bbe8d19da424e3c9389829009543b6d5', "data-version": version }, h("slot", { key: 'c7358b9b796f287bd165951664a1dd61a0372dc4', onSlotchange: () => this.handleSlotChange() })));
172
+ return (h(Host, { key: '49529a68fdcc56e8967cdd147ac4c5c35177e70f', "data-version": version }, h("slot", { key: '2b38e3412393f39dd6b2da480f591e4bec38ba34', onSlotchange: () => this.handleSlotChange() })));
173
173
  }
174
174
  static get is() { return "post-tooltip-trigger"; }
175
175
  static get encapsulation() { return "shadow"; }
@@ -6,12 +6,20 @@
6
6
  * @param ignoreNestedComponents - Whether to ignore events from nested components
7
7
  * @returns true if the event should be processed, false otherwise
8
8
  */
9
- function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
9
+ function shouldProcessEvent(event, tag, host, ignoreNestedComponents, allowDescendants = false) {
10
10
  if (!(event instanceof Event && event.target instanceof HTMLElement))
11
11
  return false;
12
12
  const eventTarget = event.target;
13
- if (eventTarget.localName !== tag)
14
- return false;
13
+ if (allowDescendants) {
14
+ // Accept event if target or any ancestor matches tag
15
+ if (!eventTarget.closest(tag))
16
+ return false;
17
+ }
18
+ else {
19
+ // Only accept event if target exactly matches tag
20
+ if (eventTarget.localName !== tag)
21
+ return false;
22
+ }
15
23
  if (ignoreNestedComponents) {
16
24
  // Find the closest parent with the same tag as the host
17
25
  const closestParentWithSameTag = findClosestParentWithTag(eventTarget, host.localName);
@@ -26,12 +34,18 @@ function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
26
34
  * @param option - Configuration options for the event guard
27
35
  * @param option.ignoreNestedComponents - Whether to ignore events from nested components
28
36
  */
29
- export function EventFrom(tag, option = { ignoreNestedComponents: true }) {
37
+ export function EventFrom(tag, option) {
38
+ // Set default values here
39
+ const opts = {
40
+ ignoreNestedComponents: true,
41
+ allowDescendants: false,
42
+ ...option,
43
+ };
30
44
  return function (target, propertyKey, descriptor) {
31
45
  if (descriptor) {
32
46
  const originalMethod = descriptor.value;
33
47
  descriptor.value = function (event) {
34
- if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
48
+ if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents, opts.allowDescendants)) {
35
49
  return;
36
50
  }
37
51
  return originalMethod.call(this, event);
@@ -57,7 +71,7 @@ export function EventFrom(tag, option = { ignoreNestedComponents: true }) {
57
71
  if (typeof originalFunction === 'function') {
58
72
  // Store original and add new behavior
59
73
  this[privateKey] = (event) => {
60
- if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
74
+ if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents)) {
61
75
  return;
62
76
  }
63
77
  return originalFunction.call(this, event);
@@ -0,0 +1,39 @@
1
+ {
2
+ "componentNames": [
3
+ "post-accordion",
4
+ "post-accordion-item",
5
+ "post-avatar",
6
+ "post-back-to-top",
7
+ "post-banner",
8
+ "post-breadcrumb-item",
9
+ "post-breadcrumbs",
10
+ "post-card-control",
11
+ "post-closebutton",
12
+ "post-collapsible",
13
+ "post-collapsible-trigger",
14
+ "post-footer",
15
+ "post-header",
16
+ "post-icon",
17
+ "post-language-option",
18
+ "post-language-switch",
19
+ "post-linkarea",
20
+ "post-list",
21
+ "post-list-item",
22
+ "post-logo",
23
+ "post-mainnavigation",
24
+ "post-megadropdown",
25
+ "post-megadropdown-trigger",
26
+ "post-menu",
27
+ "post-menu-item",
28
+ "post-menu-trigger",
29
+ "post-popover",
30
+ "post-popovercontainer",
31
+ "post-rating",
32
+ "post-tab-header",
33
+ "post-tab-panel",
34
+ "post-tabs",
35
+ "post-togglebutton",
36
+ "post-tooltip",
37
+ "post-tooltip-trigger"
38
+ ]
39
+ }
@@ -6,12 +6,20 @@
6
6
  * @param ignoreNestedComponents - Whether to ignore events from nested components
7
7
  * @returns true if the event should be processed, false otherwise
8
8
  */
9
- function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
9
+ function shouldProcessEvent(event, tag, host, ignoreNestedComponents, allowDescendants = false) {
10
10
  if (!(event instanceof Event && event.target instanceof HTMLElement))
11
11
  return false;
12
12
  const eventTarget = event.target;
13
- if (eventTarget.localName !== tag)
14
- return false;
13
+ if (allowDescendants) {
14
+ // Accept event if target or any ancestor matches tag
15
+ if (!eventTarget.closest(tag))
16
+ return false;
17
+ }
18
+ else {
19
+ // Only accept event if target exactly matches tag
20
+ if (eventTarget.localName !== tag)
21
+ return false;
22
+ }
15
23
  if (ignoreNestedComponents) {
16
24
  // Find the closest parent with the same tag as the host
17
25
  const closestParentWithSameTag = findClosestParentWithTag(eventTarget, host.localName);
@@ -26,12 +34,18 @@ function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
26
34
  * @param option - Configuration options for the event guard
27
35
  * @param option.ignoreNestedComponents - Whether to ignore events from nested components
28
36
  */
29
- function EventFrom(tag, option = { ignoreNestedComponents: true }) {
37
+ function EventFrom(tag, option) {
38
+ // Set default values here
39
+ const opts = {
40
+ ignoreNestedComponents: true,
41
+ allowDescendants: false,
42
+ ...option,
43
+ };
30
44
  return function (target, propertyKey, descriptor) {
31
45
  if (descriptor) {
32
46
  const originalMethod = descriptor.value;
33
47
  descriptor.value = function (event) {
34
- if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
48
+ if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents, opts.allowDescendants)) {
35
49
  return;
36
50
  }
37
51
  return originalMethod.call(this, event);
@@ -57,7 +71,7 @@ function EventFrom(tag, option = { ignoreNestedComponents: true }) {
57
71
  if (typeof originalFunction === 'function') {
58
72
  // Store original and add new behavior
59
73
  this[privateKey] = (event) => {
60
- if (!shouldProcessEvent(event, tag, this.host, option.ignoreNestedComponents)) {
74
+ if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents)) {
61
75
  return;
62
76
  }
63
77
  return originalFunction.call(this, event);
@@ -1,3 +1,3 @@
1
- const version = "10.0.0-next.48";
1
+ const version = "10.0.0-next.50";
2
2
 
3
3
  export { version as v };
@@ -9,7 +9,7 @@ import { d as defineCustomElement$3 } from './post-collapsible2.js';
9
9
  import { d as defineCustomElement$2 } from './post-collapsible-trigger2.js';
10
10
  import { d as defineCustomElement$1 } from './post-icon2.js';
11
11
 
12
- const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start-width:var(--post-accordion-button-border-top-width, var(--post-device-border-width-default));border-block-start-style:var(--post-core-border-style-solid);border-block-start-color:var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover,.accordion-button:focus-visible{color:Highlight}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
12
+ const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start-width:var(--post-device-border-width-default);border-block-start-style:var(--post-core-border-style-solid);border-block-start-color:var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover,.accordion-button:focus-visible{color:Highlight}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
13
13
 
14
14
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15
15
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -5,7 +5,7 @@ import { b as checkRequiredAndOneOf } from './index2.js';
5
5
  import './breakpoints.js';
6
6
  import { E as EventFrom } from './event-from.js';
7
7
 
8
- const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}::slotted(post-accordion-item:where(:only-of-type,:not(:first-of-type))){--post-accordion-button-border-top-width:0}";
8
+ const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}";
9
9
 
10
10
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
11
11
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;