@swisspost/design-system-components 10.0.0-next.38 → 10.0.0-next.40

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 (386) hide show
  1. package/dist/cjs/index-2b2b85e5.js +96 -0
  2. package/dist/cjs/index-b60129c4.js +2 -6
  3. package/dist/cjs/index.cjs.js +23 -29
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{package-3e61e6f3.js → package-b731881e.js} +1 -1
  6. package/dist/cjs/placement-b2bb6ec4.js +18 -0
  7. package/dist/cjs/post-accordion-item-5c879102.js +161 -0
  8. package/dist/cjs/post-accordion_2.cjs.entry.js +16 -0
  9. package/dist/cjs/{post-avatar-22bfd12e.js → post-avatar-4f1681df.js} +21 -4
  10. package/dist/cjs/post-avatar.cjs.entry.js +3 -4
  11. package/dist/cjs/{post-back-to-top-f682ea05.js → post-back-to-top-abbb4ac4.js} +8 -11
  12. package/dist/cjs/post-back-to-top.cjs.entry.js +3 -5
  13. package/dist/cjs/{post-banner-5c749a94.js → post-banner-4d99c51c.js} +12 -17
  14. package/dist/cjs/post-banner.cjs.entry.js +3 -8
  15. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -7
  16. package/dist/cjs/{post-breadcrumbs-76f55ae5.js → post-breadcrumbs-5ceabb10.js} +13 -7
  17. package/dist/cjs/post-breadcrumbs.cjs.entry.js +3 -3
  18. package/dist/cjs/{post-card-control-161a7102.js → post-card-control-b657aeaa.js} +42 -21
  19. package/dist/cjs/post-card-control.cjs.entry.js +3 -5
  20. package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -9
  21. package/dist/cjs/{post-collapsible-trigger-6cdf4481.js → post-collapsible-trigger-33f09d6c.js} +5 -8
  22. package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -8
  23. package/dist/cjs/post-components.cjs.js +1 -1
  24. package/dist/cjs/{post-footer-15d78645.js → post-footer-022cf408.js} +39 -11
  25. package/dist/cjs/post-footer.cjs.entry.js +3 -2
  26. package/dist/cjs/{post-linkarea-095d1928.js → post-linkarea-5fbb2e25.js} +2 -2
  27. package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
  28. package/dist/cjs/{post-menu-item-387e079b.js → post-menu-item-d4cc4742.js} +4 -4
  29. package/dist/cjs/{post-popover-388c8091.js → post-popover-b7cd0091.js} +20 -5
  30. package/dist/cjs/post-popover.cjs.entry.js +4 -2
  31. package/dist/cjs/{post-rating-246e4d89.js → post-rating-c81d1ac3.js} +29 -8
  32. package/dist/cjs/post-rating.cjs.entry.js +4 -2
  33. package/dist/cjs/{post-tab-header-0e9d0e06.js → post-tab-header-1db15093.js} +4 -4
  34. package/dist/cjs/post-tab-header.cjs.entry.js +3 -4
  35. package/dist/cjs/{post-tab-panel-f952714f.js → post-tab-panel-698981b8.js} +11 -2
  36. package/dist/cjs/post-tab-panel.cjs.entry.js +4 -2
  37. package/dist/cjs/{post-tabs-97c30d81.js → post-tabs-79eab811.js} +2 -2
  38. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  39. package/dist/cjs/{post-tag-58003cf0.js → post-tag-66a52727.js} +18 -5
  40. package/dist/cjs/post-tag.cjs.entry.js +4 -2
  41. package/dist/cjs/{post-togglebutton-87c984d8.js → post-togglebutton-a6b8b75d.js} +89 -92
  42. package/dist/cjs/{post-tooltip-28e7711a.js → post-tooltip-560cf42c.js} +11 -10
  43. package/dist/cjs/{post-tooltip-trigger-cbc53d14.js → post-tooltip-trigger-2a54e3e4.js} +6 -8
  44. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
  45. package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
  46. package/dist/collection/collection-manifest.json +1 -1
  47. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  48. package/dist/collection/components/post-accordion/post-accordion.js +7 -7
  49. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  50. package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -6
  51. package/dist/collection/components/post-avatar/post-avatar.js +25 -2
  52. package/dist/collection/components/post-back-to-top/post-back-to-top.js +8 -10
  53. package/dist/collection/components/post-banner/post-banner.js +13 -18
  54. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
  55. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +15 -7
  56. package/dist/collection/components/post-card-control/post-card-control.js +58 -33
  57. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  58. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  59. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +4 -5
  60. package/dist/collection/components/post-footer/post-footer.css +1 -1
  61. package/dist/collection/components/post-footer/post-footer.js +39 -8
  62. package/dist/collection/components/post-header/post-header.css +1 -1
  63. package/dist/collection/components/post-header/post-header.js +29 -54
  64. package/dist/collection/components/post-icon/post-icon.js +17 -37
  65. package/dist/collection/components/post-language-option/post-language-option.js +13 -13
  66. package/dist/collection/components/post-language-switch/post-language-switch.js +5 -5
  67. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  68. package/dist/collection/components/post-list/post-list.js +1 -1
  69. package/dist/collection/components/post-list-item/post-list-item.js +1 -1
  70. package/dist/collection/components/post-logo/post-logo.js +2 -2
  71. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  72. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  73. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  74. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  75. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
  76. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
  77. package/dist/collection/components/post-menu/post-menu.js +13 -2
  78. package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
  79. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
  80. package/dist/collection/components/post-popover/post-popover.js +21 -2
  81. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -4
  82. package/dist/collection/components/post-rating/post-rating.js +29 -2
  83. package/dist/collection/components/post-tab-header/post-tab-header.js +6 -11
  84. package/dist/collection/components/post-tab-panel/post-tab-panel.js +13 -2
  85. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  86. package/dist/collection/components/post-tag/post-tag.js +23 -11
  87. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -12
  88. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  89. package/dist/collection/components/post-tooltip/post-tooltip.js +12 -12
  90. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +5 -7
  91. package/dist/collection/types/index.js +2 -0
  92. package/dist/collection/types/placement.js +14 -0
  93. package/dist/collection/types/property-types.js +1 -0
  94. package/dist/collection/utils/is-value-empty.js +4 -0
  95. package/dist/collection/utils/property-checkers/check-one-of.js +3 -4
  96. package/dist/collection/utils/property-checkers/check-pattern.js +3 -4
  97. package/dist/collection/utils/property-checkers/check-type.js +4 -6
  98. package/dist/collection/utils/property-checkers/check-url.js +5 -5
  99. package/dist/collection/utils/property-checkers/constants.js +1 -1
  100. package/dist/collection/utils/property-checkers/empty-or.js +4 -6
  101. package/dist/collection/utils/property-checkers/index.js +6 -6
  102. package/dist/collection/utils/property-checkers/required-and.js +14 -0
  103. package/dist/components/index2.js +60 -19
  104. package/dist/components/package.js +1 -1
  105. package/dist/components/post-accordion-item2.js +6 -6
  106. package/dist/components/post-accordion2.js +8 -8
  107. package/dist/components/post-avatar2.js +24 -4
  108. package/dist/components/post-back-to-top2.js +9 -12
  109. package/dist/components/post-banner2.js +12 -18
  110. package/dist/components/post-breadcrumb-item2.js +2 -2
  111. package/dist/components/post-breadcrumbs2.js +14 -7
  112. package/dist/components/post-card-control2.js +41 -16
  113. package/dist/components/post-closebutton2.js +1 -1
  114. package/dist/components/post-collapsible-trigger2.js +3 -5
  115. package/dist/components/post-collapsible2.js +2 -2
  116. package/dist/components/post-footer2.js +46 -9
  117. package/dist/components/post-header2.js +31 -33
  118. package/dist/components/post-icon2.js +9 -25
  119. package/dist/components/post-language-option2.js +9 -10
  120. package/dist/components/post-language-switch2.js +4 -6
  121. package/dist/components/post-linkarea2.js +1 -1
  122. package/dist/components/post-list-item2.js +1 -1
  123. package/dist/components/post-list2.js +1 -1
  124. package/dist/components/post-logo2.js +2 -2
  125. package/dist/components/post-mainnavigation2.js +2 -2
  126. package/dist/components/post-megadropdown-trigger2.js +4 -4
  127. package/dist/components/post-megadropdown2.js +2 -2
  128. package/dist/components/post-menu-item2.js +1 -1
  129. package/dist/components/post-menu-trigger2.js +3 -3
  130. package/dist/components/post-menu2.js +12 -2
  131. package/dist/components/post-popover2.js +20 -3
  132. package/dist/components/post-popovercontainer2.js +37 -3
  133. package/dist/components/post-rating2.js +26 -1
  134. package/dist/components/post-tab-header2.js +3 -3
  135. package/dist/components/post-tab-panel2.js +12 -1
  136. package/dist/components/post-tabs2.js +1 -1
  137. package/dist/components/post-tag2.js +19 -5
  138. package/dist/components/post-togglebutton2.js +1 -12
  139. package/dist/components/post-tooltip-trigger2.js +5 -7
  140. package/dist/components/post-tooltip2.js +11 -11
  141. package/dist/components/switch-variants.js +3 -0
  142. package/dist/docs.json +49 -89
  143. package/dist/esm/index-f4d19816.js +2 -6
  144. package/dist/esm/index-ffccd040.js +88 -0
  145. package/dist/esm/index.js +22 -28
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/esm/package-9374eb90.js +3 -0
  148. package/dist/esm/placement-8d56605d.js +16 -0
  149. package/dist/esm/post-accordion-item-f416bd95.js +158 -0
  150. package/dist/esm/post-accordion_2.entry.js +7 -0
  151. package/dist/esm/{post-avatar-639dc17a.js → post-avatar-2cb5190b.js} +21 -4
  152. package/dist/esm/post-avatar.entry.js +3 -4
  153. package/dist/esm/{post-back-to-top-8099279e.js → post-back-to-top-f877d4c6.js} +8 -11
  154. package/dist/esm/post-back-to-top.entry.js +3 -5
  155. package/dist/esm/{post-banner-54834fbf.js → post-banner-576a5adb.js} +12 -17
  156. package/dist/esm/post-banner.entry.js +3 -8
  157. package/dist/esm/post-breadcrumb-item_2.entry.js +3 -7
  158. package/dist/esm/{post-breadcrumbs-caf56014.js → post-breadcrumbs-63223336.js} +13 -7
  159. package/dist/esm/post-breadcrumbs.entry.js +3 -3
  160. package/dist/esm/{post-card-control-b063586b.js → post-card-control-2eebe7b4.js} +37 -16
  161. package/dist/esm/post-card-control.entry.js +3 -5
  162. package/dist/esm/post-closebutton_15.entry.js +5 -9
  163. package/dist/esm/{post-collapsible-trigger-727bcde1.js → post-collapsible-trigger-561df34e.js} +5 -8
  164. package/dist/esm/post-collapsible_2.entry.js +3 -8
  165. package/dist/esm/post-components.js +1 -1
  166. package/dist/esm/{post-footer-16f1a8de.js → post-footer-a270f67b.js} +36 -8
  167. package/dist/esm/post-footer.entry.js +3 -2
  168. package/dist/esm/{post-linkarea-4e4228fb.js → post-linkarea-456ce63d.js} +2 -2
  169. package/dist/esm/post-linkarea.entry.js +2 -2
  170. package/dist/esm/{post-menu-item-e9dd8173.js → post-menu-item-e051284c.js} +4 -4
  171. package/dist/esm/{post-popover-46ede6b5.js → post-popover-7c3c9072.js} +17 -2
  172. package/dist/esm/post-popover.entry.js +4 -2
  173. package/dist/esm/{post-rating-8d0d970b.js → post-rating-2c9dd11f.js} +23 -2
  174. package/dist/esm/post-rating.entry.js +4 -2
  175. package/dist/esm/{post-tab-header-8224c7c2.js → post-tab-header-f90b2f93.js} +4 -4
  176. package/dist/esm/post-tab-header.entry.js +3 -4
  177. package/dist/esm/{post-tab-panel-dfdeccd3.js → post-tab-panel-c19b5e30.js} +11 -2
  178. package/dist/esm/post-tab-panel.entry.js +4 -2
  179. package/dist/esm/{post-tabs-fabd0569.js → post-tabs-0dadedf2.js} +2 -2
  180. package/dist/esm/post-tabs.entry.js +2 -2
  181. package/dist/esm/{post-tag-13994238.js → post-tag-b8be3b0c.js} +18 -5
  182. package/dist/esm/post-tag.entry.js +4 -2
  183. package/dist/esm/{post-togglebutton-87967c5b.js → post-togglebutton-83339cc9.js} +89 -92
  184. package/dist/esm/{post-tooltip-eecaa4c7.js → post-tooltip-3cc82984.js} +11 -10
  185. package/dist/esm/{post-tooltip-trigger-642cbb22.js → post-tooltip-trigger-898c3dbc.js} +6 -8
  186. package/dist/esm/post-tooltip-trigger.entry.js +3 -3
  187. package/dist/esm/post-tooltip.entry.js +4 -3
  188. package/dist/post-components/index.esm.js +1 -1
  189. package/dist/post-components/p-104ddc50.js +1 -0
  190. package/dist/post-components/p-13b41e32.entry.js +1 -0
  191. package/dist/post-components/p-1906d77c.js +1 -0
  192. package/dist/post-components/p-19d0e6ea.entry.js +1 -0
  193. package/dist/post-components/p-1b9afb34.entry.js +1 -0
  194. package/dist/post-components/{p-a07f85ee.js → p-1fbffc90.js} +1 -1
  195. package/dist/post-components/p-234925fa.js +1 -0
  196. package/dist/post-components/p-23fb976f.entry.js +1 -0
  197. package/dist/post-components/p-24c42ebe.entry.js +1 -0
  198. package/dist/post-components/{p-19317b15.js → p-28c19671.js} +2 -2
  199. package/dist/post-components/p-37aaa30f.js +1 -0
  200. package/dist/post-components/p-3baf0b40.entry.js +1 -0
  201. package/dist/post-components/p-4390192f.js +1 -0
  202. package/dist/post-components/p-4a071696.js +1 -0
  203. package/dist/post-components/p-4c2d5072.js +1 -0
  204. package/dist/post-components/p-51b6114c.entry.js +1 -0
  205. package/dist/post-components/p-59a38c23.js +1 -0
  206. package/dist/post-components/p-5fb4fc65.js +1 -0
  207. package/dist/post-components/p-64c13aaf.entry.js +1 -0
  208. package/dist/post-components/p-66679f9d.entry.js +1 -0
  209. package/dist/post-components/p-68a98f0b.js +1 -0
  210. package/dist/post-components/{p-692ba59d.js → p-6a4dc55e.js} +1 -1
  211. package/dist/post-components/p-789f9a23.entry.js +1 -0
  212. package/dist/post-components/p-7e6eae42.js +1 -0
  213. package/dist/post-components/p-8117dd0c.js +1 -0
  214. package/dist/post-components/p-814c0c4d.entry.js +1 -0
  215. package/dist/post-components/p-87e0d6fa.js +1 -0
  216. package/dist/post-components/p-988d20f4.js +1 -0
  217. package/dist/post-components/p-9b1e4e52.entry.js +1 -0
  218. package/dist/post-components/p-ab44a18c.entry.js +1 -0
  219. package/dist/post-components/p-b176309b.js +1 -0
  220. package/dist/post-components/p-b2952b0e.entry.js +1 -0
  221. package/dist/post-components/p-c10b2a2f.js +1 -0
  222. package/dist/post-components/{p-0dcd25ab.js → p-c80cb846.js} +1 -1
  223. package/dist/post-components/p-da4704c1.js +1 -0
  224. package/dist/post-components/p-dc4de84a.entry.js +1 -0
  225. package/dist/post-components/p-f1f0ace3.entry.js +1 -0
  226. package/dist/post-components/p-f34fb6c4.entry.js +1 -0
  227. package/dist/post-components/p-f6f914bb.js +1 -0
  228. package/dist/post-components/p-fe7e64cf.entry.js +1 -0
  229. package/dist/post-components/p-fee94252.entry.js +1 -0
  230. package/dist/post-components/post-components.css +1 -0
  231. package/dist/post-components/post-components.esm.js +1 -1
  232. package/dist/prebuild.js +26 -0
  233. package/dist/types/components/post-accordion/post-accordion.d.ts +2 -1
  234. package/dist/types/components/post-avatar/post-avatar.d.ts +3 -0
  235. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +1 -1
  236. package/dist/types/components/post-banner/post-banner.d.ts +3 -4
  237. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +2 -1
  238. package/dist/types/components/post-card-control/post-card-control.d.ts +10 -6
  239. package/dist/types/components/post-footer/post-footer.d.ts +8 -2
  240. package/dist/types/components/post-header/post-header.d.ts +5 -9
  241. package/dist/types/components/post-icon/post-icon.d.ts +5 -7
  242. package/dist/types/components/post-language-option/post-language-option.d.ts +5 -5
  243. package/dist/types/components/post-logo/post-logo.d.ts +1 -1
  244. package/dist/types/components/post-menu/post-menu.d.ts +1 -0
  245. package/dist/types/components/post-popover/post-popover.d.ts +2 -0
  246. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +3 -0
  247. package/dist/types/components/post-rating/post-rating.d.ts +4 -0
  248. package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
  249. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -0
  250. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  251. package/dist/types/components/post-tag/post-tag.d.ts +5 -3
  252. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -1
  253. package/dist/types/components/post-tooltip/post-tooltip.d.ts +3 -3
  254. package/dist/types/components.d.ts +38 -59
  255. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +1 -0
  256. package/dist/types/index.d.ts +2 -2
  257. package/dist/types/types/index.d.ts +2 -0
  258. package/dist/types/types/placement.d.ts +1 -0
  259. package/dist/types/types/property-types.d.ts +1 -0
  260. package/dist/types/utils/is-value-empty.d.ts +1 -0
  261. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
  262. package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -1
  263. package/dist/types/utils/property-checkers/check-type.d.ts +2 -2
  264. package/dist/types/utils/property-checkers/check-url.d.ts +1 -1
  265. package/dist/types/utils/property-checkers/constants.d.ts +1 -1
  266. package/dist/types/utils/property-checkers/empty-or.d.ts +3 -1
  267. package/dist/types/utils/property-checkers/index.d.ts +16 -9
  268. package/dist/types/utils/property-checkers/required-and.d.ts +3 -0
  269. package/loaders/index2.js +60 -19
  270. package/loaders/package.js +1 -1
  271. package/loaders/post-accordion-item2.js +6 -6
  272. package/loaders/post-accordion.js +1 -124
  273. package/{dist/esm/post-accordion-03796d13.js → loaders/post-accordion2.js} +43 -20
  274. package/loaders/post-avatar.js +24 -4
  275. package/loaders/post-back-to-top.js +9 -12
  276. package/loaders/post-banner.js +12 -18
  277. package/loaders/post-breadcrumb-item2.js +2 -2
  278. package/loaders/post-breadcrumbs.js +14 -7
  279. package/loaders/post-card-control.js +41 -16
  280. package/loaders/post-closebutton.js +1 -1
  281. package/loaders/post-collapsible-trigger2.js +3 -5
  282. package/loaders/post-collapsible2.js +2 -2
  283. package/loaders/post-footer.js +46 -9
  284. package/loaders/post-header.js +31 -33
  285. package/loaders/post-icon2.js +9 -25
  286. package/loaders/post-language-option.js +9 -10
  287. package/loaders/post-language-switch.js +4 -6
  288. package/loaders/post-linkarea.js +1 -1
  289. package/loaders/post-list-item.js +1 -1
  290. package/loaders/post-list.js +1 -1
  291. package/loaders/post-logo.js +2 -2
  292. package/loaders/post-mainnavigation.js +2 -2
  293. package/loaders/post-megadropdown-trigger.js +4 -4
  294. package/loaders/post-megadropdown.js +2 -2
  295. package/loaders/post-menu-item2.js +1 -1
  296. package/loaders/post-menu-trigger2.js +3 -3
  297. package/loaders/post-menu2.js +12 -2
  298. package/loaders/post-popover.js +20 -3
  299. package/loaders/post-popovercontainer.js +1 -1
  300. package/loaders/post-popovercontainer2.js +37 -3
  301. package/loaders/post-rating.js +26 -1
  302. package/loaders/post-tab-header.js +3 -3
  303. package/loaders/post-tab-panel.js +12 -1
  304. package/loaders/post-tabs.js +1 -1
  305. package/loaders/post-tag.js +19 -5
  306. package/loaders/post-togglebutton.js +1 -12
  307. package/loaders/post-tooltip-trigger.js +5 -7
  308. package/loaders/post-tooltip.js +11 -11
  309. package/loaders/switch-variants.js +3 -0
  310. package/package.json +19 -9
  311. package/dist/cjs/check-non-empty-bd99d236.js +0 -15
  312. package/dist/cjs/check-one-of-75d270b5.js +0 -13
  313. package/dist/cjs/check-type-cdbf6d29.js +0 -21
  314. package/dist/cjs/check-url-220a286c.js +0 -19
  315. package/dist/cjs/constants-238701d3.js +0 -5
  316. package/dist/cjs/heading-levels-608d432e.js +0 -5
  317. package/dist/cjs/index-23e36ff7.js +0 -37
  318. package/dist/cjs/post-accordion-e54524be.js +0 -105
  319. package/dist/cjs/post-accordion-item-86f11a16.js +0 -64
  320. package/dist/cjs/post-accordion-item.cjs.entry.js +0 -20
  321. package/dist/cjs/post-accordion.cjs.entry.js +0 -15
  322. package/dist/collection/utils/property-checkers/check-non-empty.js +0 -10
  323. package/dist/components/check-non-empty.js +0 -13
  324. package/dist/components/check-one-of.js +0 -11
  325. package/dist/components/check-type.js +0 -19
  326. package/dist/components/constants.js +0 -3
  327. package/dist/esm/check-non-empty-258a56b3.js +0 -13
  328. package/dist/esm/check-one-of-0bee20f5.js +0 -11
  329. package/dist/esm/check-type-37d5d307.js +0 -19
  330. package/dist/esm/check-url-17962bc8.js +0 -17
  331. package/dist/esm/constants-8d548297.js +0 -3
  332. package/dist/esm/heading-levels-5b7b4349.js +0 -3
  333. package/dist/esm/index-8f8fe5b0.js +0 -32
  334. package/dist/esm/package-33ac2576.js +0 -3
  335. package/dist/esm/post-accordion-item-d29c49e5.js +0 -62
  336. package/dist/esm/post-accordion-item.entry.js +0 -12
  337. package/dist/esm/post-accordion.entry.js +0 -7
  338. package/dist/post-components/p-0539071d.js +0 -1
  339. package/dist/post-components/p-181c73d5.js +0 -1
  340. package/dist/post-components/p-1ef9415b.js +0 -1
  341. package/dist/post-components/p-247a1668.js +0 -1
  342. package/dist/post-components/p-24d0695f.entry.js +0 -1
  343. package/dist/post-components/p-2e50a07d.entry.js +0 -1
  344. package/dist/post-components/p-30eb4d87.js +0 -1
  345. package/dist/post-components/p-440193f4.js +0 -1
  346. package/dist/post-components/p-46008c18.entry.js +0 -1
  347. package/dist/post-components/p-47ab2c2b.entry.js +0 -1
  348. package/dist/post-components/p-4c049de0.entry.js +0 -1
  349. package/dist/post-components/p-4c4acc32.entry.js +0 -1
  350. package/dist/post-components/p-5d473fcd.js +0 -1
  351. package/dist/post-components/p-5d539b30.js +0 -1
  352. package/dist/post-components/p-6783e509.entry.js +0 -1
  353. package/dist/post-components/p-6933fb57.entry.js +0 -1
  354. package/dist/post-components/p-72197a6b.js +0 -1
  355. package/dist/post-components/p-7709c14a.js +0 -1
  356. package/dist/post-components/p-77910344.entry.js +0 -1
  357. package/dist/post-components/p-80e5100e.entry.js +0 -1
  358. package/dist/post-components/p-84fbf49c.js +0 -1
  359. package/dist/post-components/p-85fdc2d3.js +0 -1
  360. package/dist/post-components/p-8c09291c.js +0 -1
  361. package/dist/post-components/p-93da1a5f.js +0 -1
  362. package/dist/post-components/p-9b8ee310.entry.js +0 -1
  363. package/dist/post-components/p-9efb84d3.entry.js +0 -1
  364. package/dist/post-components/p-9fbf2f82.entry.js +0 -1
  365. package/dist/post-components/p-a25019de.js +0 -1
  366. package/dist/post-components/p-a710ee00.js +0 -1
  367. package/dist/post-components/p-b94e5b4d.entry.js +0 -1
  368. package/dist/post-components/p-c2348d3d.js +0 -1
  369. package/dist/post-components/p-c6b03446.entry.js +0 -1
  370. package/dist/post-components/p-d0dfd5f9.js +0 -1
  371. package/dist/post-components/p-d45df336.js +0 -1
  372. package/dist/post-components/p-d4890d50.entry.js +0 -1
  373. package/dist/post-components/p-d5210531.entry.js +0 -1
  374. package/dist/post-components/p-dd39c542.entry.js +0 -1
  375. package/dist/post-components/p-df6c8a4c.js +0 -1
  376. package/dist/post-components/p-e068a41e.js +0 -1
  377. package/dist/post-components/p-e585c6fe.js +0 -1
  378. package/dist/post-components/p-f2c4a48d.js +0 -1
  379. package/dist/post-components/p-f31b9b5d.entry.js +0 -1
  380. package/dist/post-components/p-f58252d5.entry.js +0 -1
  381. package/dist/post-components/p-fda767f0.js +0 -1
  382. package/dist/types/utils/property-checkers/check-non-empty.d.ts +0 -3
  383. package/loaders/check-non-empty.js +0 -13
  384. package/loaders/check-one-of.js +0 -11
  385. package/loaders/check-type.js +0 -19
  386. package/loaders/constants.js +0 -3
