@swisspost/design-system-components 1.6.3 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/dist/cjs/{check-non-empty-ae713942.js → check-non-empty-eeaa8f77.js} +4 -4
  2. package/dist/cjs/check-non-empty-eeaa8f77.js.map +1 -0
  3. package/dist/cjs/index-8c288b1a.js +45 -0
  4. package/dist/cjs/index-8c288b1a.js.map +1 -0
  5. package/dist/cjs/{index-b619e205.js → index-c07c0cdb.js} +94 -64
  6. package/dist/cjs/index-c07c0cdb.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +17 -12
  8. package/dist/cjs/index.cjs.js.map +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/package-cd0e9960.js +7 -0
  11. package/dist/cjs/package-cd0e9960.js.map +1 -0
  12. package/dist/cjs/post-accordion-f2e00198.js +87 -0
  13. package/dist/cjs/post-accordion-f2e00198.js.map +1 -0
  14. package/dist/cjs/post-accordion.cjs.entry.js +4 -80
  15. package/dist/cjs/post-accordion.cjs.entry.js.map +1 -1
  16. package/dist/cjs/post-alert-6d0b5e58.js +101 -0
  17. package/dist/cjs/{post-alert-b46943e0.js.map → post-alert-6d0b5e58.js.map} +1 -1
  18. package/dist/cjs/post-alert.cjs.entry.js +5 -6
  19. package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
  20. package/dist/cjs/{post-collapsible-04364cda.js → post-collapsible-0b8dce97.js} +69 -69
  21. package/dist/cjs/{post-collapsible-04364cda.js.map → post-collapsible-0b8dce97.js.map} +1 -1
  22. package/dist/cjs/post-collapsible.cjs.entry.js +4 -5
  23. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  24. package/dist/cjs/post-components.cjs.js +3 -3
  25. package/dist/cjs/post-components.cjs.js.map +1 -1
  26. package/dist/cjs/post-icon-3dbb7728.js +105 -0
  27. package/dist/cjs/post-icon-3dbb7728.js.map +1 -0
  28. package/dist/cjs/post-icon.cjs.entry.js +5 -6
  29. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  30. package/dist/cjs/post-popover-ea22d235.js +118 -0
  31. package/dist/cjs/post-popover-ea22d235.js.map +1 -0
  32. package/dist/cjs/post-popover.cjs.entry.js +13 -0
  33. package/dist/cjs/post-popover.cjs.entry.js.map +1 -0
  34. package/dist/cjs/post-popovercontainer-42e4ab15.js +1878 -0
  35. package/dist/cjs/post-popovercontainer-42e4ab15.js.map +1 -0
  36. package/dist/cjs/post-popovercontainer.cjs.entry.js +13 -0
  37. package/dist/cjs/post-popovercontainer.cjs.entry.js.map +1 -0
  38. package/dist/cjs/post-tab-header-09074905.js +33 -0
  39. package/dist/cjs/{post-tab-header-805c0a52.js.map → post-tab-header-09074905.js.map} +1 -1
  40. package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
  41. package/dist/cjs/post-tab-panel-9547b9ac.js +27 -0
  42. package/dist/cjs/{post-tab-panel-caa44a77.js.map → post-tab-panel-9547b9ac.js.map} +1 -1
  43. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  44. package/dist/cjs/post-tabs-2ec2778e.js +153 -0
  45. package/dist/cjs/post-tabs-2ec2778e.js.map +1 -0
  46. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  47. package/dist/cjs/{post-tooltip-32a9c549.js → post-tooltip-c802c51f.js} +78 -1754
  48. package/dist/cjs/post-tooltip-c802c51f.js.map +1 -0
  49. package/dist/cjs/post-tooltip.cjs.entry.js +3 -4
  50. package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
  51. package/dist/collection/animations/collapse.js +5 -5
  52. package/dist/collection/animations/collapse.js.map +1 -1
  53. package/dist/collection/collection-manifest.json +5 -3
  54. package/dist/collection/components/post-accordion/post-accordion.js +167 -166
  55. package/dist/collection/components/post-accordion/post-accordion.js.map +1 -1
  56. package/dist/collection/components/post-alert/post-alert.css +2 -2
  57. package/dist/collection/components/post-alert/post-alert.js +246 -246
  58. package/dist/collection/components/post-alert/post-alert.js.map +1 -1
  59. package/dist/collection/components/post-collapsible/post-collapsible.js +169 -168
  60. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  61. package/dist/collection/components/post-icon/post-icon.css +1 -1
  62. package/dist/collection/components/post-icon/post-icon.js +250 -250
  63. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  64. package/dist/collection/components/post-popover/post-popover.css +3 -0
  65. package/dist/collection/components/post-popover/post-popover.js +267 -0
  66. package/dist/collection/components/post-popover/post-popover.js.map +1 -0
  67. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -0
  68. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +288 -0
  69. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js.map +1 -0
  70. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  71. package/dist/collection/components/post-tab-header/post-tab-header.js +62 -62
  72. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
  73. package/dist/collection/components/post-tab-panel/post-tab-panel.js +50 -50
  74. package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -1
  75. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  76. package/dist/collection/components/post-tabs/post-tabs.js +224 -223
  77. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
  78. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  79. package/dist/collection/components/post-tooltip/post-tooltip.js +192 -325
  80. package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
  81. package/dist/collection/index.js +3 -0
  82. package/dist/collection/index.js.map +1 -1
  83. package/dist/collection/utils/is-motion-reduced.js +1 -1
  84. package/dist/collection/utils/is-motion-reduced.js.map +1 -1
  85. package/dist/collection/utils/property-checkers/check-non-empty.js +3 -3
  86. package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -1
  87. package/dist/collection/utils/property-checkers/check-one-of.js +2 -2
  88. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
  89. package/dist/collection/utils/property-checkers/check-pattern.js +2 -2
  90. package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -1
  91. package/dist/collection/utils/property-checkers/check-type.js +10 -10
  92. package/dist/collection/utils/property-checkers/check-type.js.map +1 -1
  93. package/dist/collection/utils/property-checkers/empty-or.js +5 -5
  94. package/dist/collection/utils/property-checkers/empty-or.js.map +1 -1
  95. package/dist/components/check-non-empty.js +3 -3
  96. package/dist/components/check-non-empty.js.map +1 -1
  97. package/dist/components/index.js +3 -0
  98. package/dist/components/index.js.map +1 -1
  99. package/dist/components/index2.js +22 -18
  100. package/dist/components/index2.js.map +1 -1
  101. package/dist/components/package.js +1 -1
  102. package/dist/components/post-accordion.d.ts +2 -2
  103. package/dist/components/post-accordion.js +1 -101
  104. package/dist/components/post-accordion.js.map +1 -1
  105. package/dist/components/post-accordion2.js +105 -0
  106. package/dist/components/post-accordion2.js.map +1 -0
  107. package/dist/components/post-alert.d.ts +2 -2
  108. package/dist/components/post-alert2.js +119 -119
  109. package/dist/components/post-alert2.js.map +1 -1
  110. package/dist/components/post-collapsible.d.ts +2 -2
  111. package/dist/components/post-collapsible2.js +90 -90
  112. package/dist/components/post-collapsible2.js.map +1 -1
  113. package/dist/components/post-icon.d.ts +2 -2
  114. package/dist/components/post-icon2.js +118 -118
  115. package/dist/components/post-icon2.js.map +1 -1
  116. package/dist/components/post-popover.d.ts +11 -0
  117. package/dist/components/post-popover.js +8 -0
  118. package/dist/components/post-popover.js.map +1 -0
  119. package/dist/components/post-popover2.js +144 -0
  120. package/dist/components/post-popover2.js.map +1 -0
  121. package/dist/components/post-popovercontainer.d.ts +11 -0
  122. package/dist/components/post-popovercontainer.js +8 -0
  123. package/dist/components/post-popovercontainer.js.map +1 -0
  124. package/dist/components/post-popovercontainer2.js +1897 -0
  125. package/dist/components/post-popovercontainer2.js.map +1 -0
  126. package/dist/components/post-tab-header.d.ts +2 -2
  127. package/dist/components/post-tab-header2.js +38 -38
  128. package/dist/components/post-tab-header2.js.map +1 -1
  129. package/dist/components/post-tab-panel.d.ts +2 -2
  130. package/dist/components/post-tab-panel2.js +30 -30
  131. package/dist/components/post-tab-panel2.js.map +1 -1
  132. package/dist/components/post-tabs.d.ts +2 -2
  133. package/dist/components/post-tabs2.js +147 -147
  134. package/dist/components/post-tabs2.js.map +1 -1
  135. package/dist/components/post-tooltip.d.ts +2 -2
  136. package/dist/components/post-tooltip2.js +100 -1774
  137. package/dist/components/post-tooltip2.js.map +1 -1
  138. package/dist/docs.d.ts +1 -21
  139. package/dist/docs.json +604 -77
  140. package/dist/esm/check-non-empty-58bd6b17.js +11 -0
  141. package/dist/esm/{check-non-empty-09c39561.js.map → check-non-empty-58bd6b17.js.map} +1 -1
  142. package/dist/esm/index-1427953c.js +40 -0
  143. package/dist/esm/index-1427953c.js.map +1 -0
  144. package/dist/esm/{index-4eff5fc5.js → index-35998e08.js} +94 -64
  145. package/dist/esm/index-35998e08.js.map +1 -0
  146. package/dist/esm/index.js +14 -12
  147. package/dist/esm/index.js.map +1 -1
  148. package/dist/esm/loader.js +3 -3
  149. package/dist/esm/package-337354c3.js +5 -0
  150. package/dist/esm/package-337354c3.js.map +1 -0
  151. package/dist/esm/post-accordion-c2013bb3.js +85 -0
  152. package/dist/esm/post-accordion-c2013bb3.js.map +1 -0
  153. package/dist/esm/post-accordion.entry.js +3 -83
  154. package/dist/esm/post-accordion.entry.js.map +1 -1
  155. package/dist/esm/post-alert-7254a70f.js +99 -0
  156. package/dist/esm/{post-alert-e457e249.js.map → post-alert-7254a70f.js.map} +1 -1
  157. package/dist/esm/post-alert.entry.js +5 -6
  158. package/dist/esm/post-alert.entry.js.map +1 -1
  159. package/dist/esm/{post-collapsible-c0a826b2.js → post-collapsible-4464cc98.js} +69 -69
  160. package/dist/esm/{post-collapsible-c0a826b2.js.map → post-collapsible-4464cc98.js.map} +1 -1
  161. package/dist/esm/post-collapsible.entry.js +4 -5
  162. package/dist/esm/post-collapsible.entry.js.map +1 -1
  163. package/dist/esm/post-components.js +4 -4
  164. package/dist/esm/post-components.js.map +1 -1
  165. package/dist/esm/post-icon-e0bbf0f5.js +103 -0
  166. package/dist/esm/post-icon-e0bbf0f5.js.map +1 -0
  167. package/dist/esm/post-icon.entry.js +5 -6
  168. package/dist/esm/post-icon.entry.js.map +1 -1
  169. package/dist/esm/post-popover-25eb3f76.js +116 -0
  170. package/dist/esm/post-popover-25eb3f76.js.map +1 -0
  171. package/dist/esm/post-popover.entry.js +5 -0
  172. package/dist/esm/post-popover.entry.js.map +1 -0
  173. package/dist/esm/post-popovercontainer-54117eea.js +1876 -0
  174. package/dist/esm/post-popovercontainer-54117eea.js.map +1 -0
  175. package/dist/esm/post-popovercontainer.entry.js +5 -0
  176. package/dist/esm/post-popovercontainer.entry.js.map +1 -0
  177. package/dist/esm/post-tab-header-1684b507.js +31 -0
  178. package/dist/esm/{post-tab-header-f0c355d6.js.map → post-tab-header-1684b507.js.map} +1 -1
  179. package/dist/esm/post-tab-header.entry.js +4 -4
  180. package/dist/esm/post-tab-panel-add26fe5.js +25 -0
  181. package/dist/esm/{post-tab-panel-46f02247.js.map → post-tab-panel-add26fe5.js.map} +1 -1
  182. package/dist/esm/post-tab-panel.entry.js +3 -3
  183. package/dist/esm/post-tabs-d738e61f.js +151 -0
  184. package/dist/esm/post-tabs-d738e61f.js.map +1 -0
  185. package/dist/esm/post-tabs.entry.js +3 -3
  186. package/dist/esm/{post-tooltip-fa7b4a0a.js → post-tooltip-57928808.js} +78 -1754
  187. package/dist/esm/post-tooltip-57928808.js.map +1 -0
  188. package/dist/esm/post-tooltip.entry.js +3 -4
  189. package/dist/esm/post-tooltip.entry.js.map +1 -1
  190. package/dist/post-components/index.esm.js +1 -1
  191. package/dist/post-components/p-05e85f2b.entry.js +2 -0
  192. package/dist/post-components/p-08abd53e.entry.js +2 -0
  193. package/dist/post-components/p-09892ad1.js +2 -0
  194. package/dist/post-components/{p-fffce1d7.js.map → p-09892ad1.js.map} +1 -1
  195. package/dist/post-components/p-1e9ec4a9.entry.js +2 -0
  196. package/dist/post-components/p-1f55663e.js +2 -0
  197. package/dist/post-components/p-1f55663e.js.map +1 -0
  198. package/dist/post-components/p-30c60b6c.entry.js +2 -0
  199. package/dist/post-components/p-38d97f62.entry.js +2 -0
  200. package/dist/post-components/p-4c188911.entry.js +2 -0
  201. package/dist/post-components/p-568bb469.entry.js +2 -0
  202. package/dist/post-components/p-65c8bd5c.entry.js +2 -0
  203. package/dist/post-components/p-6e3158e8.js +2 -0
  204. package/dist/post-components/{p-ca1e407c.js.map → p-6e3158e8.js.map} +1 -1
  205. package/dist/post-components/p-7d32dfb7.js +2 -0
  206. package/dist/post-components/{p-8b6fe20d.js.map → p-7d32dfb7.js.map} +1 -1
  207. package/dist/post-components/p-81591ad0.js +3 -0
  208. package/dist/post-components/p-81591ad0.js.map +1 -0
  209. package/dist/post-components/p-96f4ebc4.js +2 -0
  210. package/dist/post-components/p-96f4ebc4.js.map +1 -0
  211. package/dist/post-components/p-9bd5f824.js +2 -0
  212. package/dist/post-components/p-9bd5f824.js.map +1 -0
  213. package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
  214. package/dist/post-components/p-b4b4f59a.js +2 -0
  215. package/dist/post-components/p-bd032124.js +2 -0
  216. package/dist/post-components/p-bd032124.js.map +1 -0
  217. package/dist/post-components/p-c5858d52.entry.js +2 -0
  218. package/dist/post-components/p-c5858d52.entry.js.map +1 -0
  219. package/dist/post-components/{p-7b8797c6.entry.js → p-dbd07f20.js} +2 -2
  220. package/dist/post-components/p-de493e36.js +2 -0
  221. package/dist/post-components/p-de493e36.js.map +1 -0
  222. package/dist/post-components/{p-3604be27.js → p-eaddd6cc.js} +2 -2
  223. package/dist/post-components/p-ed73d4c0.entry.js +2 -0
  224. package/dist/post-components/p-ed73d4c0.entry.js.map +1 -0
  225. package/dist/post-components/p-f994dce8.js +9 -0
  226. package/dist/post-components/p-f994dce8.js.map +1 -0
  227. package/dist/post-components/post-components.esm.js +1 -1
  228. package/dist/post-components/post-components.esm.js.map +1 -1
  229. package/dist/types/components/post-accordion/post-accordion.d.ts +26 -26
  230. package/dist/types/components/post-alert/post-alert.d.ts +45 -45
  231. package/dist/types/components/post-collapsible/post-collapsible.d.ts +31 -31
  232. package/dist/types/components/post-icon/post-icon.d.ts +43 -43
  233. package/dist/types/components/post-popover/post-popover.d.ts +53 -0
  234. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +62 -0
  235. package/dist/types/components/post-tab-header/post-tab-header.d.ts +9 -9
  236. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +8 -8
  237. package/dist/types/components/post-tabs/post-tabs.d.ts +32 -32
  238. package/dist/types/components/post-tooltip/post-tooltip.d.ts +35 -62
  239. package/dist/types/components.d.ts +115 -10
  240. package/dist/types/index.d.ts +3 -0
  241. package/dist/types/stencil-public-runtime.d.ts +8 -0
  242. package/package.json +15 -13
  243. package/dist/cjs/check-non-empty-ae713942.js.map +0 -1
  244. package/dist/cjs/check-one-of-27ad3154.js +0 -10
  245. package/dist/cjs/check-one-of-27ad3154.js.map +0 -1
  246. package/dist/cjs/index-b38a23e0.js +0 -41
  247. package/dist/cjs/index-b38a23e0.js.map +0 -1
  248. package/dist/cjs/index-b619e205.js.map +0 -1
  249. package/dist/cjs/package-4e9ab85c.js +0 -7
  250. package/dist/cjs/package-4e9ab85c.js.map +0 -1
  251. package/dist/cjs/post-alert-b46943e0.js +0 -101
  252. package/dist/cjs/post-icon-5b36814e.js +0 -105
  253. package/dist/cjs/post-icon-5b36814e.js.map +0 -1
  254. package/dist/cjs/post-tab-header-805c0a52.js +0 -33
  255. package/dist/cjs/post-tab-panel-caa44a77.js +0 -27
  256. package/dist/cjs/post-tabs-29d4dc70.js +0 -153
  257. package/dist/cjs/post-tabs-29d4dc70.js.map +0 -1
  258. package/dist/cjs/post-tooltip-32a9c549.js.map +0 -1
  259. package/dist/components/check-one-of.js +0 -8
  260. package/dist/components/check-one-of.js.map +0 -1
  261. package/dist/esm/check-non-empty-09c39561.js +0 -11
  262. package/dist/esm/check-one-of-74750af9.js +0 -8
  263. package/dist/esm/check-one-of-74750af9.js.map +0 -1
  264. package/dist/esm/index-35921354.js +0 -36
  265. package/dist/esm/index-35921354.js.map +0 -1
  266. package/dist/esm/index-4eff5fc5.js.map +0 -1
  267. package/dist/esm/package-b9b10dd3.js +0 -5
  268. package/dist/esm/package-b9b10dd3.js.map +0 -1
  269. package/dist/esm/post-alert-e457e249.js +0 -99
  270. package/dist/esm/post-icon-b34da686.js +0 -103
  271. package/dist/esm/post-icon-b34da686.js.map +0 -1
  272. package/dist/esm/post-tab-header-f0c355d6.js +0 -31
  273. package/dist/esm/post-tab-panel-46f02247.js +0 -25
  274. package/dist/esm/post-tabs-5dd55290.js +0 -151
  275. package/dist/esm/post-tabs-5dd55290.js.map +0 -1
  276. package/dist/esm/post-tooltip-fa7b4a0a.js.map +0 -1
  277. package/dist/post-components/p-1339f8cd.js +0 -2
  278. package/dist/post-components/p-1339f8cd.js.map +0 -1
  279. package/dist/post-components/p-195b8c88.entry.js +0 -2
  280. package/dist/post-components/p-3225e008.entry.js +0 -2
  281. package/dist/post-components/p-61ffffa9.entry.js +0 -2
  282. package/dist/post-components/p-88262544.js +0 -2
  283. package/dist/post-components/p-8b6fe20d.js +0 -2
  284. package/dist/post-components/p-9f71d450.js +0 -2
  285. package/dist/post-components/p-a7649277.js +0 -3
  286. package/dist/post-components/p-a7649277.js.map +0 -1
  287. package/dist/post-components/p-a7c78dea.entry.js +0 -2
  288. package/dist/post-components/p-b2c3ed97.entry.js +0 -2
  289. package/dist/post-components/p-ba9aba3a.entry.js +0 -2
  290. package/dist/post-components/p-bd293ff3.entry.js +0 -2
  291. package/dist/post-components/p-ca1e407c.js +0 -2
  292. package/dist/post-components/p-d407b1c3.js +0 -2
  293. package/dist/post-components/p-d407b1c3.js.map +0 -1
  294. package/dist/post-components/p-dfe29f7f.js +0 -2
  295. package/dist/post-components/p-dfe29f7f.js.map +0 -1
  296. package/dist/post-components/p-fd7015ae.js +0 -9
  297. package/dist/post-components/p-fd7015ae.js.map +0 -1
  298. package/dist/post-components/p-fffce1d7.js +0 -2
  299. /package/dist/post-components/{p-195b8c88.entry.js.map → p-05e85f2b.entry.js.map} +0 -0
  300. /package/dist/post-components/{p-3225e008.entry.js.map → p-08abd53e.entry.js.map} +0 -0
  301. /package/dist/post-components/{p-61ffffa9.entry.js.map → p-1e9ec4a9.entry.js.map} +0 -0
  302. /package/dist/post-components/{p-88262544.js.map → p-30c60b6c.entry.js.map} +0 -0
  303. /package/dist/post-components/{p-a7c78dea.entry.js.map → p-38d97f62.entry.js.map} +0 -0
  304. /package/dist/post-components/{p-b2c3ed97.entry.js.map → p-4c188911.entry.js.map} +0 -0
  305. /package/dist/post-components/{p-ba9aba3a.entry.js.map → p-568bb469.entry.js.map} +0 -0
  306. /package/dist/post-components/{p-bd293ff3.entry.js.map → p-65c8bd5c.entry.js.map} +0 -0
  307. /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
  308. /package/dist/post-components/{p-9f71d450.js.map → p-b4b4f59a.js.map} +0 -0
  309. /package/dist/post-components/{p-7b8797c6.entry.js.map → p-dbd07f20.js.map} +0 -0
  310. /package/dist/post-components/{p-3604be27.js.map → p-eaddd6cc.js.map} +0 -0
