@swisspost/design-system-components 1.6.3 → 1.7.1
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.
- package/dist/cjs/{check-non-empty-ae713942.js → check-non-empty-eeaa8f77.js} +4 -4
- package/dist/cjs/check-non-empty-eeaa8f77.js.map +1 -0
- package/dist/cjs/index-8c288b1a.js +45 -0
- package/dist/cjs/index-8c288b1a.js.map +1 -0
- package/dist/cjs/{index-b619e205.js → index-c07c0cdb.js} +144 -65
- package/dist/cjs/index-c07c0cdb.js.map +1 -0
- package/dist/cjs/index.cjs.js +17 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-989e0b36.js +7 -0
- package/dist/cjs/package-989e0b36.js.map +1 -0
- package/dist/cjs/post-accordion-bc0c6f31.js +87 -0
- package/dist/cjs/post-accordion-bc0c6f31.js.map +1 -0
- package/dist/cjs/post-accordion.cjs.entry.js +4 -80
- package/dist/cjs/post-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/post-alert-39ac30a4.js +101 -0
- package/dist/cjs/{post-alert-b46943e0.js.map → post-alert-39ac30a4.js.map} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +5 -6
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/{post-collapsible-04364cda.js → post-collapsible-85f8ace5.js} +69 -69
- package/dist/cjs/{post-collapsible-04364cda.js.map → post-collapsible-85f8ace5.js.map} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-components.cjs.js.map +1 -1
- package/dist/cjs/post-icon-53e50c15.js +105 -0
- package/dist/cjs/post-icon-53e50c15.js.map +1 -0
- package/dist/cjs/post-icon.cjs.entry.js +5 -6
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-popover-5a75c1b2.js +118 -0
- package/dist/cjs/post-popover-5a75c1b2.js.map +1 -0
- package/dist/cjs/post-popover.cjs.entry.js +13 -0
- package/dist/cjs/post-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/post-popovercontainer-84378594.js +1878 -0
- package/dist/cjs/post-popovercontainer-84378594.js.map +1 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js +13 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-header-02c6e31e.js +33 -0
- package/dist/cjs/{post-tab-header-805c0a52.js.map → post-tab-header-02c6e31e.js.map} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-panel-3973b707.js +27 -0
- package/dist/cjs/{post-tab-panel-caa44a77.js.map → post-tab-panel-3973b707.js.map} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs-7a4fead7.js +153 -0
- package/dist/cjs/post-tabs-7a4fead7.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tooltip-32a9c549.js → post-tooltip-79a9c96d.js} +78 -1754
- package/dist/cjs/post-tooltip-79a9c96d.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -4
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/collapse.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +167 -166
- package/dist/collection/components/post-accordion/post-accordion.js.map +1 -1
- package/dist/collection/components/post-alert/post-alert.css +2 -2
- package/dist/collection/components/post-alert/post-alert.js +246 -246
- package/dist/collection/components/post-alert/post-alert.js.map +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +169 -168
- package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +250 -250
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/components/post-popover/post-popover.css +3 -0
- package/dist/collection/components/post-popover/post-popover.js +267 -0
- package/dist/collection/components/post-popover/post-popover.js.map +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +288 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js.map +1 -0
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +62 -62
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +50 -50
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +224 -223
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +192 -325
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/is-motion-reduced.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-non-empty.js +3 -3
- package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -2
- package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-type.js +10 -10
- package/dist/collection/utils/property-checkers/check-type.js.map +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +5 -5
- package/dist/collection/utils/property-checkers/empty-or.js.map +1 -1
- package/dist/components/check-non-empty.js +3 -3
- package/dist/components/check-non-empty.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +22 -18
- package/dist/components/index2.js.map +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion.d.ts +2 -2
- package/dist/components/post-accordion.js +1 -101
- package/dist/components/post-accordion.js.map +1 -1
- package/dist/components/post-accordion2.js +105 -0
- package/dist/components/post-accordion2.js.map +1 -0
- package/dist/components/post-alert.d.ts +2 -2
- package/dist/components/post-alert2.js +119 -119
- package/dist/components/post-alert2.js.map +1 -1
- package/dist/components/post-collapsible.d.ts +2 -2
- package/dist/components/post-collapsible2.js +90 -90
- package/dist/components/post-collapsible2.js.map +1 -1
- package/dist/components/post-icon.d.ts +2 -2
- package/dist/components/post-icon2.js +118 -118
- package/dist/components/post-icon2.js.map +1 -1
- package/dist/components/post-popover.d.ts +11 -0
- package/dist/components/post-popover.js +8 -0
- package/dist/components/post-popover.js.map +1 -0
- package/dist/components/post-popover2.js +144 -0
- package/dist/components/post-popover2.js.map +1 -0
- package/dist/components/post-popovercontainer.d.ts +11 -0
- package/dist/components/post-popovercontainer.js +8 -0
- package/dist/components/post-popovercontainer.js.map +1 -0
- package/dist/components/post-popovercontainer2.js +1897 -0
- package/dist/components/post-popovercontainer2.js.map +1 -0
- package/dist/components/post-tab-header.d.ts +2 -2
- package/dist/components/post-tab-header2.js +38 -38
- package/dist/components/post-tab-header2.js.map +1 -1
- package/dist/components/post-tab-panel.d.ts +2 -2
- package/dist/components/post-tab-panel2.js +30 -30
- package/dist/components/post-tab-panel2.js.map +1 -1
- package/dist/components/post-tabs.d.ts +2 -2
- package/dist/components/post-tabs2.js +147 -147
- package/dist/components/post-tabs2.js.map +1 -1
- package/dist/components/post-tooltip.d.ts +2 -2
- package/dist/components/post-tooltip2.js +100 -1774
- package/dist/components/post-tooltip2.js.map +1 -1
- package/dist/docs.d.ts +1 -21
- package/dist/docs.json +604 -77
- package/dist/esm/check-non-empty-58bd6b17.js +11 -0
- package/dist/esm/{check-non-empty-09c39561.js.map → check-non-empty-58bd6b17.js.map} +1 -1
- package/dist/esm/index-1427953c.js +40 -0
- package/dist/esm/index-1427953c.js.map +1 -0
- package/dist/esm/{index-4eff5fc5.js → index-35998e08.js} +144 -65
- package/dist/esm/index-35998e08.js.map +1 -0
- package/dist/esm/index.js +14 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-e13ef9ad.js +5 -0
- package/dist/esm/package-e13ef9ad.js.map +1 -0
- package/dist/esm/post-accordion-8e96598a.js +85 -0
- package/dist/esm/post-accordion-8e96598a.js.map +1 -0
- package/dist/esm/post-accordion.entry.js +3 -83
- package/dist/esm/post-accordion.entry.js.map +1 -1
- package/dist/esm/post-alert-5e352303.js +99 -0
- package/dist/esm/{post-alert-e457e249.js.map → post-alert-5e352303.js.map} +1 -1
- package/dist/esm/post-alert.entry.js +5 -6
- package/dist/esm/post-alert.entry.js.map +1 -1
- package/dist/esm/{post-collapsible-c0a826b2.js → post-collapsible-3cc5dd87.js} +69 -69
- package/dist/esm/{post-collapsible-c0a826b2.js.map → post-collapsible-3cc5dd87.js.map} +1 -1
- package/dist/esm/post-collapsible.entry.js +4 -5
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-components.js.map +1 -1
- package/dist/esm/post-icon-fdda3f99.js +103 -0
- package/dist/esm/post-icon-fdda3f99.js.map +1 -0
- package/dist/esm/post-icon.entry.js +5 -6
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-popover-ff2c259f.js +116 -0
- package/dist/esm/post-popover-ff2c259f.js.map +1 -0
- package/dist/esm/post-popover.entry.js +5 -0
- package/dist/esm/post-popover.entry.js.map +1 -0
- package/dist/esm/post-popovercontainer-f4cd18cd.js +1876 -0
- package/dist/esm/post-popovercontainer-f4cd18cd.js.map +1 -0
- package/dist/esm/post-popovercontainer.entry.js +5 -0
- package/dist/esm/post-popovercontainer.entry.js.map +1 -0
- package/dist/esm/post-tab-header-486b267b.js +31 -0
- package/dist/esm/{post-tab-header-f0c355d6.js.map → post-tab-header-486b267b.js.map} +1 -1
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel-13940300.js +25 -0
- package/dist/esm/{post-tab-panel-46f02247.js.map → post-tab-panel-13940300.js.map} +1 -1
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs-6f44ed1d.js +151 -0
- package/dist/esm/post-tabs-6f44ed1d.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tooltip-fa7b4a0a.js → post-tooltip-1d99cd0c.js} +78 -1754
- package/dist/esm/post-tooltip-1d99cd0c.js.map +1 -0
- package/dist/esm/post-tooltip.entry.js +3 -4
- package/dist/esm/post-tooltip.entry.js.map +1 -1
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-169b8ef7.entry.js +2 -0
- package/dist/post-components/p-28be44d7.js +2 -0
- package/dist/post-components/{p-8b6fe20d.js.map → p-28be44d7.js.map} +1 -1
- package/dist/post-components/p-3ef3a1d2.js +2 -0
- package/dist/post-components/p-3ef3a1d2.js.map +1 -0
- package/dist/post-components/p-4b94c2a1.entry.js +2 -0
- package/dist/post-components/p-4cbb5212.entry.js +2 -0
- package/dist/post-components/p-51ae6f46.entry.js +2 -0
- package/dist/post-components/p-668bf58c.entry.js +2 -0
- package/dist/post-components/p-67d0a4fa.entry.js +2 -0
- package/dist/post-components/p-6b3a5063.entry.js +2 -0
- package/dist/post-components/{p-3604be27.js → p-6cdc82c6.js} +2 -2
- package/dist/post-components/p-723336f2.js +2 -0
- package/dist/post-components/{p-ca1e407c.js.map → p-723336f2.js.map} +1 -1
- package/dist/post-components/p-7d08e4f1.js +2 -0
- package/dist/post-components/p-7d08e4f1.js.map +1 -0
- package/dist/post-components/p-81591ad0.js +3 -0
- package/dist/post-components/p-81591ad0.js.map +1 -0
- package/dist/post-components/p-96f4ebc4.js +2 -0
- package/dist/post-components/p-96f4ebc4.js.map +1 -0
- package/dist/post-components/p-9b1b6e06.entry.js +2 -0
- package/dist/post-components/{p-9f71d450.js → p-a5a23448.js} +2 -2
- package/dist/post-components/p-aca6e9c1.js +2 -0
- package/dist/post-components/{p-fffce1d7.js.map → p-aca6e9c1.js.map} +1 -1
- package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
- package/dist/post-components/p-bc27f061.js +9 -0
- package/dist/post-components/p-bc27f061.js.map +1 -0
- package/dist/post-components/p-bd1d0117.js +2 -0
- package/dist/post-components/p-bd1d0117.js.map +1 -0
- package/dist/post-components/p-d3ed113e.js +2 -0
- package/dist/post-components/p-d3ed113e.js.map +1 -0
- package/dist/post-components/p-d8365401.entry.js +2 -0
- package/dist/post-components/p-d8365401.entry.js.map +1 -0
- package/dist/post-components/p-e78d158d.entry.js +2 -0
- package/dist/post-components/p-e78d158d.entry.js.map +1 -0
- package/dist/post-components/{p-7b8797c6.entry.js → p-f695aab4.js} +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +26 -26
- package/dist/types/components/post-alert/post-alert.d.ts +45 -45
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +31 -31
- package/dist/types/components/post-icon/post-icon.d.ts +43 -43
- package/dist/types/components/post-popover/post-popover.d.ts +53 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +62 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +9 -9
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +8 -8
- package/dist/types/components/post-tabs/post-tabs.d.ts +32 -32
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +35 -62
- package/dist/types/components.d.ts +115 -10
- package/dist/types/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/package.json +15 -13
- package/dist/cjs/check-non-empty-ae713942.js.map +0 -1
- package/dist/cjs/check-one-of-27ad3154.js +0 -10
- package/dist/cjs/check-one-of-27ad3154.js.map +0 -1
- package/dist/cjs/index-b38a23e0.js +0 -41
- package/dist/cjs/index-b38a23e0.js.map +0 -1
- package/dist/cjs/index-b619e205.js.map +0 -1
- package/dist/cjs/package-4e9ab85c.js +0 -7
- package/dist/cjs/package-4e9ab85c.js.map +0 -1
- package/dist/cjs/post-alert-b46943e0.js +0 -101
- package/dist/cjs/post-icon-5b36814e.js +0 -105
- package/dist/cjs/post-icon-5b36814e.js.map +0 -1
- package/dist/cjs/post-tab-header-805c0a52.js +0 -33
- package/dist/cjs/post-tab-panel-caa44a77.js +0 -27
- package/dist/cjs/post-tabs-29d4dc70.js +0 -153
- package/dist/cjs/post-tabs-29d4dc70.js.map +0 -1
- package/dist/cjs/post-tooltip-32a9c549.js.map +0 -1
- package/dist/components/check-one-of.js +0 -8
- package/dist/components/check-one-of.js.map +0 -1
- package/dist/esm/check-non-empty-09c39561.js +0 -11
- package/dist/esm/check-one-of-74750af9.js +0 -8
- package/dist/esm/check-one-of-74750af9.js.map +0 -1
- package/dist/esm/index-35921354.js +0 -36
- package/dist/esm/index-35921354.js.map +0 -1
- package/dist/esm/index-4eff5fc5.js.map +0 -1
- package/dist/esm/package-b9b10dd3.js +0 -5
- package/dist/esm/package-b9b10dd3.js.map +0 -1
- package/dist/esm/post-alert-e457e249.js +0 -99
- package/dist/esm/post-icon-b34da686.js +0 -103
- package/dist/esm/post-icon-b34da686.js.map +0 -1
- package/dist/esm/post-tab-header-f0c355d6.js +0 -31
- package/dist/esm/post-tab-panel-46f02247.js +0 -25
- package/dist/esm/post-tabs-5dd55290.js +0 -151
- package/dist/esm/post-tabs-5dd55290.js.map +0 -1
- package/dist/esm/post-tooltip-fa7b4a0a.js.map +0 -1
- package/dist/post-components/p-1339f8cd.js +0 -2
- package/dist/post-components/p-1339f8cd.js.map +0 -1
- package/dist/post-components/p-195b8c88.entry.js +0 -2
- package/dist/post-components/p-3225e008.entry.js +0 -2
- package/dist/post-components/p-61ffffa9.entry.js +0 -2
- package/dist/post-components/p-88262544.js +0 -2
- package/dist/post-components/p-8b6fe20d.js +0 -2
- package/dist/post-components/p-a7649277.js +0 -3
- package/dist/post-components/p-a7649277.js.map +0 -1
- package/dist/post-components/p-a7c78dea.entry.js +0 -2
- package/dist/post-components/p-b2c3ed97.entry.js +0 -2
- package/dist/post-components/p-ba9aba3a.entry.js +0 -2
- package/dist/post-components/p-bd293ff3.entry.js +0 -2
- package/dist/post-components/p-ca1e407c.js +0 -2
- package/dist/post-components/p-d407b1c3.js +0 -2
- package/dist/post-components/p-d407b1c3.js.map +0 -1
- package/dist/post-components/p-dfe29f7f.js +0 -2
- package/dist/post-components/p-dfe29f7f.js.map +0 -1
- package/dist/post-components/p-fd7015ae.js +0 -9
- package/dist/post-components/p-fd7015ae.js.map +0 -1
- package/dist/post-components/p-fffce1d7.js +0 -2
- /package/dist/post-components/{p-195b8c88.entry.js.map → p-169b8ef7.entry.js.map} +0 -0
- /package/dist/post-components/{p-3225e008.entry.js.map → p-4b94c2a1.entry.js.map} +0 -0
- /package/dist/post-components/{p-61ffffa9.entry.js.map → p-4cbb5212.entry.js.map} +0 -0
- /package/dist/post-components/{p-88262544.js.map → p-51ae6f46.entry.js.map} +0 -0
- /package/dist/post-components/{p-a7c78dea.entry.js.map → p-668bf58c.entry.js.map} +0 -0
- /package/dist/post-components/{p-b2c3ed97.entry.js.map → p-67d0a4fa.entry.js.map} +0 -0
- /package/dist/post-components/{p-ba9aba3a.entry.js.map → p-6b3a5063.entry.js.map} +0 -0
- /package/dist/post-components/{p-3604be27.js.map → p-6cdc82c6.js.map} +0 -0
- /package/dist/post-components/{p-bd293ff3.entry.js.map → p-9b1b6e06.entry.js.map} +0 -0
- /package/dist/post-components/{p-9f71d450.js.map → p-a5a23448.js.map} +0 -0
- /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
- /package/dist/post-components/{p-7b8797c6.entry.js.map → p-f695aab4.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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,OAAO,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 '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}
|