@@ -1,7 +1,8 @@
1
- import { Host, h } from "@stencil/core";
2
- import { IS_BROWSER } from "../../utils/index";
1
+ import { Host, h, } from "@stencil/core";
2
+ import { IS_BROWSER, checkEmptyOrOneOf, checkEmptyOrType } from "../../utils/index";
3
3
  import { version } from "../../../../package";
4
4
  import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
5
+ import { PLACEMENT_TYPES } from "../../types/index";
5
6
  // Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
6
7
  import { apply, isSupported } from "@oddbird/popover-polyfill/dist/popover-fn.js";
7
8
  /**
@@ -16,6 +17,15 @@ export class PostPopovercontainer {
16
17
  this.manualClose = false;
17
18
  this.safeSpace = undefined;
18
19
  }
20
+ validatePlacement() {
21
+ checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
22
+ }
23
+ validateEdgeGap() {
24
+ checkEmptyOrType(this, 'edgeGap', 'number');
25
+ }
26
+ validateSafeSpace() {
27
+ checkEmptyOrOneOf(this, 'safeSpace', ['triangle', 'trapezoid']);
28
+ }
19
29
  /**
20
30
  * Updates cursor position for safe space feature when popover is open.
21
31
  * Sets CSS custom properties for dynamic styling of safe area.
@@ -225,9 +235,9 @@ export class PostPopovercontainer {
225
235
  }
226
236
  render() {
227
237
  const animationClass = this.animation ? `animate-${this.animation}` : '';
228
- return (h(Host, { key: '980c2d7531ef77f71ea51b069dc20bbf40cd0ac4', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: '9fa08070a5e7f864aade0dc1afc2917e54693109', class: animationClass }, this.arrow && (h("span", { key: '4700f55c721387f2d918214309e87c9057e4831f', class: "arrow", ref: el => {
238
+ return (h(Host, { key: 'c5f30bf3c07bbc6af797368b4951c9a1b5d596ef', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: 'afae0976b169831fe49df860d44cd80fa0ae0b3a', class: animationClass }, this.arrow && (h("span", { key: '08e89fda623b139c1b1fba283a9d508757cd1b3d', class: "arrow", ref: el => {
229
239
  this.arrowRef = el;
230
- } })), h("slot", { key: 'ec5304bc77d4f3eb91c79fb2a37d096b4d43b888' }))));
240
+ } })), h("slot", { key: 'fa3f48c319dca350cbd456f2daf8ab5975b99d8f' }))));
231
241
  }
232
242
  static get is() { return "post-popovercontainer"; }
233
243
  static get originalStyleUrls() {
@@ -460,6 +470,18 @@ export class PostPopovercontainer {
460
470
  };
461
471
  }
462
472
  static get elementRef() { return "host"; }
473
+ static get watchers() {
474
+ return [{
475
+ "propName": "placement",
476
+ "methodName": "validatePlacement"
477
+ }, {
478
+ "propName": "edgeGap",
479
+ "methodName": "validateEdgeGap"
480
+ }, {
481
+ "propName": "safeSpace",
482
+ "methodName": "validateSafeSpace"
483
+ }];
484
+ }
463
485
  }
464
486
  PostPopovercontainer.STATIC_SIDES = {
465
487
  top: 'bottom',
@@ -1,6 +1,21 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
+ import { checkRequiredAndType } from "../../utils/index";
3
4
  export class PostRating {
5
+ validateLabel() {
6
+ checkRequiredAndType(this, 'label', 'string');
7
+ }
8
+ validateStars() {
9
+ checkRequiredAndType(this, 'stars', 'number');
10
+ }
11
+ validateCurrentRating() {
12
+ checkRequiredAndType(this, 'currentRating', 'number');
13
+ }
14
+ componentWillLoad() {
15
+ this.validateLabel();
16
+ this.validateStars();
17
+ this.validateCurrentRating();
18
+ }
4
19
  constructor() {
5
20
  this.hasChanged = false;
6
21
  this.hoveredIndex = undefined;
@@ -64,7 +79,7 @@ export class PostRating {
64
79
  }
65
80
  }
66
81
  render() {
67
- return (h(Host, { key: '4ccdf384b9a4cfc462d5d3f4a7caab659b6ba2b0', "data-version": version }, h("div", { key: '7ab53083bcdff6586b1de7f1c9e5fa546728fc6f', 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: {
82
+ 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: {
68
83
  'star': true,
69
84
  'before-hover': i < this.hoveredIndex,
70
85
  'active': i < Math.round(this.currentRating),
@@ -199,4 +214,16 @@ export class PostRating {
199
214
  }];
200
215
  }
201
216
  static get elementRef() { return "host"; }
217
+ static get watchers() {
218
+ return [{
219
+ "propName": "label",
220
+ "methodName": "validateLabel"
221
+ }, {
222
+ "propName": "stars",
223
+ "methodName": "validateStars"
224
+ }, {
225
+ "propName": "currentRating",
226
+ "methodName": "validateCurrentRating"
227
+ }];
228
+ }
202
229
  }
@@ -1,6 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
- import { checkNonEmpty } from "../../utils/index";
3
+ import { checkRequiredAndType } from "../../utils/index";
4
4
  import { nanoid } from "nanoid";
5
5
  /**
6
6
  * @slot default - Slot for the content of the tab header.
@@ -11,13 +11,13 @@ export class PostTabHeader {
11
11
  this.panel = undefined;
12
12
  }
13
13
  validateFor() {
14
- checkNonEmpty(this, 'panel');
14
+ checkRequiredAndType(this, 'panel', 'string');
15
15
  }
16
16
  componentWillLoad() {
17
17
  this.tabId = `tab-${this.host.id || nanoid(6)}`;
18
18
  }
19
19
  render() {
20
- return (h(Host, { key: '5046c46fa27fd6586c694420abf197b227b56520', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '78c2f660e4f2307ca95a63f4cfd90d08cc6942df' })));
20
+ return (h(Host, { key: '829043a1f87aef4e965e3f830cc29eca5ed13864', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: 'c1d6a7d9120b494e898a502eac31341d7fc8d87b' })));
21
21
  }
22
22
  static get is() { return "post-tab-header"; }
23
23
  static get encapsulation() { return "shadow"; }
@@ -37,16 +37,11 @@ export class PostTabHeader {
37
37
  "type": "string",
38
38
  "mutable": false,
39
39
  "complexType": {
40
- "original": "HTMLPostTabPanelElement['name']",
40
+ "original": "string",
41
41
  "resolved": "string",
42
- "references": {
43
- "HTMLPostTabPanelElement": {
44
- "location": "global",
45
- "id": "global::HTMLPostTabPanelElement"
46
- }
47
- }
42
+ "references": {}
48
43
  },
49
- "required": false,
44
+ "required": true,
50
45
  "optional": false,
51
46
  "docs": {
52
47
  "tags": [],
@@ -1,6 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
3
  import { nanoid } from "nanoid";
4
+ import { checkRequiredAndType } from "../../utils/index";
4
5
  /**
5
6
  * @slot default - Slot for placing the content of the tab panel.
6
7
  */