@@ -3,262 +3,262 @@ import { checkNonEmpty, checkType, checkEmptyOrType, checkEmptyOrOneOf } from ".
3
3
  import { version } from "../../../package.json";
4
4
  const CDN_URL = 'https://unpkg.com/@swisspost/design-system-icons/public/post-icons';
5
5
  const ANIMATION_NAMES = [
6
- 'cylon',
7
- 'cylon-vertical',
8
- 'spin',
9
- 'spin-reverse',
10
- 'fade',
11
- 'throb',
6
+ 'cylon',
7
+ 'cylon-vertical',
8
+ 'spin',
9
+ 'spin-reverse',
10
+ 'fade',
11
+ 'throb',
12
12
  ];
13
13
  const ANIMATION_KEYS = [...ANIMATION_NAMES];
14
14
  /**
15
15
  * @class PostIcon - representing a stencil component
16
16
  */
17
17
  export class PostIcon {
18
- constructor() {
19
- this.svgStyles = undefined;
20
- this.svgOutput = undefined;
21
- this.animation = null;
22
- this.base = null;
23
- this.flipH = false;
24
- this.flipV = false;
25
- this.name = undefined;
26
- this.rotate = null;
27
- this.scale = null;
28
- }
29
- validateAnimation(newValue = this.animation) {
30
- if (newValue !== undefined)
31
- checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
32
- }
33
- validateBase(newValue = this.base) {
34
- checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
35
- }
36
- validateFlipH(newValue = this.flipH) {
37
- checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
38
- }
39
- validateFlipV(newValue = this.flipV) {
40
- checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
41
- }
42
- validateName(newValue = this.name) {
43
- checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
44
- checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
45
- }
46
- validateRotate(newValue = this.rotate) {
47
- checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
48
- }
49
- validateScale(newValue = this.scale) {
50
- checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
51
- }
52
- componentWillLoad() {
53
- this.validateBase();
54
- this.validateName();
55
- this.validateFlipH();
56
- this.validateFlipV();
57
- this.validateScale();
58
- this.validateRotate();
59
- this.validateAnimation();
60
- }
61
- componentWillRender() {
62
- this.setPath();
63
- }
64
- setPath() {
65
- var _a, _b, _c, _d;
66
- // Construct icon path from different possible sources
67
- const metaBase = (_b = (_a = document.head
68
- .querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base')) !== null && _b !== void 0 ? _b : null;
69
- const fileBase = `${(_d = (_c = this.base) !== null && _c !== void 0 ? _c : metaBase) !== null && _d !== void 0 ? _d : CDN_URL}/`.replace(/\/\/$/, '/');
70
- const fileName = `${this.name}.svg#icon`;
71
- const filePath = `${fileBase}${fileName}`;
72
- this.path = new URL(filePath, window.location.origin).toString();
73
- }
74
- render() {
75
- // create inline styles for some properties
76
- const svgStyles = Object.entries({
77
- '-webkit-mask-image': `url('${this.path}')`,
78
- 'mask-image': `url('${this.path}')`,
79
- 'scale': this.scale && !isNaN(Number(this.scale)) ? `${this.scale}` : null,
80
- 'rotate': this.rotate && !isNaN(Number(this.rotate)) ? `${this.rotate}deg` : null,
81
- })
82
- .filter(([_key, value]) => value !== null)
83
- .reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
84
- return (h(Host, { "data-version": version }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", style: svgStyles })));
85
- }
86
- static get is() { return "post-icon"; }
87
- static get encapsulation() { return "shadow"; }
88
- static get originalStyleUrls() {
89
- return {
90
- "$": ["post-icon.scss"]
91
- };
92
- }
93
- static get styleUrls() {
94
- return {
95
- "$": ["post-icon.css"]
96
- };
97
- }
98
- static get properties() {
99
- return {
100
- "animation": {
101
- "type": "string",
102
- "mutable": false,
103
- "complexType": {
104
- "original": "Animation | null",
105
- "resolved": "\"cylon\" | \"cylon-vertical\" | \"fade\" | \"spin\" | \"spin-reverse\" | \"throb\"",
106
- "references": {
107
- "Animation": {
108
- "location": "global",
109
- "id": "global::Animation"
18
+ constructor() {
19
+ this.svgStyles = undefined;
20
+ this.svgOutput = undefined;
21
+ this.animation = null;
22
+ this.base = null;
23
+ this.flipH = false;
24
+ this.flipV = false;
25
+ this.name = undefined;
26
+ this.rotate = null;
27
+ this.scale = null;
28
+ }
29
+ validateAnimation(newValue = this.animation) {
30
+ if (newValue !== undefined)
31
+ checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
32
+ }
33
+ validateBase(newValue = this.base) {
34
+ checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
35
+ }
36
+ validateFlipH(newValue = this.flipH) {
37
+ checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
38
+ }
39
+ validateFlipV(newValue = this.flipV) {
40
+ checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
41
+ }
42
+ validateName(newValue = this.name) {
43
+ checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
44
+ checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
45
+ }
46
+ validateRotate(newValue = this.rotate) {
47
+ checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
48
+ }
49
+ validateScale(newValue = this.scale) {
50
+ checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
51
+ }
52
+ componentWillLoad() {
53
+ this.validateBase();
54
+ this.validateName();
55
+ this.validateFlipH();
56
+ this.validateFlipV();
57
+ this.validateScale();
58
+ this.validateRotate();
59
+ this.validateAnimation();
60
+ }
61
+ componentWillRender() {
62
+ this.setPath();
63
+ }
64
+ setPath() {
65
+ var _a, _b, _c, _d;
66
+ // Construct icon path from different possible sources
67
+ const metaBase = (_b = (_a = document.head
68
+ .querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base')) !== null && _b !== void 0 ? _b : null;
69
+ const fileBase = `${(_d = (_c = this.base) !== null && _c !== void 0 ? _c : metaBase) !== null && _d !== void 0 ? _d : CDN_URL}/`.replace(/\/\/$/, '/');
70
+ const fileName = `${this.name}.svg#icon`;
71
+ const filePath = `${fileBase}${fileName}`;
72
+ this.path = new URL(filePath, window.location.origin).toString();
73
+ }
74
+ render() {
75
+ // create inline styles for some properties
76
+ const svgStyles = Object.entries({
77
+ '-webkit-mask-image': `url('${this.path}')`,
78
+ 'mask-image': `url('${this.path}')`,
79
+ 'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
80
+ (this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
81
+ })
82
+ .filter(([_key, value]) => value !== null)
83
+ .reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
84
+ return (h(Host, { "data-version": version }, h("span", { style: svgStyles })));
85
+ }
86
+ static get is() { return "post-icon"; }
87
+ static get encapsulation() { return "shadow"; }
88
+ static get originalStyleUrls() {
89
+ return {
90
+ "$": ["post-icon.scss"]
91
+ };
92
+ }
93
+ static get styleUrls() {
94
+ return {
95
+ "$": ["post-icon.css"]
96
+ };
97
+ }
98
+ static get properties() {
99
+ return {
100
+ "animation": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "Animation | null",
105
+ "resolved": "\"cylon\" | \"cylon-vertical\" | \"fade\" | \"spin\" | \"spin-reverse\" | \"throb\"",
106
+ "references": {
107
+ "Animation": {
108
+ "location": "global",
109
+ "id": "global::Animation"
110
+ }
111
+ }
112
+ },
113
+ "required": false,
114
+ "optional": true,
115
+ "docs": {
116
+ "tags": [],
117
+ "text": "The name of the animation."
118
+ },
119
+ "attribute": "animation",
120
+ "reflect": false,
121
+ "defaultValue": "null"
122
+ },
123
+ "base": {
124
+ "type": "string",
125
+ "mutable": false,
126
+ "complexType": {
127
+ "original": "string | null",
128
+ "resolved": "string",
129
+ "references": {}
130
+ },
131
+ "required": false,
132
+ "optional": true,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url."
136
+ },
137
+ "attribute": "base",
138
+ "reflect": false,
139
+ "defaultValue": "null"
140
+ },
141
+ "flipH": {
142
+ "type": "boolean",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "boolean",
146
+ "resolved": "boolean",
147
+ "references": {}
148
+ },
149
+ "required": false,
150
+ "optional": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": "When set to `true`, the icon will be flipped horizontally."
154
+ },
155
+ "attribute": "flip-h",
156
+ "reflect": false,
157
+ "defaultValue": "false"
158
+ },
159
+ "flipV": {
160
+ "type": "boolean",
161
+ "mutable": false,
162
+ "complexType": {
163
+ "original": "boolean",
164
+ "resolved": "boolean",
165
+ "references": {}
166
+ },
167
+ "required": false,
168
+ "optional": true,
169
+ "docs": {
170
+ "tags": [],
171
+ "text": "When set to `true`, the icon will be flipped vertically."
172
+ },
173
+ "attribute": "flip-v",
174
+ "reflect": false,
175
+ "defaultValue": "false"
176
+ },
177
+ "name": {
178
+ "type": "string",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "string",
182
+ "resolved": "string",
183
+ "references": {}
184
+ },
185
+ "required": true,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": "The name/id of the icon (e.g. 1000, 1001, ...)."
190
+ },
191
+ "attribute": "name",
192
+ "reflect": false
193
+ },
194
+ "rotate": {
195
+ "type": "number",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "number | null",
199
+ "resolved": "number",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": true,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "The number of degree for the css rotate transformation."
207
+ },
208
+ "attribute": "rotate",
209
+ "reflect": false,
210
+ "defaultValue": "null"
211
+ },
212
+ "scale": {
213
+ "type": "number",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "number | null",
217
+ "resolved": "number",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": true,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "The number for the css scale transformation."
225
+ },
226
+ "attribute": "scale",
227
+ "reflect": false,
228
+ "defaultValue": "null"
110
229
  }
111
- }
112
- },
113
- "required": false,
114
- "optional": true,
115
- "docs": {
116
- "tags": [],
117
- "text": "The name of the animation."
118
- },
119
- "attribute": "animation",
120
- "reflect": false,
121
- "defaultValue": "null"
122
- },
123
- "base": {
124
- "type": "string",
125
- "mutable": false,
126
- "complexType": {
127
- "original": "string | null",
128
- "resolved": "string",
129
- "references": {}
130
- },
131
- "required": false,
132
- "optional": true,
133
- "docs": {
134
- "tags": [],
135
- "text": "The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url."
136
- },
137
- "attribute": "base",
138
- "reflect": false,
139
- "defaultValue": "null"
140
- },
141
- "flipH": {
142
- "type": "boolean",
143
- "mutable": false,
144
- "complexType": {
145
- "original": "boolean",
146
- "resolved": "boolean",
147
- "references": {}
148
- },
149
- "required": false,
150
- "optional": true,
151
- "docs": {
152
- "tags": [],
153
- "text": "When set to `true`, the icon will be flipped horizontally."
154
- },
155
- "attribute": "flip-h",
156
- "reflect": false,
157
- "defaultValue": "false"
158
- },
159
- "flipV": {
160
- "type": "boolean",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "boolean",
164
- "resolved": "boolean",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": true,
169
- "docs": {
170
- "tags": [],
171
- "text": "When set to `true`, the icon will be flipped vertically."
172
- },
173
- "attribute": "flip-v",
174
- "reflect": false,
175
- "defaultValue": "false"
176
- },
177
- "name": {
178
- "type": "string",
179
- "mutable": false,
180
- "complexType": {
181
- "original": "string",
182
- "resolved": "string",
183
- "references": {}
184
- },
185
- "required": true,
186
- "optional": false,
187
- "docs": {
188
- "tags": [],
189
- "text": "The name/id of the icon (e.g. 1000, 1001, ...)."
190
- },
191
- "attribute": "name",
192
- "reflect": false
193
- },
194
- "rotate": {
195
- "type": "number",
196
- "mutable": false,
197
- "complexType": {
198
- "original": "number | null",
199
- "resolved": "number",
200
- "references": {}
201
- },
202
- "required": false,
203
- "optional": true,
204
- "docs": {
205
- "tags": [],
206
- "text": "The number of degree for the css rotate transformation."
207
- },
208
- "attribute": "rotate",
209
- "reflect": false,
210
- "defaultValue": "null"
211
- },
212
- "scale": {
213
- "type": "number",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "number | null",
217
- "resolved": "number",
218
- "references": {}
219
- },
220
- "required": false,
221
- "optional": true,
222
- "docs": {
223
- "tags": [],
224
- "text": "The number for the css scale transformation."
225
- },
226
- "attribute": "scale",
227
- "reflect": false,
228
- "defaultValue": "null"
229
- }
230
- };
231
- }
232
- static get states() {
233
- return {
234
- "svgStyles": {},
235
- "svgOutput": {}
236
- };
237
- }
238
- static get elementRef() { return "host"; }
239
- static get watchers() {
240
- return [{
241
- "propName": "animation",
242
- "methodName": "validateAnimation"
243
- }, {
244
- "propName": "base",
245
- "methodName": "validateBase"
246
- }, {
247
- "propName": "flipH",
248
- "methodName": "validateFlipH"
249
- }, {
250
- "propName": "flipV",
251
- "methodName": "validateFlipV"
252
- }, {
253
- "propName": "name",
254
- "methodName": "validateName"
255
- }, {
256
- "propName": "rotate",
257
- "methodName": "validateRotate"
258
- }, {
259
- "propName": "scale",
260
- "methodName": "validateScale"
261
- }];
262
- }
230
+ };
231
+ }
232
+ static get states() {
233
+ return {
234
+ "svgStyles": {},
235
+ "svgOutput": {}
236
+ };
237
+ }
238
+ static get elementRef() { return "host"; }
239
+ static get watchers() {
240
+ return [{
241
+ "propName": "animation",
242
+ "methodName": "validateAnimation"
243
+ }, {
244
+ "propName": "base",
245
+ "methodName": "validateBase"
246
+ }, {
247
+ "propName": "flipH",
248
+ "methodName": "validateFlipH"
249
+ }, {
250
+ "propName": "flipV",
251
+ "methodName": "validateFlipV"
252
+ }, {
253
+ "propName": "name",
254
+ "methodName": "validateName"
255
+ }, {
256
+ "propName": "rotate",
257
+ "methodName": "validateRotate"
258
+ }, {
259
+ "propName": "scale",
260
+ "methodName": "validateScale"
261
+ }];
262
+ }
263
263
  }
