@swisspost/design-system-components 10.0.0-next.37 → 10.0.0-next.39

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 (362) hide show
  1. package/dist/cjs/index-2b2b85e5.js +96 -0
  2. package/dist/cjs/index.cjs.js +23 -27
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-8121f093.js → package-29dc73af.js} +1 -1
  5. package/dist/cjs/placement-b2bb6ec4.js +18 -0
  6. package/dist/cjs/{post-accordion-beac7c9f.js → post-accordion-c433c493.js} +8 -8
  7. package/dist/cjs/{post-accordion-item-4846fbee.js → post-accordion-item-8d5a301d.js} +5 -5
  8. package/dist/cjs/post-accordion-item.cjs.entry.js +3 -7
  9. package/dist/cjs/post-accordion.cjs.entry.js +3 -3
  10. package/dist/cjs/{post-avatar-a36991fb.js → post-avatar-421043df.js} +21 -4
  11. package/dist/cjs/post-avatar.cjs.entry.js +3 -4
  12. package/dist/cjs/{post-back-to-top-32aa9017.js → post-back-to-top-3cca3803.js} +8 -11
  13. package/dist/cjs/post-back-to-top.cjs.entry.js +3 -5
  14. package/dist/cjs/{post-banner-be0e8909.js → post-banner-2e99c9d8.js} +12 -17
  15. package/dist/cjs/post-banner.cjs.entry.js +3 -8
  16. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -7
  17. package/dist/cjs/{post-breadcrumbs-6ef82a41.js → post-breadcrumbs-1be50860.js} +13 -7
  18. package/dist/cjs/post-breadcrumbs.cjs.entry.js +3 -3
  19. package/dist/cjs/{post-card-control-fe919333.js → post-card-control-0bfdad92.js} +42 -21
  20. package/dist/cjs/post-card-control.cjs.entry.js +3 -5
  21. package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -9
  22. package/dist/cjs/{post-collapsible-trigger-f42be607.js → post-collapsible-trigger-4180b218.js} +5 -8
  23. package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -8
  24. package/dist/cjs/post-components.cjs.js +1 -1
  25. package/dist/cjs/{post-footer-5179aa17.js → post-footer-92adffac.js} +12 -2
  26. package/dist/cjs/post-footer.cjs.entry.js +3 -2
  27. package/dist/cjs/{post-linkarea-27125078.js → post-linkarea-26c457b3.js} +1 -1
  28. package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
  29. package/dist/cjs/{post-menu-item-d78a9121.js → post-menu-item-d0a53c84.js} +3 -3
  30. package/dist/cjs/{post-popover-feb1e773.js → post-popover-36cead3d.js} +20 -5
  31. package/dist/cjs/post-popover.cjs.entry.js +4 -2
  32. package/dist/cjs/{post-rating-6d153a2c.js → post-rating-f50a9939.js} +29 -8
  33. package/dist/cjs/post-rating.cjs.entry.js +4 -2
  34. package/dist/cjs/{post-tab-header-e4532918.js → post-tab-header-f47508da.js} +3 -3
  35. package/dist/cjs/post-tab-header.cjs.entry.js +3 -4
  36. package/dist/cjs/{post-tab-panel-40df21ad.js → post-tab-panel-7c51798b.js} +11 -2
  37. package/dist/cjs/post-tab-panel.cjs.entry.js +4 -2
  38. package/dist/cjs/{post-tabs-45db2696.js → post-tabs-2debea01.js} +2 -2
  39. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  40. package/dist/cjs/{post-tag-0967bb1e.js → post-tag-ac62c57f.js} +18 -5
  41. package/dist/cjs/post-tag.cjs.entry.js +4 -2
  42. package/dist/cjs/{post-togglebutton-42b7d166.js → post-togglebutton-43c46511.js} +85 -88
  43. package/dist/cjs/{post-tooltip-f833d51d.js → post-tooltip-b7dcfb44.js} +11 -10
  44. package/dist/cjs/{post-tooltip-trigger-3ceac010.js → post-tooltip-trigger-904061b6.js} +6 -8
  45. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
  46. package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
  47. package/dist/collection/collection-manifest.json +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.js +3 -3
  50. package/dist/collection/components/post-avatar/post-avatar.js +25 -2
  51. package/dist/collection/components/post-back-to-top/post-back-to-top.js +8 -10
  52. package/dist/collection/components/post-banner/post-banner.js +13 -18
  53. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
  54. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +15 -7
  55. package/dist/collection/components/post-card-control/post-card-control.js +58 -33
  56. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  57. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  58. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +4 -5
  59. package/dist/collection/components/post-footer/post-footer.js +14 -2
  60. package/dist/collection/components/post-header/post-header.css +1 -1
  61. package/dist/collection/components/post-header/post-header.js +29 -54
  62. package/dist/collection/components/post-icon/post-icon.js +17 -37
  63. package/dist/collection/components/post-language-option/post-language-option.js +13 -13
  64. package/dist/collection/components/post-language-switch/post-language-switch.js +5 -5
  65. package/dist/collection/components/post-logo/post-logo.js +2 -2
  66. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  67. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  68. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
  69. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
  70. package/dist/collection/components/post-menu/post-menu.js +13 -2
  71. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
  72. package/dist/collection/components/post-popover/post-popover.js +21 -2
  73. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -4
  74. package/dist/collection/components/post-rating/post-rating.js +29 -2
  75. package/dist/collection/components/post-tab-header/post-tab-header.js +5 -10
  76. package/dist/collection/components/post-tab-panel/post-tab-panel.js +13 -2
  77. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  78. package/dist/collection/components/post-tag/post-tag.js +23 -11
  79. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -12
  80. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  81. package/dist/collection/components/post-tooltip/post-tooltip.js +12 -12
  82. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +5 -7
  83. package/dist/collection/types/index.js +2 -0
  84. package/dist/collection/types/placement.js +14 -0
  85. package/dist/collection/types/property-types.js +1 -0
  86. package/dist/collection/utils/is-value-empty.js +4 -0
  87. package/dist/collection/utils/property-checkers/check-one-of.js +3 -4
  88. package/dist/collection/utils/property-checkers/check-pattern.js +3 -4
  89. package/dist/collection/utils/property-checkers/check-type.js +4 -6
  90. package/dist/collection/utils/property-checkers/check-url.js +5 -5
  91. package/dist/collection/utils/property-checkers/constants.js +1 -1
  92. package/dist/collection/utils/property-checkers/empty-or.js +4 -6
  93. package/dist/collection/utils/property-checkers/index.js +6 -6
  94. package/dist/collection/utils/property-checkers/required-and.js +14 -0
  95. package/dist/components/index2.js +60 -19
  96. package/dist/components/package.js +1 -1
  97. package/dist/components/post-accordion-item2.js +4 -4
  98. package/dist/components/post-accordion2.js +7 -7
  99. package/dist/components/post-avatar2.js +24 -4
  100. package/dist/components/post-back-to-top2.js +9 -12
  101. package/dist/components/post-banner2.js +12 -18
  102. package/dist/components/post-breadcrumb-item2.js +2 -2
  103. package/dist/components/post-breadcrumbs2.js +14 -7
  104. package/dist/components/post-card-control2.js +41 -16
  105. package/dist/components/post-closebutton2.js +1 -1
  106. package/dist/components/post-collapsible-trigger2.js +3 -5
  107. package/dist/components/post-collapsible2.js +2 -2
  108. package/dist/components/post-footer2.js +13 -1
  109. package/dist/components/post-header2.js +31 -33
  110. package/dist/components/post-icon2.js +9 -25
  111. package/dist/components/post-language-option2.js +9 -10
  112. package/dist/components/post-language-switch2.js +4 -6
  113. package/dist/components/post-logo2.js +2 -2
  114. package/dist/components/post-mainnavigation2.js +1 -1
  115. package/dist/components/post-megadropdown-trigger2.js +4 -4
  116. package/dist/components/post-megadropdown2.js +1 -1
  117. package/dist/components/post-menu-trigger2.js +3 -3
  118. package/dist/components/post-menu2.js +12 -2
  119. package/dist/components/post-popover2.js +20 -3
  120. package/dist/components/post-popovercontainer2.js +37 -3
  121. package/dist/components/post-rating2.js +26 -1
  122. package/dist/components/post-tab-header2.js +2 -2
  123. package/dist/components/post-tab-panel2.js +12 -1
  124. package/dist/components/post-tabs2.js +1 -1
  125. package/dist/components/post-tag2.js +19 -5
  126. package/dist/components/post-togglebutton2.js +1 -12
  127. package/dist/components/post-tooltip-trigger2.js +5 -7
  128. package/dist/components/post-tooltip2.js +11 -11
  129. package/dist/components/switch-variants.js +3 -0
  130. package/dist/docs.json +39 -87
  131. package/dist/esm/index-ffccd040.js +88 -0
  132. package/dist/esm/index.js +23 -27
  133. package/dist/esm/loader.js +1 -1
  134. package/dist/esm/package-8503eaa8.js +3 -0
  135. package/dist/esm/placement-8d56605d.js +16 -0
  136. package/dist/esm/{post-accordion-fdcf7205.js → post-accordion-9365faca.js} +8 -8
  137. package/dist/esm/{post-accordion-item-e11e3804.js → post-accordion-item-2dc8e3b7.js} +5 -5
  138. package/dist/esm/post-accordion-item.entry.js +3 -7
  139. package/dist/esm/post-accordion.entry.js +3 -3
  140. package/dist/esm/{post-avatar-d360c6d2.js → post-avatar-4f73dc4d.js} +21 -4
  141. package/dist/esm/post-avatar.entry.js +3 -4
  142. package/dist/esm/{post-back-to-top-85796c8b.js → post-back-to-top-8f759d32.js} +8 -11
  143. package/dist/esm/post-back-to-top.entry.js +3 -5
  144. package/dist/esm/{post-banner-a3090f67.js → post-banner-ad979275.js} +12 -17
  145. package/dist/esm/post-banner.entry.js +3 -8
  146. package/dist/esm/post-breadcrumb-item_2.entry.js +3 -7
  147. package/dist/esm/{post-breadcrumbs-15ec5a26.js → post-breadcrumbs-a20336c7.js} +13 -7
  148. package/dist/esm/post-breadcrumbs.entry.js +3 -3
  149. package/dist/esm/{post-card-control-6142534e.js → post-card-control-3c77e778.js} +37 -16
  150. package/dist/esm/post-card-control.entry.js +3 -5
  151. package/dist/esm/post-closebutton_15.entry.js +5 -9
  152. package/dist/esm/{post-collapsible-trigger-68306358.js → post-collapsible-trigger-5fd0e193.js} +5 -8
  153. package/dist/esm/post-collapsible_2.entry.js +3 -8
  154. package/dist/esm/post-components.js +1 -1
  155. package/dist/esm/{post-footer-d2a3270e.js → post-footer-3e117b5a.js} +12 -2
  156. package/dist/esm/post-footer.entry.js +3 -2
  157. package/dist/esm/{post-linkarea-64998c67.js → post-linkarea-16a14609.js} +1 -1
  158. package/dist/esm/post-linkarea.entry.js +2 -2
  159. package/dist/esm/{post-menu-item-95a0a647.js → post-menu-item-b1604fe4.js} +3 -3
  160. package/dist/esm/{post-popover-c5f81087.js → post-popover-49096648.js} +17 -2
  161. package/dist/esm/post-popover.entry.js +4 -2
  162. package/dist/esm/{post-rating-7bfedafb.js → post-rating-405bee8f.js} +23 -2
  163. package/dist/esm/post-rating.entry.js +4 -2
  164. package/dist/esm/{post-tab-header-08033da4.js → post-tab-header-b228c217.js} +3 -3
  165. package/dist/esm/post-tab-header.entry.js +3 -4
  166. package/dist/esm/{post-tab-panel-be701793.js → post-tab-panel-98110b64.js} +11 -2
  167. package/dist/esm/post-tab-panel.entry.js +4 -2
  168. package/dist/esm/{post-tabs-c69e2842.js → post-tabs-44d9313c.js} +2 -2
  169. package/dist/esm/post-tabs.entry.js +2 -2
  170. package/dist/esm/{post-tag-ebac7f3e.js → post-tag-99cc9616.js} +18 -5
  171. package/dist/esm/post-tag.entry.js +4 -2
  172. package/dist/esm/{post-togglebutton-706e3af0.js → post-togglebutton-ea73e63f.js} +85 -88
  173. package/dist/esm/{post-tooltip-9a195d47.js → post-tooltip-78cd2988.js} +11 -10
  174. package/dist/esm/{post-tooltip-trigger-7d6f234b.js → post-tooltip-trigger-bdb21c45.js} +6 -8
  175. package/dist/esm/post-tooltip-trigger.entry.js +3 -3
  176. package/dist/esm/post-tooltip.entry.js +4 -3
  177. package/dist/post-components/index.esm.js +1 -1
  178. package/dist/post-components/p-09dd5aa4.js +1 -0
  179. package/dist/post-components/{p-17dc4170.js → p-0f9322e5.js} +2 -2
  180. package/dist/post-components/{p-de4d4274.js → p-11572299.js} +1 -1
  181. package/dist/post-components/p-19a83519.entry.js +1 -0
  182. package/dist/post-components/p-1afb3c43.entry.js +1 -0
  183. package/dist/post-components/p-214cd032.js +1 -0
  184. package/dist/post-components/p-21e5b028.js +1 -0
  185. package/dist/post-components/p-2320305b.js +1 -0
  186. package/dist/post-components/p-2523f97b.entry.js +1 -0
  187. package/dist/post-components/p-2bd3a436.js +1 -0
  188. package/dist/post-components/p-2ce8fbf5.js +1 -0
  189. package/dist/post-components/p-2f879f4e.entry.js +1 -0
  190. package/dist/post-components/p-33e26845.entry.js +1 -0
  191. package/dist/post-components/p-38b1c71e.entry.js +1 -0
  192. package/dist/post-components/p-38d59732.js +1 -0
  193. package/dist/post-components/p-3a67f1ff.js +1 -0
  194. package/dist/post-components/p-41450b6c.entry.js +1 -0
  195. package/dist/post-components/p-4c23ed05.entry.js +1 -0
  196. package/dist/post-components/p-57746c40.js +1 -0
  197. package/dist/post-components/p-59a38c23.js +1 -0
  198. package/dist/post-components/p-6313d72e.entry.js +1 -0
  199. package/dist/post-components/p-64e0b0fc.js +1 -0
  200. package/dist/post-components/p-658a2e34.entry.js +1 -0
  201. package/dist/post-components/p-746d3cd3.entry.js +1 -0
  202. package/dist/post-components/p-79a2dad0.entry.js +1 -0
  203. package/dist/post-components/p-7dd1807c.js +1 -0
  204. package/dist/post-components/p-817fbeaf.js +1 -0
  205. package/dist/post-components/p-85950200.js +1 -0
  206. package/dist/post-components/p-8ebecf22.entry.js +1 -0
  207. package/dist/post-components/p-8ed1cb53.entry.js +1 -0
  208. package/dist/post-components/p-91244b25.js +1 -0
  209. package/dist/post-components/{p-ab566526.js → p-91675004.js} +1 -1
  210. package/dist/post-components/p-94ebc430.js +1 -0
  211. package/dist/post-components/p-95727a4f.entry.js +1 -0
  212. package/dist/post-components/p-a844da3a.entry.js +1 -0
  213. package/dist/post-components/{p-1a21fd8d.js → p-af900651.js} +1 -1
  214. package/dist/post-components/p-b176309b.js +1 -0
  215. package/dist/post-components/p-b373659e.entry.js +1 -0
  216. package/dist/post-components/p-b500b245.js +1 -0
  217. package/dist/post-components/p-bf182745.entry.js +1 -0
  218. package/dist/post-components/p-c9b6f9e7.entry.js +1 -0
  219. package/dist/post-components/p-cb7d8f67.entry.js +1 -0
  220. package/dist/post-components/p-e28eb73a.js +1 -0
  221. package/dist/post-components/post-components.css +1 -0
  222. package/dist/post-components/post-components.esm.js +1 -1
  223. package/dist/prebuild.js +26 -0
  224. package/dist/types/components/post-accordion/post-accordion.d.ts +2 -1
  225. package/dist/types/components/post-avatar/post-avatar.d.ts +3 -0
  226. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +1 -1
  227. package/dist/types/components/post-banner/post-banner.d.ts +3 -4
  228. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +2 -1
  229. package/dist/types/components/post-card-control/post-card-control.d.ts +10 -6
  230. package/dist/types/components/post-footer/post-footer.d.ts +2 -0
  231. package/dist/types/components/post-header/post-header.d.ts +5 -9
  232. package/dist/types/components/post-icon/post-icon.d.ts +5 -7
  233. package/dist/types/components/post-language-option/post-language-option.d.ts +5 -5
  234. package/dist/types/components/post-logo/post-logo.d.ts +1 -1
  235. package/dist/types/components/post-menu/post-menu.d.ts +1 -0
  236. package/dist/types/components/post-popover/post-popover.d.ts +2 -0
  237. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +3 -0
  238. package/dist/types/components/post-rating/post-rating.d.ts +4 -0
  239. package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
  240. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -0
  241. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  242. package/dist/types/components/post-tag/post-tag.d.ts +5 -3
  243. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -1
  244. package/dist/types/components/post-tooltip/post-tooltip.d.ts +3 -3
  245. package/dist/types/components.d.ts +38 -59
  246. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +1 -0
  247. package/dist/types/index.d.ts +2 -2
  248. package/dist/types/types/index.d.ts +2 -0
  249. package/dist/types/types/placement.d.ts +1 -0
  250. package/dist/types/types/property-types.d.ts +1 -0
  251. package/dist/types/utils/is-value-empty.d.ts +1 -0
  252. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
  253. package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -1
  254. package/dist/types/utils/property-checkers/check-type.d.ts +2 -2
  255. package/dist/types/utils/property-checkers/check-url.d.ts +1 -1
  256. package/dist/types/utils/property-checkers/constants.d.ts +1 -1
  257. package/dist/types/utils/property-checkers/empty-or.d.ts +3 -1
  258. package/dist/types/utils/property-checkers/index.d.ts +16 -9
  259. package/dist/types/utils/property-checkers/required-and.d.ts +3 -0
  260. package/loaders/index2.js +60 -19
  261. package/loaders/package.js +1 -1
  262. package/loaders/post-accordion-item2.js +4 -4
  263. package/loaders/post-accordion.js +7 -7
  264. package/loaders/post-avatar.js +24 -4
  265. package/loaders/post-back-to-top.js +9 -12
  266. package/loaders/post-banner.js +12 -18
  267. package/loaders/post-breadcrumb-item2.js +2 -2
  268. package/loaders/post-breadcrumbs.js +14 -7
  269. package/loaders/post-card-control.js +41 -16
  270. package/loaders/post-closebutton.js +1 -1
  271. package/loaders/post-collapsible-trigger2.js +3 -5
  272. package/loaders/post-collapsible2.js +2 -2
  273. package/loaders/post-footer.js +13 -1
  274. package/loaders/post-header.js +31 -33
  275. package/loaders/post-icon2.js +9 -25
  276. package/loaders/post-language-option.js +9 -10
  277. package/loaders/post-language-switch.js +4 -6
  278. package/loaders/post-logo.js +2 -2
  279. package/loaders/post-mainnavigation.js +1 -1
  280. package/loaders/post-megadropdown-trigger.js +4 -4
  281. package/loaders/post-megadropdown.js +1 -1
  282. package/loaders/post-menu-trigger2.js +3 -3
  283. package/loaders/post-menu2.js +12 -2
  284. package/loaders/post-popover.js +20 -3
  285. package/loaders/post-popovercontainer.js +1 -1
  286. package/loaders/post-popovercontainer2.js +37 -3
  287. package/loaders/post-rating.js +26 -1
  288. package/loaders/post-tab-header.js +2 -2
  289. package/loaders/post-tab-panel.js +12 -1
  290. package/loaders/post-tabs.js +1 -1
  291. package/loaders/post-tag.js +19 -5
  292. package/loaders/post-togglebutton.js +1 -12
  293. package/loaders/post-tooltip-trigger.js +5 -7
  294. package/loaders/post-tooltip.js +11 -11
  295. package/loaders/switch-variants.js +3 -0
  296. package/package.json +19 -9
  297. package/dist/cjs/check-non-empty-bd99d236.js +0 -15
  298. package/dist/cjs/check-one-of-75d270b5.js +0 -13
  299. package/dist/cjs/check-type-cdbf6d29.js +0 -21
  300. package/dist/cjs/check-url-220a286c.js +0 -19
  301. package/dist/cjs/constants-238701d3.js +0 -5
  302. package/dist/cjs/index-23e36ff7.js +0 -37
  303. package/dist/collection/utils/property-checkers/check-non-empty.js +0 -10
  304. package/dist/components/check-non-empty.js +0 -13
  305. package/dist/components/check-one-of.js +0 -11
  306. package/dist/components/check-type.js +0 -19
  307. package/dist/components/constants.js +0 -3
  308. package/dist/esm/check-non-empty-258a56b3.js +0 -13
  309. package/dist/esm/check-one-of-0bee20f5.js +0 -11
  310. package/dist/esm/check-type-37d5d307.js +0 -19
  311. package/dist/esm/check-url-17962bc8.js +0 -17
  312. package/dist/esm/constants-8d548297.js +0 -3
  313. package/dist/esm/index-8f8fe5b0.js +0 -32
  314. package/dist/esm/package-d9237b44.js +0 -3
  315. package/dist/post-components/p-034715ec.js +0 -1
  316. package/dist/post-components/p-0717fe4c.js +0 -1
  317. package/dist/post-components/p-0c03547b.js +0 -1
  318. package/dist/post-components/p-0de8d05f.js +0 -1
  319. package/dist/post-components/p-1373a79b.entry.js +0 -1
  320. package/dist/post-components/p-181c73d5.js +0 -1
  321. package/dist/post-components/p-1ab3eba4.entry.js +0 -1
  322. package/dist/post-components/p-2d6c0670.js +0 -1
  323. package/dist/post-components/p-2dc0a2d0.js +0 -1
  324. package/dist/post-components/p-35ad2e11.entry.js +0 -1
  325. package/dist/post-components/p-368c473a.js +0 -1
  326. package/dist/post-components/p-38f778a7.entry.js +0 -1
  327. package/dist/post-components/p-39a8df3c.entry.js +0 -1
  328. package/dist/post-components/p-3c7f6003.js +0 -1
  329. package/dist/post-components/p-440193f4.js +0 -1
  330. package/dist/post-components/p-474a41bc.entry.js +0 -1
  331. package/dist/post-components/p-69bc8eaf.entry.js +0 -1
  332. package/dist/post-components/p-72310bf0.entry.js +0 -1
  333. package/dist/post-components/p-7709c14a.js +0 -1
  334. package/dist/post-components/p-804b61b7.entry.js +0 -1
  335. package/dist/post-components/p-85fdc2d3.js +0 -1
  336. package/dist/post-components/p-89247caa.js +0 -1
  337. package/dist/post-components/p-89dc67c7.entry.js +0 -1
  338. package/dist/post-components/p-8f7f5200.entry.js +0 -1
  339. package/dist/post-components/p-964f9581.js +0 -1
  340. package/dist/post-components/p-a52b2d34.js +0 -1
  341. package/dist/post-components/p-b648e537.entry.js +0 -1
  342. package/dist/post-components/p-bc33a6d9.js +0 -1
  343. package/dist/post-components/p-bcfdbd0b.entry.js +0 -1
  344. package/dist/post-components/p-beb67979.js +0 -1
  345. package/dist/post-components/p-c41868b1.js +0 -1
  346. package/dist/post-components/p-c71700a7.js +0 -1
  347. package/dist/post-components/p-cb027003.js +0 -1
  348. package/dist/post-components/p-cc5b1437.js +0 -1
  349. package/dist/post-components/p-ceda889e.entry.js +0 -1
  350. package/dist/post-components/p-d45df336.js +0 -1
  351. package/dist/post-components/p-deb9efcf.entry.js +0 -1
  352. package/dist/post-components/p-e585c6fe.js +0 -1
  353. package/dist/post-components/p-e9f1cc46.entry.js +0 -1
  354. package/dist/post-components/p-ee4e776d.entry.js +0 -1
  355. package/dist/post-components/p-ee7c3bcc.entry.js +0 -1
  356. package/dist/post-components/p-f56482fa.entry.js +0 -1
  357. package/dist/post-components/p-f8c652ce.entry.js +0 -1
  358. package/dist/types/utils/property-checkers/check-non-empty.d.ts +0 -3
  359. package/loaders/check-non-empty.js +0 -13
  360. package/loaders/check-one-of.js +0 -11
  361. package/loaders/check-type.js +0 -19
  362. package/loaders/constants.js +0 -3