@@ -9,12 +10,16 @@ export class PostTabPanel {
9
10
  this.panelId = undefined;
10
11
  this.name = undefined;
11
12
  }
13
+ validateName() {
14
+ checkRequiredAndType(this, 'name', 'string');
15
+ }
12
16
  componentWillLoad() {
17
+ this.validateName();
13
18
  // get the id set on the host element or use a random id by default
14
19
  this.panelId = `panel-${this.host.id || nanoid(6)}`;
15
20
  }
16
21
  render() {
17
- return (h(Host, { key: '98427b35c6637af65930b69b75ea56facf044000', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '4fa02667e8ff088c10122e010cfd7efe8ff3af57' })));
22
+ return (h(Host, { key: '366d1b6074bf4212e7fc56500680ed12d8d83599', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '940f8dcf9e1302dfdd1c859e356799a2f2c7fe54' })));
18
23
  }
19
24
  static get is() { return "post-tab-panel"; }
20
25
  static get encapsulation() { return "shadow"; }
@@ -38,7 +43,7 @@ export class PostTabPanel {
38
43
  "resolved": "string",
39
44
  "references": {}
40
45
  },
41
- "required": false,
46
+ "required": true,
42
47
  "optional": false,
43
48
  "docs": {
44
49
  "tags": [],
@@ -55,4 +60,10 @@ export class PostTabPanel {
55
60
  };
56
61
  }