264
264
  //# sourceMappingURL=post-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-icon.js","sourceRoot":"","sources":["../../../../src/components/post-icon/post-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAA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O,CAAC;MAC/B,oBAAoB,EAAE,QAAQ,IAAI,CAAC,IAAI,IAAI;MAC3C,YAAY,EAAE,QAAQ,IAAI,CAAC,IAAI,IAAI;MACnC,OAAO,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI;MAC1E,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,IAAI;KAClF,CAAC;OACC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC;OACzC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEjF,OAAO,CACL,EAAC,IAAI,oBAAe,OAAO;MACzB,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAE,SAAS,GACtE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop, State, Watch } from '@stencil/core';\nimport { checkNonEmpty, checkType, checkEmptyOrType, checkEmptyOrOneOf } from '../../utils';\nimport { version } from '../../../package.json';\n\nconst CDN_URL = 'https://unpkg.com/@swisspost/design-system-icons/public/post-icons';\nconst ANIMATION_NAMES = [\n 'cylon',\n 'cylon-vertical',\n 'spin',\n 'spin-reverse',\n 'fade',\n 'throb',\n] as const;\nconst ANIMATION_KEYS = [...ANIMATION_NAMES];\n\ntype Animation = (typeof ANIMATION_NAMES)[number];\n\n/**\n * @class PostIcon - representing a stencil component\n */\n@Component({\n tag: 'post-icon',\n styleUrl: 'post-icon.scss',\n shadow: true,\n})\nexport class PostIcon {\n private path: string;\n\n @Element() host: HTMLPostIconElement;\n\n @State() svgStyles: string;\n @State() svgOutput: string;\n\n /**\n * The name of the animation.\n */\n @Prop() readonly animation?: Animation | null = null;\n\n @Watch('animation')\n validateAnimation(newValue = this.animation) {\n if (newValue !== undefined)\n checkEmptyOrOneOf(\n newValue,\n ANIMATION_KEYS,\n `The post-icon \"animation\" prop requires one of the following values: ${ANIMATION_KEYS.join(\n ', ',\n )}.`,\n );\n }\n\n /**\n * The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.\n */\n @Prop() readonly base?: string | null = null;\n\n @Watch('base')\n validateBase(newValue = this.base) {\n checkEmptyOrType(newValue, 'string', 'The post-icon \"base\" prop should be a string.');\n }\n\n /**\n * When set to `true`, the icon will be flipped horizontally.\n */\n @Prop() readonly flipH?: boolean = false;\n\n @Watch('flipH')\n validateFlipH(newValue = this.flipH) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipH\" prop should be a boolean.');\n }\n\n /**\n * When set to `true`, the icon will be flipped vertically.\n */\n @Prop() readonly flipV?: boolean = false;\n\n @Watch('flipV')\n validateFlipV(newValue = this.flipV) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipV\" prop should be a boolean.');\n }\n\n /**\n * The name/id of the icon (e.g. 1000, 1001, ...).\n */\n @Prop() readonly name!: string;\n\n @Watch('name')\n validateName(newValue = this.name) {\n checkNonEmpty(newValue, 'The post-icon \"name\" prop is required!.');\n checkType(newValue, 'string', 'The post-icon \"name\" prop should be a string.');\n }\n\n /**\n * The number of degree for the css rotate transformation.\n */\n @Prop() readonly rotate?: number | null = null;\n\n @Watch('rotate')\n validateRotate(newValue = this.rotate) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"rotate\" prop should be a number.');\n }\n\n /**\n * The number for the css scale transformation.\n */\n @Prop() readonly scale?: number | null = null;\n\n @Watch('scale')\n validateScale(newValue = this.scale) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"scale\" prop should be a number.');\n }\n\n componentWillLoad() {\n this.validateBase();\n this.validateName();\n this.validateFlipH();\n this.validateFlipV();\n this.validateScale();\n this.validateRotate();\n this.validateAnimation();\n }\n\n componentWillRender() {\n this.setPath();\n }\n\n private setPath() {\n // Construct icon path from different possible sources\n const metaBase =\n document.head\n .querySelector('meta[name=\"design-system-settings\"][data-post-icon-base]')\n ?.getAttribute('data-post-icon-base') ?? null;\n\n const fileBase = `${this.base ?? metaBase ?? CDN_URL}/`.replace(/\\/\\/$/, '/');\n const fileName = `${this.name}.svg#icon`;\n const filePath = `${fileBase}${fileName}`;\n\n this.path = new URL(filePath, window.location.origin).toString();\n }\n\n render() {\n // create inline styles for some properties\n const svgStyles = Object.entries({\n '-webkit-mask-image': `url('${this.path}')`,\n 'mask-image': `url('${this.path}')`,\n 'scale': this.scale && !isNaN(Number(this.scale)) ? `${this.scale}` : null,\n 'rotate': this.rotate && !isNaN(Number(this.rotate)) ? `${this.rotate}deg` : null,\n })\n .filter(([_key, value]) => value !== null)\n .reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});\n\n return (\n <Host data-version={version}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\" style={svgStyles}>\n </svg>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"post-icon.js","sourceRoot":"","sources":["../../../../src/components/post-icon/post-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA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element, Host, h, Prop, State, Watch } from '@stencil/core';\nimport { checkNonEmpty, checkType, checkEmptyOrType, checkEmptyOrOneOf } from '../../utils';\nimport { version } from '../../../package.json';\n\nconst CDN_URL = 'https://unpkg.com/@swisspost/design-system-icons/public/post-icons';\nconst ANIMATION_NAMES = [\n 'cylon',\n 'cylon-vertical',\n 'spin',\n 'spin-reverse',\n 'fade',\n 'throb',\n] as const;\nconst ANIMATION_KEYS = [...ANIMATION_NAMES];\n\ntype Animation = (typeof ANIMATION_NAMES)[number];\n\n/**\n * @class PostIcon - representing a stencil component\n */\n@Component({\n tag: 'post-icon',\n styleUrl: 'post-icon.scss',\n shadow: true,\n})\nexport class PostIcon {\n private path: string;\n\n @Element() host: HTMLPostIconElement;\n\n @State() svgStyles: string;\n @State() svgOutput: string;\n\n /**\n * The name of the animation.\n */\n @Prop() readonly animation?: Animation | null = null;\n\n @Watch('animation')\n validateAnimation(newValue = this.animation) {\n if (newValue !== undefined)\n checkEmptyOrOneOf(\n newValue,\n ANIMATION_KEYS,\n `The post-icon \"animation\" prop requires one of the following values: ${ANIMATION_KEYS.join(\n ', ',\n )}.`,\n );\n }\n\n /**\n * The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.\n */\n @Prop() readonly base?: string | null = null;\n\n @Watch('base')\n validateBase(newValue = this.base) {\n checkEmptyOrType(newValue, 'string', 'The post-icon \"base\" prop should be a string.');\n }\n\n /**\n * When set to `true`, the icon will be flipped horizontally.\n */\n @Prop() readonly flipH?: boolean = false;\n\n @Watch('flipH')\n validateFlipH(newValue = this.flipH) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipH\" prop should be a boolean.');\n }\n\n /**\n * When set to `true`, the icon will be flipped vertically.\n */\n @Prop() readonly flipV?: boolean = false;\n\n @Watch('flipV')\n validateFlipV(newValue = this.flipV) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipV\" prop should be a boolean.');\n }\n\n /**\n * The name/id of the icon (e.g. 1000, 1001, ...).\n */\n @Prop() readonly name!: string;\n\n @Watch('name')\n validateName(newValue = this.name) {\n checkNonEmpty(newValue, 'The post-icon \"name\" prop is required!.');\n checkType(newValue, 'string', 'The post-icon \"name\" prop should be a string.');\n }\n\n /**\n * The number of degree for the css rotate transformation.\n */\n @Prop() readonly rotate?: number | null = null;\n\n @Watch('rotate')\n validateRotate(newValue = this.rotate) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"rotate\" prop should be a number.');\n }\n\n /**\n * The number for the css scale transformation.\n */\n @Prop() readonly scale?: number | null = null;\n\n @Watch('scale')\n validateScale(newValue = this.scale) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"scale\" prop should be a number.');\n }\n\n componentWillLoad() {\n this.validateBase();\n this.validateName();\n this.validateFlipH();\n this.validateFlipV();\n this.validateScale();\n this.validateRotate();\n this.validateAnimation();\n }\n\n componentWillRender() {\n this.setPath();\n }\n\n private setPath() {\n // Construct icon path from different possible sources\n const metaBase =\n document.head\n .querySelector('meta[name=\"design-system-settings\"][data-post-icon-base]')\n ?.getAttribute('data-post-icon-base') ?? null;\n\n const fileBase = `${this.base ?? metaBase ?? CDN_URL}/`.replace(/\\/\\/$/, '/');\n const fileName = `${this.name}.svg#icon`;\n const filePath = `${fileBase}${fileName}`;\n\n this.path = new URL(filePath, window.location.origin).toString();\n }\n\n render() {\n // create inline styles for some properties\n const svgStyles = Object.entries({\n '-webkit-mask-image': `url('${this.path}')`,\n 'mask-image': `url('${this.path}')`,\n 'transform':\n (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +\n (this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),\n })\n .filter(([_key, value]) => value !== null)\n .reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});\n return (\n <Host data-version={version}>\n <span style={svgStyles}></span>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ /*!
2
+ * Copyright 2021 by Swiss Post, Information Technology
3
+ */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;content:"";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51;display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;max-width:min(66vw,60rem)}@media(max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}