@@ -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: '91f3a00b43c003fdeae8c56df2aff30218d44974', "data-version": version }, h("div", { key: '02b0c4a6cce70faf47f0cbed806c0cec02eae56b', 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,7 +11,7 @@ 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)}`;
@@ -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: 'aef9d8692392f57745c0d0a0af13fedb6f67f231', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '1e51f8680f4e7bdcb37994db3e70e828dde61dc0' })));
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: 'b38b216caa48cb36b73f36669a650bc88b56c860', "data-version": version }, h("div", { key: '751f88c9f0241e42b6c8d996b3645c26113f0ce2', class: "tabs-wrapper", part: "tabs" }, h("div", { key: 'd194ce33913a2ed6abbdd939ad5dcdc74e6f6798', class: "tabs", role: "tablist" }, h("slot", { key: '46fb9cf2d52fadf9418dff7050b78274457c3b0a', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: 'db2bfba595dab2730b9189a935dcd99504d7bad6', class: "tab-content", part: "content" }, h("slot", { key: '35795441e71901727fad9d759da483f55a865e97', 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: 'ecc396b297434d07c2fbca896ad7dbb817c5e52c', "data-version": version }, h("div", { key: 'cf43facc3b6d7caa329fb2b62a67931e53aaeb98', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '60232a82d9c231da41d22dd5e50744378dab54aa', class: "tag-text" }, h("slot", { key: '6b95fe941aac88e3ce6103187d5d831d53f8c315' })))));
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: 'd79b9952861afa27d8d1c5afb492e585bdc8a722', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'aad4cc86756d0688d10f1b28dc14d6b464ab8830' })));
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: 'e6bb167dd89c7549f4bed625dbeb652eac871ce5', "data-version": version, role: "tooltip" }, h("post-popovercontainer", { key: 'f5dc041dc440f7dc5410e9ee020f51a974ff3e83', 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: 'e1ee7b0cfb57dc927a96574b10af50c3bd12328c' }))));
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: '2dc6f70e4dc7706a69efcede935e85faede3b73c', "data-version": version }, h("slot", { key: 'b6301a66707d85a06b053a0a70a2a0cbc62877b3', 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
+ }