57
62
  static get elementRef() { return "host"; }
63
+ static get watchers() {
64
+ return [{
65
+ "propName": "name",
66
+ "methodName": "validateName"
67
+ }];
68
+ }
58
69
  }
@@ -141,7 +141,7 @@ export class PostTabs {
141
141
  nextTab.focus();
142
142
  }
143
143
  render() {
144
- return (h(Host, { key: 'dae24eee55a75f9b825f590883a9c1e896c1e9fc', "data-version": version }, h("div", { key: '0a26de80b8267ddc30455b0b5afbf10ae521232b', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '826cb0a4355eeb5ddc07288e1e68fc72785c095f', class: "tabs", role: "tablist" }, h("slot", { key: '94ce90bc3dc8ff4b5012fcfa3c0039b188c14002', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '462f80f3368431344910cc317f1c0f42112dc99a', class: "tab-content", part: "content" }, h("slot", { key: '57a80ac790ca75f3b62382994c21a3a3c78004cc', onSlotchange: () => this.moveMisplacedTabs() }))));
144
+ return (h(Host, { key: '621652f2abeb8162e2d67261c57000a9d6e7b4ca', "data-version": version }, h("div", { key: '9cf2693b826588d3f099d30157886f70c34aa8b7', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '4d4a0f242a30ec484c4557880b4c184b47d74612', class: "tabs", role: "tablist" }, h("slot", { key: '44df627213090710a6171fae2b1b8698e1f68fa5', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: 'ec23dfe409569899a3b95cf3e2cd6fe2deae8c9b', class: "tab-content", part: "content" }, h("slot", { key: '16374ab8fae907d5d2c7229069dd7511f118c3ac', onSlotchange: () => this.moveMisplacedTabs() }))));
145
145
  }
146
146
  static get is() { return "post-tabs"; }
147
147
  static get encapsulation() { return "shadow"; }
@@ -171,7 +171,7 @@ export class PostTabs {
171
171
  }
172
172
  },
173
173
  "required": false,
174
- "optional": false,
174
+ "optional": true,
175
175
  "docs": {
176
176
  "tags": [],
177
177
  "text": "The name of the panel that is initially shown.\nIf not specified, it defaults to the panel associated with the first tab.\n\n**Changing this value after initialization has no effect.**"
@@ -1,5 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
+ import { checkEmptyOrOneOf, checkEmptyOrType } from "../../utils/index";
3
4
  /**
4
5
  * @slot default - Content to place in the `default` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content">inline content</a>.</p>
5
6
  */
@@ -7,16 +8,21 @@ export class PostTag {
7
8
  constructor() {
8
9
  this.classes = undefined;
9
10
  this.variant = undefined;
10
- this.size = null;
11
- this.icon = null;
11
+ this.size = undefined;
12
+ this.icon = undefined;
12
13
  this.setClasses = this.setClasses.bind(this);
13
14
  }
14
15
  variantChanged() {
16
+ checkEmptyOrOneOf(this, 'variant', ['white', 'info', 'success', 'error', 'warning', 'yellow']);
15
17
  this.setClasses();
16
18
  }
17
19
  sizeChanged() {
20
+ checkEmptyOrOneOf(this, 'size', ['sm']);
18
21
  this.setClasses();
19
22
  }
23
+ validateName() {
24
+ checkEmptyOrType(this, 'icon', 'string');
25
+ }
20
26
  setClasses() {
21
27
  this.classes = [
22
28
  'tag',
@@ -26,11 +32,16 @@ export class PostTag {
26
32
  .filter(c => c !== null)
27
33
  .join(' ');
28
34
  }
35
+ componentWillLoad() {
36
+ this.validateName();
37
+ this.variantChanged();
38
+ this.sizeChanged();
39
+ }
29
40
  connectedCallback() {
30
41
  this.setClasses();
31
42
  }
32
43
  render() {
33
- return (h(Host, { key: '4ca273166b81099dd8fc0f69d3d38215e3d7ccbc', "data-version": version }, h("div", { key: 'b6c4eb6a3bf8cbaad18cf6277dab79bd6e350f0a', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '4f9e8cf6b2c723e31d60e30464c1106a9f72b5b4', class: "tag-text" }, h("slot", { key: '819a4e6ff743386f8d5d6b1d94dea9ee4a612784' })))));
44
+ return (h(Host, { key: '42743d0a7f87680223eef33ff9295827f3c80d4c', "data-version": version }, h("div", { key: '392ad72b23f638d7fdefe7acb20f45c9dcf2d630', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '71b7dc696dd392dc9b195b363cd79a1fc0e0a708', class: "tag-text" }, h("slot", { key: '91610aff7550df9891fb617d2d9e5bcbcffbe256' })))));
34
45
  }
35
46
  static get is() { return "post-tag"; }
36
47
  static get encapsulation() { return "shadow"; }
@@ -55,7 +66,7 @@ export class PostTag {
55
66
  "references": {}
56
67
  },
57
68
  "required": false,
58
- "optional": false,
69
+ "optional": true,
59
70
  "docs": {
60
71
  "tags": [],
61
72
  "text": "Defines the color variant of the component."
@@ -67,25 +78,24 @@ export class PostTag {
67
78
  "type": "string",
68
79
  "mutable": false,
69
80
  "complexType": {
70
- "original": "null | 'sm'",
81
+ "original": "'sm'",
71
82
  "resolved": "\"sm\"",
72
83
  "references": {}
73
84
  },
74
85
  "required": false,
75
- "optional": false,
86
+ "optional": true,
76
87
  "docs": {
77
88
  "tags": [],
78
89
  "text": "Defines the size of the component."
79
90
  },
80
91
  "attribute": "size",
81
- "reflect": false,
82
- "defaultValue": "null"
92
+ "reflect": false
83
93
  },
84
94
  "icon": {
85
95
  "type": "string",
86
96
  "mutable": false,
87
97
  "complexType": {
88
- "original": "null | string",
98
+ "original": "string",
89
99
  "resolved": "string",
90
100
  "references": {}
91
101
  },
@@ -96,8 +106,7 @@ export class PostTag {
96
106
  "text": "Defines the icon `name` inside of the component.\n<span className=\"banner banner-sm banner-info\">If not set the icon will not show up.</span>\nTo learn which icons are available, please visit our <a href=\"/?path=/docs/0dcfe3c0-bfc0-4107-b43b-7e9d825b805f--docs\">icon library</a>."
97
107
  },
98
108
  "attribute": "icon",
99
- "reflect": false,
100
- "defaultValue": "null"
109
+ "reflect": false
101
110
  }
102
111
  };
103
112
  }
@@ -114,6 +123,9 @@ export class PostTag {
114
123
  }, {
115
124
  "propName": "size",
116
125
  "methodName": "sizeChanged"
126
+ }, {
127
+ "propName": "icon",
128
+ "methodName": "validateName"
117
129
  }];
118
130
  }
119
131
  }
@@ -1,6 +1,5 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
- import { checkType } from "../../utils/index";
4
3
  /**
5
4
  * @slot default - Slot for the content of the button.
6
5
  */
@@ -18,17 +17,13 @@ export class PostTogglebutton {
18
17
  };
19
18
  this.toggled = false;
20
19
  }
21
- validateToggled() {
22
- checkType(this, 'toggled', 'boolean');
23
- }
24
20
  componentWillLoad() {
25
- this.validateToggled();
26
21
  // add event listener to not override listener that might be set on the host
27
22
  this.host.addEventListener('click', () => this.handleClick());
28
23
  this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
29
24
  }
30
25
  render() {
31
- return (h(Host, { key: '3a1429a9b67b8cfafae184fe0d060ee3a04974e0', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9ab1537574423740fc335fde732c699698acac25' })));
26
+ return (h(Host, { key: '1025fb988460e85c92e49241889363e1bcc840eb', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '20d3eb9415685fb9a00a5613474c432f6638692e' })));
32
27
  }
33
28
  static get is() { return "post-togglebutton"; }
34
29
  static get encapsulation() { return "shadow"; }
@@ -65,10 +60,4 @@ export class PostTogglebutton {
65
60
  };
66
61
  }
67
62
  static get elementRef() { return "host"; }
68
- static get watchers() {
69
- return [{
70
- "propName": "toggled",
71
- "methodName": "validateToggled"
72
- }];
73
- }
74
63
  }
@@ -1 +1 @@
1
- :host{display:none}:host([open]){display:block}post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer>div{padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:200px;min-height:32px}
1
+ :host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer>div{padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:280px;min-height:32px;word-wrap:break-word;white-space:normal}
@@ -1,18 +1,19 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
- import { checkType } from "../../utils/index";
3
+ import { checkEmptyOrOneOf } from "../../utils/index";
4
+ import { PLACEMENT_TYPES } from "../../types/index";
4
5
  export class PostTooltip {
5
6
  constructor() {
6
7
  this.placement = 'top';
7
8
  this.arrow = false;
8
- this.animation = null;
9
+ this.animation = undefined;
9
10
  this.open = false;
10
11
  }
11
- validateOpen() {
12
- checkType(this, 'open', 'boolean', 'The "open" property of the post-tooltip must be a boolean.');
12
+ validatePlacement() {
13
+ checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
13
14
  }
14
- connectedCallback() {
15
- this.validateOpen();
15
+ componentWillLoad() {
16
+ this.validatePlacement();
16
17
  }
17
18
  componentDidLoad() {
18
19
  if (!this.host.id) {
@@ -53,7 +54,7 @@ export class PostTooltip {
53
54
  }
54
55
  render() {
55
56
  const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
56
- return (h(Host, { key: 'd6a76533f22e354ff89f15c1e9a10e20fe471579', "data-version": version, role: "tooltip" }, h("post-popovercontainer", { key: '60076aaa184ae98e9e813400cc2d03f5add274df', safeSpace: 'trapezoid', class: popoverClass, arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '1d5ea42696cc60a8a84ff0ecc29e82152d028ba4' }))));
57
+ return (h(Host, { key: '1e1d3f4e204b42c8202af63bd7dec12de3c8e16a', "data-version": version, role: "tooltip" }, h("post-popovercontainer", { key: 'e410952b4e75915e51d57eec2dbecce2b5d55733', safeSpace: "trapezoid", class: popoverClass, arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '494e3136dbe96cf611a41753711efb03cab30a12' }))));
57
58
  }
58
59
  static get is() { return "post-tooltip"; }
59
60
  static get encapsulation() { return "shadow"; }
@@ -115,7 +116,7 @@ export class PostTooltip {
115
116
  "type": "string",
116
117
  "mutable": false,
117
118
  "complexType": {
118
- "original": "'pop-in' | null",
119
+ "original": "'pop-in'",
119
120
  "resolved": "\"pop-in\"",
120
121
  "references": {}
121
122
  },
@@ -126,8 +127,7 @@ export class PostTooltip {
126
127
  "text": "Choose a tooltip animation"
127
128
  },
128
129
  "attribute": "animation",
129
- "reflect": false,
130
- "defaultValue": "null"
130
+ "reflect": false
131
131
  },
132
132
  "open": {
133
133
  "type": "boolean",
@@ -236,8 +236,8 @@ export class PostTooltip {
236
236
  static get elementRef() { return "host"; }
237
237
  static get watchers() {
238
238
  return [{
239
- "propName": "open",
240
- "methodName": "validateOpen"
239
+ "propName": "placement",
240
+ "methodName": "validatePlacement"
241
241
  }];
242
242
  }
243
243
  }
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { checkType, IS_BROWSER } from "../../utils/index";
2
+ import { checkEmptyOrType, IS_BROWSER } from "../../utils/index";
3
3
  import { version } from "../../../../package";
4
4
  import isFocusable from "ally.js/is/focusable";
5
5
  const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
@@ -27,15 +27,13 @@ export class PostTooltipTrigger {
27
27
  this.boundTooltipHandler = this.handleTooltipEvent.bind(this);
28
28
  }
29
29
  validateControlFor() {
30
- checkType(this, 'for', 'string');
30
+ checkEmptyOrType(this, 'for', 'string');
31
31
  }
32
32
  get tooltip() {
33
33
  if (!IS_BROWSER)
34
34
  return null;
35
35
  const ref = document.getElementById(this.for);
36
- return ref?.localName === 'post-tooltip'
37
- ? ref
38
- : null;
36
+ return ref?.localName === 'post-tooltip' ? ref : null;
39
37
  }
40
38
  componentDidLoad() {
41
39
  this.setupTrigger();
@@ -143,7 +141,7 @@ export class PostTooltipTrigger {
143
141
  handleLeave(event) {
144
142
  const newTarget = event.relatedTarget;
145
143
  if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
146
- (newTarget === this.trigger)) {
144
+ newTarget === this.trigger) {
147
145
  return;
148
146
  }
149
147
  this.interestLostHandler();
@@ -167,7 +165,7 @@ export class PostTooltipTrigger {
167
165
  this.tooltip?.hide();
168
166
  }
169
167
  render() {
170
- return (h(Host, { key: '4e4b53e85570d6dbba4ee7833a1d3de00e53dbc6', "data-version": version }, h("slot", { key: 'f8f5ea2e2ce848d654e233617455bbbbdc6ba5b1', onSlotchange: () => this.handleSlotChange() })));
168
+ return (h(Host, { key: '26ac11df6c2961e3dd51722f6981185db17c6efb', "data-version": version }, h("slot", { key: 'd08036f40d0a6708b8614232134b0d5b4eba4b78', onSlotchange: () => this.handleSlotChange() })));
171
169
  }
172
170
  static get is() { return "post-tooltip-trigger"; }
173
171
  static get encapsulation() { return "shadow"; }
@@ -1 +1,3 @@
1
1
  export * from './heading-levels';
2
+ export * from './placement';
3
+ export * from './property-types';
@@ -0,0 +1,14 @@
1
+ export const PLACEMENT_TYPES = [
2
+ 'top',
3
+ 'right',
4
+ 'bottom',
5
+ 'left',
6
+ 'top-start',
7
+ 'top-end',
8
+ 'right-start',
9
+ 'right-end',
10
+ 'bottom-start',
11
+ 'bottom-end',
12
+ 'left-start',
13
+ 'left-end',
14
+ ];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { EMPTY_VALUES } from "./property-checkers/constants";
2
+ export function isValueEmpty(value) {
3
+ return EMPTY_VALUES.some(v => v === value);
4
+ }
@@ -1,9 +1,8 @@
1
- export function checkOneOf(component, prop, possibleValues, customMessage) {
1
+ export function checkOneOf(component, prop, possibleValues) {
2
2
  const componentName = component.host.localName;
3
3
  const value = component[prop];
4
- const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
5
- const message = customMessage || defaultMessage;
4
+ const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
6
5
  if (!possibleValues.includes(value)) {
7
- throw new Error(message);
6
+ console.error(message);
8
7
  }
9
8
  }
@@ -1,9 +1,8 @@
1
- export function checkPattern(component, prop, pattern, customMessage) {
1
+ export function checkPattern(component, prop, pattern) {
2
2
  const componentName = component.host.localName;
3
3
  const value = component[prop];
4
- const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
5
- const message = customMessage || defaultMessage;
4
+ const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must follow the format \`${pattern}\`.`;
6
5
  if (typeof value !== 'string' || !pattern.test(value)) {
7
- throw new Error(message);
6
+ console.error(message);
8
7
  }
9
8
  }
@@ -1,17 +1,15 @@
1
- export function checkType(component, prop, type, customMessage) {
1
+ export function checkType(component, prop, type) {
2
2
  const componentName = component.host.localName;
3
3
  const value = component[prop];
4
4
  const typeIsArray = type === 'array';
5
5
  const valueIsArray = Array.isArray(value);
6
- const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
7
- ${type}\`.`;
8
- const message = customMessage || defaultMessage;
6
+ const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`${type}\`.`;
9
7
  if (typeIsArray || valueIsArray) {
10
8
  if (valueIsArray !== typeIsArray) {
11
- throw new Error(message);
9
+ console.error(message);
12
10
  }
13
11
  }
14
12
  else if (typeof value !== type) {
15
- throw new Error(message);
13
+ console.error(message);
16
14
  }
17
15
  }
@@ -1,15 +1,15 @@
1
- export function checkUrl(component, prop, customMessage) {
1
+ export function checkUrl(component, prop) {
2
2
  const componentName = component.host.localName;
3
3
  const value = component[prop];
4
- const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
5
- const message = customMessage || defaultMessage;
4
+ const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
6
5
  if (typeof value !== 'string' && !(value instanceof URL)) {
7
- throw new Error(message);
6
+ console.error(message);
7
+ return;
8
8
  }
9
9
  try {
10
10
  new URL(value, 'https://www.post.ch');
11
11
  }
12
12
  catch {
13
- throw new Error(message);
13
+ console.error(message);
14
14
  }
15
15
  }
@@ -1 +1 @@
1
- export const EMPTY_VALUES = [undefined, null, ''];
1
+ export const EMPTY_VALUES = [undefined, null, '', NaN];
@@ -1,11 +1,9 @@
1
- import { EMPTY_VALUES } from "./constants";
1
+ import { isValueEmpty } from "../is-value-empty";
2
2
  export function emptyOr(check) {
3
- return (...args) => {
4
- const component = args[0];
5
- const prop = args[1];
3
+ return (component, prop, ...extraArgs) => {
6
4
  const value = component[prop];
7
- if (!EMPTY_VALUES.some(v => v === value)) {
8
- check(...args);
5
+ if (!isValueEmpty(value)) {
6
+ check(component, prop, ...extraArgs);
9
7
  }
10
8
  };
11
9
  }
@@ -1,14 +1,14 @@
1
- import { emptyOr } from "./empty-or";
1
+ import { requiredAnd } from "./required-and";
2
2
  import { checkOneOf } from "./check-one-of";
3
3
  import { checkPattern } from "./check-pattern";
4
4
  import { checkType } from "./check-type";
5
5
  import { checkUrl } from "./check-url";
6
+ import { emptyOr } from "./empty-or";
6
7
  export const checkEmptyOrOneOf = emptyOr(checkOneOf);
7
8
  export const checkEmptyOrPattern = emptyOr(checkPattern);
8
9
  export const checkEmptyOrType = emptyOr(checkType);
9
10
  export const checkEmptyOrUrl = emptyOr(checkUrl);
10
- export * from './check-non-empty';
11
- export * from './check-one-of';
12
- export * from './check-pattern';
13
- export * from './check-type';
14
- export * from './check-url';
11
+ export const checkRequiredAndOneOf = requiredAnd(checkOneOf);
12
+ export const checkRequiredAndPattern = requiredAnd(checkPattern);
13
+ export const checkRequiredAndType = requiredAnd(checkType);
14
+ export const checkRequiredAndUrl = requiredAnd(checkUrl);
@@ -0,0 +1,14 @@
1
+ import { isValueEmpty } from "../is-value-empty";
2
+ export function requiredAnd(check) {
3
+ return (component, prop, ...extraArgs) => {
4
+ const componentName = component.host.localName;
5
+ const value = component[prop];
6
+ const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is not defined.`;
7
+ if (isValueEmpty(value)) {
8
+ throw new Error(message);
9
+ }
10
+ else {
11
+ check(component, prop, ...extraArgs);
12
+ }
13
+ };
14
+ }