@swisspost/design-system-components 10.0.0-next.38 → 10.0.0-next.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-2b2b85e5.js +96 -0
- package/dist/cjs/index-b60129c4.js +2 -6
- package/dist/cjs/index.cjs.js +23 -29
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-3e61e6f3.js → package-b731881e.js} +1 -1
- package/dist/cjs/placement-b2bb6ec4.js +18 -0
- package/dist/cjs/post-accordion-item-5c879102.js +161 -0
- package/dist/cjs/post-accordion_2.cjs.entry.js +16 -0
- package/dist/cjs/{post-avatar-22bfd12e.js → post-avatar-4f1681df.js} +21 -4
- package/dist/cjs/post-avatar.cjs.entry.js +3 -4
- package/dist/cjs/{post-back-to-top-f682ea05.js → post-back-to-top-abbb4ac4.js} +8 -11
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -5
- package/dist/cjs/{post-banner-5c749a94.js → post-banner-4d99c51c.js} +12 -17
- package/dist/cjs/post-banner.cjs.entry.js +3 -8
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -7
- package/dist/cjs/{post-breadcrumbs-76f55ae5.js → post-breadcrumbs-5ceabb10.js} +13 -7
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +3 -3
- package/dist/cjs/{post-card-control-161a7102.js → post-card-control-b657aeaa.js} +42 -21
- package/dist/cjs/post-card-control.cjs.entry.js +3 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -9
- package/dist/cjs/{post-collapsible-trigger-6cdf4481.js → post-collapsible-trigger-33f09d6c.js} +5 -8
- package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -8
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-footer-15d78645.js → post-footer-022cf408.js} +39 -11
- package/dist/cjs/post-footer.cjs.entry.js +3 -2
- package/dist/cjs/{post-linkarea-095d1928.js → post-linkarea-5fbb2e25.js} +2 -2
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/{post-menu-item-387e079b.js → post-menu-item-d4cc4742.js} +4 -4
- package/dist/cjs/{post-popover-388c8091.js → post-popover-b7cd0091.js} +20 -5
- package/dist/cjs/post-popover.cjs.entry.js +4 -2
- package/dist/cjs/{post-rating-246e4d89.js → post-rating-c81d1ac3.js} +29 -8
- package/dist/cjs/post-rating.cjs.entry.js +4 -2
- package/dist/cjs/{post-tab-header-0e9d0e06.js → post-tab-header-1db15093.js} +4 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -4
- package/dist/cjs/{post-tab-panel-f952714f.js → post-tab-panel-698981b8.js} +11 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -2
- package/dist/cjs/{post-tabs-97c30d81.js → post-tabs-79eab811.js} +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-58003cf0.js → post-tag-66a52727.js} +18 -5
- package/dist/cjs/post-tag.cjs.entry.js +4 -2
- package/dist/cjs/{post-togglebutton-87c984d8.js → post-togglebutton-a6b8b75d.js} +89 -92
- package/dist/cjs/{post-tooltip-28e7711a.js → post-tooltip-560cf42c.js} +11 -10
- package/dist/cjs/{post-tooltip-trigger-cbc53d14.js → post-tooltip-trigger-2a54e3e4.js} +6 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +7 -7
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -6
- package/dist/collection/components/post-avatar/post-avatar.js +25 -2
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +8 -10
- package/dist/collection/components/post-banner/post-banner.js +13 -18
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +15 -7
- package/dist/collection/components/post-card-control/post-card-control.js +58 -33
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +4 -5
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +39 -8
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +29 -54
- package/dist/collection/components/post-icon/post-icon.js +17 -37
- package/dist/collection/components/post-language-option/post-language-option.js +13 -13
- package/dist/collection/components/post-language-switch/post-language-switch.js +5 -5
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-list/post-list.js +1 -1
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +2 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
- package/dist/collection/components/post-menu/post-menu.js +13 -2
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-popover/post-popover.js +21 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -4
- package/dist/collection/components/post-rating/post-rating.js +29 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -11
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +13 -2
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-tag/post-tag.js +23 -11
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -12
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -12
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +5 -7
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/placement.js +14 -0
- package/dist/collection/types/property-types.js +1 -0
- package/dist/collection/utils/is-value-empty.js +4 -0
- package/dist/collection/utils/property-checkers/check-one-of.js +3 -4
- package/dist/collection/utils/property-checkers/check-pattern.js +3 -4
- package/dist/collection/utils/property-checkers/check-type.js +4 -6
- package/dist/collection/utils/property-checkers/check-url.js +5 -5
- package/dist/collection/utils/property-checkers/constants.js +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +4 -6
- package/dist/collection/utils/property-checkers/index.js +6 -6
- package/dist/collection/utils/property-checkers/required-and.js +14 -0
- package/dist/components/index2.js +60 -19
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +6 -6
- package/dist/components/post-accordion2.js +8 -8
- package/dist/components/post-avatar2.js +24 -4
- package/dist/components/post-back-to-top2.js +9 -12
- package/dist/components/post-banner2.js +12 -18
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumbs2.js +14 -7
- package/dist/components/post-card-control2.js +41 -16
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +3 -5
- package/dist/components/post-collapsible2.js +2 -2
- package/dist/components/post-footer2.js +46 -9
- package/dist/components/post-header2.js +31 -33
- package/dist/components/post-icon2.js +9 -25
- package/dist/components/post-language-option2.js +9 -10
- package/dist/components/post-language-switch2.js +4 -6
- package/dist/components/post-linkarea2.js +1 -1
- package/dist/components/post-list-item2.js +1 -1
- package/dist/components/post-list2.js +1 -1
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation2.js +2 -2
- package/dist/components/post-megadropdown-trigger2.js +4 -4
- package/dist/components/post-megadropdown2.js +2 -2
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +3 -3
- package/dist/components/post-menu2.js +12 -2
- package/dist/components/post-popover2.js +20 -3
- package/dist/components/post-popovercontainer2.js +37 -3
- package/dist/components/post-rating2.js +26 -1
- package/dist/components/post-tab-header2.js +3 -3
- package/dist/components/post-tab-panel2.js +12 -1
- package/dist/components/post-tabs2.js +1 -1
- package/dist/components/post-tag2.js +19 -5
- package/dist/components/post-togglebutton2.js +1 -12
- package/dist/components/post-tooltip-trigger2.js +5 -7
- package/dist/components/post-tooltip2.js +11 -11
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +49 -89
- package/dist/esm/index-f4d19816.js +2 -6
- package/dist/esm/index-ffccd040.js +88 -0
- package/dist/esm/index.js +22 -28
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-9374eb90.js +3 -0
- package/dist/esm/placement-8d56605d.js +16 -0
- package/dist/esm/post-accordion-item-f416bd95.js +158 -0
- package/dist/esm/post-accordion_2.entry.js +7 -0
- package/dist/esm/{post-avatar-639dc17a.js → post-avatar-2cb5190b.js} +21 -4
- package/dist/esm/post-avatar.entry.js +3 -4
- package/dist/esm/{post-back-to-top-8099279e.js → post-back-to-top-f877d4c6.js} +8 -11
- package/dist/esm/post-back-to-top.entry.js +3 -5
- package/dist/esm/{post-banner-54834fbf.js → post-banner-576a5adb.js} +12 -17
- package/dist/esm/post-banner.entry.js +3 -8
- package/dist/esm/post-breadcrumb-item_2.entry.js +3 -7
- package/dist/esm/{post-breadcrumbs-caf56014.js → post-breadcrumbs-63223336.js} +13 -7
- package/dist/esm/post-breadcrumbs.entry.js +3 -3
- package/dist/esm/{post-card-control-b063586b.js → post-card-control-2eebe7b4.js} +37 -16
- package/dist/esm/post-card-control.entry.js +3 -5
- package/dist/esm/post-closebutton_15.entry.js +5 -9
- package/dist/esm/{post-collapsible-trigger-727bcde1.js → post-collapsible-trigger-561df34e.js} +5 -8
- package/dist/esm/post-collapsible_2.entry.js +3 -8
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-footer-16f1a8de.js → post-footer-a270f67b.js} +36 -8
- package/dist/esm/post-footer.entry.js +3 -2
- package/dist/esm/{post-linkarea-4e4228fb.js → post-linkarea-456ce63d.js} +2 -2
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/{post-menu-item-e9dd8173.js → post-menu-item-e051284c.js} +4 -4
- package/dist/esm/{post-popover-46ede6b5.js → post-popover-7c3c9072.js} +17 -2
- package/dist/esm/post-popover.entry.js +4 -2
- package/dist/esm/{post-rating-8d0d970b.js → post-rating-2c9dd11f.js} +23 -2
- package/dist/esm/post-rating.entry.js +4 -2
- package/dist/esm/{post-tab-header-8224c7c2.js → post-tab-header-f90b2f93.js} +4 -4
- package/dist/esm/post-tab-header.entry.js +3 -4
- package/dist/esm/{post-tab-panel-dfdeccd3.js → post-tab-panel-c19b5e30.js} +11 -2
- package/dist/esm/post-tab-panel.entry.js +4 -2
- package/dist/esm/{post-tabs-fabd0569.js → post-tabs-0dadedf2.js} +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-13994238.js → post-tag-b8be3b0c.js} +18 -5
- package/dist/esm/post-tag.entry.js +4 -2
- package/dist/esm/{post-togglebutton-87967c5b.js → post-togglebutton-83339cc9.js} +89 -92
- package/dist/esm/{post-tooltip-eecaa4c7.js → post-tooltip-3cc82984.js} +11 -10
- package/dist/esm/{post-tooltip-trigger-642cbb22.js → post-tooltip-trigger-898c3dbc.js} +6 -8
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-104ddc50.js +1 -0
- package/dist/post-components/p-13b41e32.entry.js +1 -0
- package/dist/post-components/p-1906d77c.js +1 -0
- package/dist/post-components/p-19d0e6ea.entry.js +1 -0
- package/dist/post-components/p-1b9afb34.entry.js +1 -0
- package/dist/post-components/{p-a07f85ee.js → p-1fbffc90.js} +1 -1
- package/dist/post-components/p-234925fa.js +1 -0
- package/dist/post-components/p-23fb976f.entry.js +1 -0
- package/dist/post-components/p-24c42ebe.entry.js +1 -0
- package/dist/post-components/{p-19317b15.js → p-28c19671.js} +2 -2
- package/dist/post-components/p-37aaa30f.js +1 -0
- package/dist/post-components/p-3baf0b40.entry.js +1 -0
- package/dist/post-components/p-4390192f.js +1 -0
- package/dist/post-components/p-4a071696.js +1 -0
- package/dist/post-components/p-4c2d5072.js +1 -0
- package/dist/post-components/p-51b6114c.entry.js +1 -0
- package/dist/post-components/p-59a38c23.js +1 -0
- package/dist/post-components/p-5fb4fc65.js +1 -0
- package/dist/post-components/p-64c13aaf.entry.js +1 -0
- package/dist/post-components/p-66679f9d.entry.js +1 -0
- package/dist/post-components/p-68a98f0b.js +1 -0
- package/dist/post-components/{p-692ba59d.js → p-6a4dc55e.js} +1 -1
- package/dist/post-components/p-789f9a23.entry.js +1 -0
- package/dist/post-components/p-7e6eae42.js +1 -0
- package/dist/post-components/p-8117dd0c.js +1 -0
- package/dist/post-components/p-814c0c4d.entry.js +1 -0
- package/dist/post-components/p-87e0d6fa.js +1 -0
- package/dist/post-components/p-988d20f4.js +1 -0
- package/dist/post-components/p-9b1e4e52.entry.js +1 -0
- package/dist/post-components/p-ab44a18c.entry.js +1 -0
- package/dist/post-components/p-b176309b.js +1 -0
- package/dist/post-components/p-b2952b0e.entry.js +1 -0
- package/dist/post-components/p-c10b2a2f.js +1 -0
- package/dist/post-components/{p-0dcd25ab.js → p-c80cb846.js} +1 -1
- package/dist/post-components/p-da4704c1.js +1 -0
- package/dist/post-components/p-dc4de84a.entry.js +1 -0
- package/dist/post-components/p-f1f0ace3.entry.js +1 -0
- package/dist/post-components/p-f34fb6c4.entry.js +1 -0
- package/dist/post-components/p-f6f914bb.js +1 -0
- package/dist/post-components/p-fe7e64cf.entry.js +1 -0
- package/dist/post-components/p-fee94252.entry.js +1 -0
- package/dist/post-components/post-components.css +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +26 -0
- package/dist/types/components/post-accordion/post-accordion.d.ts +2 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +3 -0
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +1 -1
- package/dist/types/components/post-banner/post-banner.d.ts +3 -4
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +2 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +10 -6
- package/dist/types/components/post-footer/post-footer.d.ts +8 -2
- package/dist/types/components/post-header/post-header.d.ts +5 -9
- package/dist/types/components/post-icon/post-icon.d.ts +5 -7
- package/dist/types/components/post-language-option/post-language-option.d.ts +5 -5
- package/dist/types/components/post-logo/post-logo.d.ts +1 -1
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-popover/post-popover.d.ts +2 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +3 -0
- package/dist/types/components/post-rating/post-rating.d.ts +4 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +5 -3
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +3 -3
- package/dist/types/components.d.ts +38 -59
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/placement.d.ts +1 -0
- package/dist/types/types/property-types.d.ts +1 -0
- package/dist/types/utils/is-value-empty.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +2 -2
- package/dist/types/utils/property-checkers/check-url.d.ts +1 -1
- package/dist/types/utils/property-checkers/constants.d.ts +1 -1
- package/dist/types/utils/property-checkers/empty-or.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +16 -9
- package/dist/types/utils/property-checkers/required-and.d.ts +3 -0
- package/loaders/index2.js +60 -19
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +6 -6
- package/loaders/post-accordion.js +1 -124
- package/{dist/esm/post-accordion-03796d13.js → loaders/post-accordion2.js} +43 -20
- package/loaders/post-avatar.js +24 -4
- package/loaders/post-back-to-top.js +9 -12
- package/loaders/post-banner.js +12 -18
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumbs.js +14 -7
- package/loaders/post-card-control.js +41 -16
- package/loaders/post-closebutton.js +1 -1
- package/loaders/post-collapsible-trigger2.js +3 -5
- package/loaders/post-collapsible2.js +2 -2
- package/loaders/post-footer.js +46 -9
- package/loaders/post-header.js +31 -33
- package/loaders/post-icon2.js +9 -25
- package/loaders/post-language-option.js +9 -10
- package/loaders/post-language-switch.js +4 -6
- package/loaders/post-linkarea.js +1 -1
- package/loaders/post-list-item.js +1 -1
- package/loaders/post-list.js +1 -1
- package/loaders/post-logo.js +2 -2
- package/loaders/post-mainnavigation.js +2 -2
- package/loaders/post-megadropdown-trigger.js +4 -4
- package/loaders/post-megadropdown.js +2 -2
- package/loaders/post-menu-item2.js +1 -1
- package/loaders/post-menu-trigger2.js +3 -3
- package/loaders/post-menu2.js +12 -2
- package/loaders/post-popover.js +20 -3
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-popovercontainer2.js +37 -3
- package/loaders/post-rating.js +26 -1
- package/loaders/post-tab-header.js +3 -3
- package/loaders/post-tab-panel.js +12 -1
- package/loaders/post-tabs.js +1 -1
- package/loaders/post-tag.js +19 -5
- package/loaders/post-togglebutton.js +1 -12
- package/loaders/post-tooltip-trigger.js +5 -7
- package/loaders/post-tooltip.js +11 -11
- package/loaders/switch-variants.js +3 -0
- package/package.json +19 -9
- package/dist/cjs/check-non-empty-bd99d236.js +0 -15
- package/dist/cjs/check-one-of-75d270b5.js +0 -13
- package/dist/cjs/check-type-cdbf6d29.js +0 -21
- package/dist/cjs/check-url-220a286c.js +0 -19
- package/dist/cjs/constants-238701d3.js +0 -5
- package/dist/cjs/heading-levels-608d432e.js +0 -5
- package/dist/cjs/index-23e36ff7.js +0 -37
- package/dist/cjs/post-accordion-e54524be.js +0 -105
- package/dist/cjs/post-accordion-item-86f11a16.js +0 -64
- package/dist/cjs/post-accordion-item.cjs.entry.js +0 -20
- package/dist/cjs/post-accordion.cjs.entry.js +0 -15
- package/dist/collection/utils/property-checkers/check-non-empty.js +0 -10
- package/dist/components/check-non-empty.js +0 -13
- package/dist/components/check-one-of.js +0 -11
- package/dist/components/check-type.js +0 -19
- package/dist/components/constants.js +0 -3
- package/dist/esm/check-non-empty-258a56b3.js +0 -13
- package/dist/esm/check-one-of-0bee20f5.js +0 -11
- package/dist/esm/check-type-37d5d307.js +0 -19
- package/dist/esm/check-url-17962bc8.js +0 -17
- package/dist/esm/constants-8d548297.js +0 -3
- package/dist/esm/heading-levels-5b7b4349.js +0 -3
- package/dist/esm/index-8f8fe5b0.js +0 -32
- package/dist/esm/package-33ac2576.js +0 -3
- package/dist/esm/post-accordion-item-d29c49e5.js +0 -62
- package/dist/esm/post-accordion-item.entry.js +0 -12
- package/dist/esm/post-accordion.entry.js +0 -7
- package/dist/post-components/p-0539071d.js +0 -1
- package/dist/post-components/p-181c73d5.js +0 -1
- package/dist/post-components/p-1ef9415b.js +0 -1
- package/dist/post-components/p-247a1668.js +0 -1
- package/dist/post-components/p-24d0695f.entry.js +0 -1
- package/dist/post-components/p-2e50a07d.entry.js +0 -1
- package/dist/post-components/p-30eb4d87.js +0 -1
- package/dist/post-components/p-440193f4.js +0 -1
- package/dist/post-components/p-46008c18.entry.js +0 -1
- package/dist/post-components/p-47ab2c2b.entry.js +0 -1
- package/dist/post-components/p-4c049de0.entry.js +0 -1
- package/dist/post-components/p-4c4acc32.entry.js +0 -1
- package/dist/post-components/p-5d473fcd.js +0 -1
- package/dist/post-components/p-5d539b30.js +0 -1
- package/dist/post-components/p-6783e509.entry.js +0 -1
- package/dist/post-components/p-6933fb57.entry.js +0 -1
- package/dist/post-components/p-72197a6b.js +0 -1
- package/dist/post-components/p-7709c14a.js +0 -1
- package/dist/post-components/p-77910344.entry.js +0 -1
- package/dist/post-components/p-80e5100e.entry.js +0 -1
- package/dist/post-components/p-84fbf49c.js +0 -1
- package/dist/post-components/p-85fdc2d3.js +0 -1
- package/dist/post-components/p-8c09291c.js +0 -1
- package/dist/post-components/p-93da1a5f.js +0 -1
- package/dist/post-components/p-9b8ee310.entry.js +0 -1
- package/dist/post-components/p-9efb84d3.entry.js +0 -1
- package/dist/post-components/p-9fbf2f82.entry.js +0 -1
- package/dist/post-components/p-a25019de.js +0 -1
- package/dist/post-components/p-a710ee00.js +0 -1
- package/dist/post-components/p-b94e5b4d.entry.js +0 -1
- package/dist/post-components/p-c2348d3d.js +0 -1
- package/dist/post-components/p-c6b03446.entry.js +0 -1
- package/dist/post-components/p-d0dfd5f9.js +0 -1
- package/dist/post-components/p-d45df336.js +0 -1
- package/dist/post-components/p-d4890d50.entry.js +0 -1
- package/dist/post-components/p-d5210531.entry.js +0 -1
- package/dist/post-components/p-dd39c542.entry.js +0 -1
- package/dist/post-components/p-df6c8a4c.js +0 -1
- package/dist/post-components/p-e068a41e.js +0 -1
- package/dist/post-components/p-e585c6fe.js +0 -1
- package/dist/post-components/p-f2c4a48d.js +0 -1
- package/dist/post-components/p-f31b9b5d.entry.js +0 -1
- package/dist/post-components/p-f58252d5.entry.js +0 -1
- package/dist/post-components/p-fda767f0.js +0 -1
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +0 -3
- package/loaders/check-non-empty.js +0 -13
- package/loaders/check-one-of.js +0 -11
- package/loaders/check-type.js +0 -19
- package/loaders/constants.js +0 -3
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
|
-
import { c as checkType } from './check-type.js';
|
|
4
|
-
import './breakpoints.js';
|
|
5
3
|
|
|
6
4
|
const postTogglebuttonCss = ":host{cursor:pointer;outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}";
|
|
7
5
|
const PostTogglebuttonStyle0 = postTogglebuttonCss;
|
|
@@ -23,27 +21,18 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
23
21
|
};
|
|
24
22
|
this.toggled = false;
|
|
25
23
|
}
|
|
26
|
-
validateToggled() {
|
|
27
|
-
checkType(this, 'toggled', 'boolean');
|
|
28
|
-
}
|
|
29
24
|
componentWillLoad() {
|
|
30
|
-
this.validateToggled();
|
|
31
25
|
// add event listener to not override listener that might be set on the host
|
|
32
26
|
this.host.addEventListener('click', () => this.handleClick());
|
|
33
27
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
34
28
|
}
|
|
35
29
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '1025fb988460e85c92e49241889363e1bcc840eb', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '20d3eb9415685fb9a00a5613474c432f6638692e' })));
|
|
37
31
|
}
|
|
38
32
|
get host() { return this; }
|
|
39
|
-
static get watchers() { return {
|
|
40
|
-
"toggled": ["validateToggled"]
|
|
41
|
-
}; }
|
|
42
33
|
static get style() { return PostTogglebuttonStyle0; }
|
|
43
34
|
}, [1, "post-togglebutton", {
|
|
44
35
|
"toggled": [1028]
|
|
45
|
-
}, undefined, {
|
|
46
|
-
"toggled": ["validateToggled"]
|
|
47
36
|
}]);
|
|
48
37
|
function defineCustomElement$1() {
|
|
49
38
|
if (typeof customElements === "undefined") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { I as IS_BROWSER } from './breakpoints.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as checkEmptyOrType } from './index2.js';
|
|
4
4
|
import { v as version$1 } from './package.js';
|
|
5
5
|
|
|
6
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -4535,15 +4535,13 @@ const PostTooltipTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltipT
|
|
|
4535
4535
|
this.boundTooltipHandler = this.handleTooltipEvent.bind(this);
|
|
4536
4536
|
}
|
|
4537
4537
|
validateControlFor() {
|
|
4538
|
-
|
|
4538
|
+
checkEmptyOrType(this, 'for', 'string');
|
|
4539
4539
|
}
|
|
4540
4540
|
get tooltip() {
|
|
4541
4541
|
if (!IS_BROWSER)
|
|
4542
4542
|
return null;
|
|
4543
4543
|
const ref = document.getElementById(this.for);
|
|
4544
|
-
return ref?.localName === 'post-tooltip'
|
|
4545
|
-
? ref
|
|
4546
|
-
: null;
|
|
4544
|
+
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
4547
4545
|
}
|
|
4548
4546
|
componentDidLoad() {
|
|
4549
4547
|
this.setupTrigger();
|
|
@@ -4651,7 +4649,7 @@ const PostTooltipTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltipT
|
|
|
4651
4649
|
handleLeave(event) {
|
|
4652
4650
|
const newTarget = event.relatedTarget;
|
|
4653
4651
|
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
4654
|
-
|
|
4652
|
+
newTarget === this.trigger) {
|
|
4655
4653
|
return;
|
|
4656
4654
|
}
|
|
4657
4655
|
this.interestLostHandler();
|
|
@@ -4675,7 +4673,7 @@ const PostTooltipTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltipT
|
|
|
4675
4673
|
this.tooltip?.hide();
|
|
4676
4674
|
}
|
|
4677
4675
|
render() {
|
|
4678
|
-
return (h(Host, { key: '
|
|
4676
|
+
return (h(Host, { key: '26ac11df6c2961e3dd51722f6981185db17c6efb', "data-version": version$1 }, h("slot", { key: 'd08036f40d0a6708b8614232134b0d5b4eba4b78', onSlotchange: () => this.handleSlotChange() })));
|
|
4679
4677
|
}
|
|
4680
4678
|
get host() { return this; }
|
|
4681
4679
|
static get watchers() { return {
|
package/loaders/post-tooltip.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
|
-
import {
|
|
3
|
+
import { d as checkEmptyOrOneOf } from './index2.js';
|
|
4
4
|
import './breakpoints.js';
|
|
5
|
-
import { d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
5
|
+
import { P as PLACEMENT_TYPES, d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
6
6
|
|
|
7
|
-
const postTooltipCss = ":host{display:none}:host([open]){display:
|
|
7
|
+
const postTooltipCss = ":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}";
|
|
8
8
|
const PostTooltipStyle0 = postTooltipCss;
|
|
9
9
|
|
|
10
10
|
const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement {
|
|
@@ -14,14 +14,14 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
14
14
|
this.__attachShadow();
|
|
15
15
|
this.placement = 'top';
|
|
16
16
|
this.arrow = false;
|
|
17
|
-
this.animation =
|
|
17
|
+
this.animation = undefined;
|
|
18
18
|
this.open = false;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
validatePlacement() {
|
|
21
|
+
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
this.
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.validatePlacement();
|
|
25
25
|
}
|
|
26
26
|
componentDidLoad() {
|
|
27
27
|
if (!this.host.id) {
|
|
@@ -62,11 +62,11 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
64
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
65
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: '1e1d3f4e204b42c8202af63bd7dec12de3c8e16a', "data-version": version, role: "tooltip" }, h("post-popovercontainer", { key: 'e410952b4e75915e51d57eec2dbecce2b5d55733', safeSpace: "trapezoid", class: popoverClass, arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '494e3136dbe96cf611a41753711efb03cab30a12' }))));
|
|
66
66
|
}
|
|
67
67
|
get host() { return this; }
|
|
68
68
|
static get watchers() { return {
|
|
69
|
-
"
|
|
69
|
+
"placement": ["validatePlacement"]
|
|
70
70
|
}; }
|
|
71
71
|
static get style() { return PostTooltipStyle0; }
|
|
72
72
|
}, [1, "post-tooltip", {
|
|
@@ -78,7 +78,7 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
78
78
|
"hide": [64],
|
|
79
79
|
"toggle": [64]
|
|
80
80
|
}, undefined, {
|
|
81
|
-
"
|
|
81
|
+
"placement": ["validatePlacement"]
|
|
82
82
|
}]);
|
|
83
83
|
function defineCustomElement$1() {
|
|
84
84
|
if (typeof customElements === "undefined") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "10.0.0-next.
|
|
3
|
+
"version": "10.0.0-next.40",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"author": "Swiss Post <design-system@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@floating-ui/dom": "1.7.0",
|
|
33
33
|
"@oddbird/popover-polyfill": "0.5.2",
|
|
34
|
-
"@swisspost/design-system-icons": "10.0.0-next.
|
|
35
|
-
"@swisspost/design-system-styles": "10.0.0-next.
|
|
34
|
+
"@swisspost/design-system-icons": "10.0.0-next.40",
|
|
35
|
+
"@swisspost/design-system-styles": "10.0.0-next.40",
|
|
36
36
|
"ally.js": "1.4.1",
|
|
37
37
|
"long-press-event": "2.5.0",
|
|
38
38
|
"nanoid": "5.1.5"
|
|
@@ -48,20 +48,24 @@
|
|
|
48
48
|
"@stencil/react-output-target": "0.5.3",
|
|
49
49
|
"@stencil/sass": "3.0.12",
|
|
50
50
|
"@types/jest": "29.5.14",
|
|
51
|
+
"@types/mock-fs": "4.13.4",
|
|
51
52
|
"@types/node": "22.10.5",
|
|
52
53
|
"@typescript-eslint/parser": "7.18.0",
|
|
53
54
|
"bootstrap": "5.3.3",
|
|
55
|
+
"copyfiles": "2.4.1",
|
|
54
56
|
"cypress": "14.3.2",
|
|
55
|
-
"cypress-axe": "1.
|
|
57
|
+
"cypress-axe": "1.6.0",
|
|
56
58
|
"cypress-storybook": "1.0.0",
|
|
57
59
|
"eslint": "9.18.0",
|
|
58
60
|
"eslint-plugin-react": "7.37.4",
|
|
59
61
|
"globals": "16.0.0",
|
|
62
|
+
"mock-fs": "5.5.0",
|
|
60
63
|
"rimraf": "6.0.1",
|
|
61
64
|
"rollup-plugin-postcss": "4.0.2",
|
|
62
65
|
"sass": "1.78.0",
|
|
63
66
|
"throttle-debounce": "5.0.2",
|
|
64
67
|
"ts-jest": "29.2.5",
|
|
68
|
+
"ts-node": "10.9.2",
|
|
65
69
|
"typescript": "5.8.3",
|
|
66
70
|
"typescript-eslint": "8.20.0",
|
|
67
71
|
"eslint-plugin-cypress": "4.2.0"
|
|
@@ -75,17 +79,23 @@
|
|
|
75
79
|
"frontend"
|
|
76
80
|
],
|
|
77
81
|
"scripts": {
|
|
78
|
-
"play": "stencil build --dev --port 9200 --serve --watch --docs --docs-readme",
|
|
79
|
-
"start": "stencil build --dev --watch --docs --docs-readme",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
+
"play": "pnpm prebuild:script && stencil build --dev --port 9200 --serve --watch --docs --docs-readme",
|
|
83
|
+
"start": "pnpm prebuild:script && stencil build --dev --watch --docs --docs-readme",
|
|
84
|
+
"prebuild": "pnpm clean && pnpm prebuild:script",
|
|
85
|
+
"build": "stencil build --docs-readme",
|
|
86
|
+
"postbuild": "pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
|
|
87
|
+
"clean": "rimraf dist hydrate loader loaders www src/styles/generated ../components-react/src/components/stencil-generated/ ../components-angular/projects/components/src/lib/stencil-generated/",
|
|
82
88
|
"unit": "stencil test --spec",
|
|
83
89
|
"unit:watch": "stencil test --spec --watchAll --silent",
|
|
90
|
+
"unit:updatesnapshot": "stencil test --spec --updateSnapshot",
|
|
84
91
|
"e2e": "cypress run --browser chrome",
|
|
85
92
|
"e2e:watch": "cypress open",
|
|
86
93
|
"e2e:ci": "xvfb-run -a cypress run --browser chrome",
|
|
87
94
|
"lint": "eslint",
|
|
88
95
|
"lint:fix": "eslint --fix",
|
|
89
|
-
"generate": "stencil generate"
|
|
96
|
+
"generate": "stencil generate",
|
|
97
|
+
"prebuild:script": "ts-node prebuild.ts",
|
|
98
|
+
"copy:styles:components-react": "copyfiles -f www/build/post-components.css ../components-react/src/components/stencil-generated/",
|
|
99
|
+
"copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/projects/components/src/lib/stencil-generated/"
|
|
90
100
|
}
|
|
91
101
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const constants = require('./constants-238701d3.js');
|
|
4
|
-
|
|
5
|
-
function checkNonEmpty(component, prop, customMessage) {
|
|
6
|
-
const componentName = component.host.localName;
|
|
7
|
-
const value = component[prop];
|
|
8
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
9
|
-
const message = customMessage || defaultMessage;
|
|
10
|
-
if (constants.EMPTY_VALUES.some(v => v === value)) {
|
|
11
|
-
throw new Error(message);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
exports.checkNonEmpty = checkNonEmpty;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
4
|
-
const componentName = component.host.localName;
|
|
5
|
-
const value = component[prop];
|
|
6
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
7
|
-
const message = customMessage || defaultMessage;
|
|
8
|
-
if (!possibleValues.includes(value)) {
|
|
9
|
-
throw new Error(message);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports.checkOneOf = checkOneOf;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function checkType(component, prop, type, customMessage) {
|
|
4
|
-
const componentName = component.host.localName;
|
|
5
|
-
const value = component[prop];
|
|
6
|
-
const typeIsArray = type === 'array';
|
|
7
|
-
const valueIsArray = Array.isArray(value);
|
|
8
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
|
|
9
|
-
${type}\`.`;
|
|
10
|
-
const message = customMessage || defaultMessage;
|
|
11
|
-
if (typeIsArray || valueIsArray) {
|
|
12
|
-
if (valueIsArray !== typeIsArray) {
|
|
13
|
-
throw new Error(message);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
else if (typeof value !== type) {
|
|
17
|
-
throw new Error(message);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
exports.checkType = checkType;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function checkUrl(component, prop, customMessage) {
|
|
4
|
-
const componentName = component.host.localName;
|
|
5
|
-
const value = component[prop];
|
|
6
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
7
|
-
const message = customMessage || defaultMessage;
|
|
8
|
-
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
9
|
-
throw new Error(message);
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
new URL(value, 'https://www.post.ch');
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
throw new Error(message);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.checkUrl = checkUrl;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const constants = require('./constants-238701d3.js');
|
|
4
|
-
const checkOneOf = require('./check-one-of-75d270b5.js');
|
|
5
|
-
const checkType = require('./check-type-cdbf6d29.js');
|
|
6
|
-
const checkUrl = require('./check-url-220a286c.js');
|
|
7
|
-
|
|
8
|
-
function emptyOr(check) {
|
|
9
|
-
return (...args) => {
|
|
10
|
-
const component = args[0];
|
|
11
|
-
const prop = args[1];
|
|
12
|
-
const value = component[prop];
|
|
13
|
-
if (!constants.EMPTY_VALUES.some(v => v === value)) {
|
|
14
|
-
check(...args);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function checkPattern(component, prop, pattern, customMessage) {
|
|
20
|
-
const componentName = component.host.localName;
|
|
21
|
-
const value = component[prop];
|
|
22
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
|
|
23
|
-
const message = customMessage || defaultMessage;
|
|
24
|
-
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
25
|
-
throw new Error(message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const checkEmptyOrOneOf = emptyOr(checkOneOf.checkOneOf);
|
|
30
|
-
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
31
|
-
const checkEmptyOrType = emptyOr(checkType.checkType);
|
|
32
|
-
const checkEmptyOrUrl = emptyOr(checkUrl.checkUrl);
|
|
33
|
-
|
|
34
|
-
exports.checkEmptyOrOneOf = checkEmptyOrOneOf;
|
|
35
|
-
exports.checkEmptyOrPattern = checkEmptyOrPattern;
|
|
36
|
-
exports.checkEmptyOrType = checkEmptyOrType;
|
|
37
|
-
exports.checkEmptyOrUrl = checkEmptyOrUrl;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-b60129c4.js');
|
|
4
|
-
const _package = require('./package-3e61e6f3.js');
|
|
5
|
-
const headingLevels = require('./heading-levels-608d432e.js');
|
|
6
|
-
const checkOneOf = require('./check-one-of-75d270b5.js');
|
|
7
|
-
require('./breakpoints-cdf1b747.js');
|
|
8
|
-
const eventGuard = require('./event-guard-efabc84f.js');
|
|
9
|
-
|
|
10
|
-
const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}::slotted(post-accordion-item:not(:only-of-type):first-of-type){--post-accordion-button-border-top:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}";
|
|
11
|
-
const PostAccordionStyle0 = postAccordionCss;
|
|
12
|
-
|
|
13
|
-
const PostAccordion = class {
|
|
14
|
-
constructor(hostRef) {
|
|
15
|
-
index.registerInstance(this, hostRef);
|
|
16
|
-
this.expandedItems = new Set();
|
|
17
|
-
this.headingLevel = undefined;
|
|
18
|
-
this.multiple = false;
|
|
19
|
-
}
|
|
20
|
-
validateHeadingLevel(newValue = this.headingLevel) {
|
|
21
|
-
if (!newValue)
|
|
22
|
-
return;
|
|
23
|
-
checkOneOf.checkOneOf(this, 'headingLevel', headingLevels.HEADING_LEVELS, 'The `heading-level` property of the `post-accordion` must be a number between 1 and 6.');
|
|
24
|
-
this.accordionItems.forEach(item => {
|
|
25
|
-
item.setAttribute('heading-level', String(newValue));
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
componentWillLoad() {
|
|
29
|
-
this.registerAccordionItems();
|
|
30
|
-
this.validateHeadingLevel();
|
|
31
|
-
}
|
|
32
|
-
collapseToggleHandler(event) {
|
|
33
|
-
eventGuard.eventGuard(this.host, event, { targetLocalName: 'post-accordion-item', delegatorSelector: 'post-accordion' }, () => {
|
|
34
|
-
const toggledAccordionItem = event.target;
|
|
35
|
-
const isClosing = this.expandedItems.has(toggledAccordionItem);
|
|
36
|
-
if (isClosing) {
|
|
37
|
-
this.expandedItems.delete(toggledAccordionItem);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
this.expandedItems.add(toggledAccordionItem);
|
|
41
|
-
}
|
|
42
|
-
if (this.multiple || isClosing)
|
|
43
|
-
return;
|
|
44
|
-
// Close other open accordion items to ensure only one is open at a time
|
|
45
|
-
Array.from(this.expandedItems.values())
|
|
46
|
-
.filter(item => item !== toggledAccordionItem)
|
|
47
|
-
.forEach(item => {
|
|
48
|
-
item.toggle(false);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Toggles the `post-accordion-item` with the given id.
|
|
54
|
-
*/
|
|
55
|
-
async toggle(id) {
|
|
56
|
-
const itemToToggle = this.accordionItems.find(item => item.id === id);
|
|
57
|
-
if (!itemToToggle)
|
|
58
|
-
throw new Error(`No post-accordion-item found with id #${id}.`);
|
|
59
|
-
await itemToToggle.toggle();
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Expands all `post-accordion-item`.
|
|
63
|
-
*
|
|
64
|
-
* If `multiple="true"` is not set and all items are closed, it will open the first one.
|
|
65
|
-
* Otherwise, it will keep the opened one.
|
|
66
|
-
*/
|
|
67
|
-
async expandAll() {
|
|
68
|
-
if (this.multiple) {
|
|
69
|
-
await Promise.all(this.accordionItems.map(item => item.toggle(true)));
|
|
70
|
-
}
|
|
71
|
-
else if (!this.expandedItems.size) {
|
|
72
|
-
await this.accordionItems[0].toggle(true);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Collapses all `post-accordion-item`.
|
|
77
|
-
*/
|
|
78
|
-
async collapseAll() {
|
|
79
|
-
await Promise.all(this.accordionItems.map(item => item.toggle(false)));
|
|
80
|
-
}
|
|
81
|
-
registerAccordionItems() {
|
|
82
|
-
this.accordionItems = Array.from(this.host.querySelectorAll('post-accordion-item'));
|
|
83
|
-
this.accordionItems
|
|
84
|
-
.filter(item => {
|
|
85
|
-
return !item.collapsed || this.expandedItems.has(item);
|
|
86
|
-
})
|
|
87
|
-
.forEach((item, index) => {
|
|
88
|
-
if (!this.multiple && index !== 0) {
|
|
89
|
-
item.setAttribute('collapsed', '');
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
this.expandedItems.add(item);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
render() {
|
|
96
|
-
return (index.h(index.Host, { key: '80e15cf7835f213cfee1ca7cf83cc2fd24bba3ff', "data-version": _package.version }, index.h("div", { key: '1cf03d4960115b52394b5cb07cd2286747c728dd', class: "accordion" }, index.h("slot", { key: 'b94328a45a3cba6a8d3b418061036eb8af2cf027', onSlotchange: () => this.registerAccordionItems() }))));
|
|
97
|
-
}
|
|
98
|
-
get host() { return index.getElement(this); }
|
|
99
|
-
static get watchers() { return {
|
|
100
|
-
"headingLevel": ["validateHeadingLevel"]
|
|
101
|
-
}; }
|
|
102
|
-
};
|
|
103
|
-
PostAccordion.style = PostAccordionStyle0;
|
|
104
|
-
|
|
105
|
-
exports.PostAccordion = PostAccordion;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-b60129c4.js');
|
|
4
|
-
const _package = require('./package-3e61e6f3.js');
|
|
5
|
-
const headingLevels = require('./heading-levels-608d432e.js');
|
|
6
|
-
const index$1 = require('./index-23e36ff7.js');
|
|
7
|
-
require('./breakpoints-cdf1b747.js');
|
|
8
|
-
const eventGuard = require('./event-guard-efabc84f.js');
|
|
9
|
-
const index_browser = require('./index.browser-4af21c17.js');
|
|
10
|
-
|
|
11
|
-
const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start:var(--post-accordion-button-border-top)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover,.accordion-button:focus-visible{color:Highlight}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
|
|
12
|
-
const PostAccordionItemStyle0 = postAccordionItemCss;
|
|
13
|
-
|
|
14
|
-
const PostAccordionItem = class {
|
|
15
|
-
constructor(hostRef) {
|
|
16
|
-
index.registerInstance(this, hostRef);
|
|
17
|
-
this.id = undefined;
|
|
18
|
-
this.slottedLogo = undefined;
|
|
19
|
-
this.collapsed = false;
|
|
20
|
-
this.headingLevel = undefined;
|
|
21
|
-
}
|
|
22
|
-
validateHeadingLevel() {
|
|
23
|
-
index$1.checkEmptyOrOneOf(this, 'headingLevel', headingLevels.HEADING_LEVELS, 'The `heading-level` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
24
|
-
}
|
|
25
|
-
componentWillLoad() {
|
|
26
|
-
this.id = this.host.id || `p${index_browser.nanoid(6)}`;
|
|
27
|
-
}
|
|
28
|
-
componentDidLoad() {
|
|
29
|
-
this.validateHeadingLevel();
|
|
30
|
-
}
|
|
31
|
-
// Capture to make sure the "collapsed" property is updated before the event is consumed
|
|
32
|
-
onCollapseToggle(event) {
|
|
33
|
-
eventGuard.eventGuard(this.host, event, { targetLocalName: 'post-collapsible', delegatorSelector: 'post-accordion-item' }, () => {
|
|
34
|
-
this.collapsed = !event.detail;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Triggers the collapse programmatically.
|
|
39
|
-
*/
|
|
40
|
-
async toggle(force) {
|
|
41
|
-
return this.collapsible.toggle(force);
|
|
42
|
-
}
|
|
43
|
-
onSlotLogoChange() {
|
|
44
|
-
this.slottedLogo = this.host.querySelector('img[slot="logo"]');
|
|
45
|
-
}
|
|
46
|
-
componentWillRender() {
|
|
47
|
-
this.slottedLogo = this.host.querySelector('img[slot="logo"]');
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
|
|
51
|
-
const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
|
|
52
|
-
return (index.h(index.Host, { key: '725d3710f7937f82c2382938d15770001e923b61', id: this.id, "data-version": _package.version }, index.h("div", { key: '679d25d8278fbf9ae68546ee50c27a86ded95999', part: "accordion-item", class: "accordion-item" }, index.h("post-collapsible-trigger", { key: '7c2af8dc6a1f5265b4ae2cad066be7d2e0bf6a78', for: `${this.id}--collapse` }, index.h(HeadingTag, { key: 'a10e59a17fdb272fe6308d2ba98f37f90490fab8', class: "accordion-header", id: `${this.id}--header` }, index.h("button", { key: 'e2b527850c8342a8adf99453d0ac330b6a94760f', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, index.h("span", { key: 'b722a4bc51757546eefa58c7c3ea3a688838298a', class: {
|
|
53
|
-
'logo-container': true,
|
|
54
|
-
'has-image': !!this.slottedLogo,
|
|
55
|
-
} }, index.h("slot", { key: '1a42494db72a7b437b1d98fa2e8159d73ece22fa', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), index.h("slot", { key: '049865bb25f833780ef8e27fe8477e06476a2427', name: "header" }), index.h("post-icon", { key: 'da0cf7078e4f51710dbfd39c0afa90465fcb53c6', name: "2051" })))), index.h("post-collapsible", { key: '7c3b268e34d3e4f52820b11a6c090aefbc16e3b9', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, index.h("div", { key: '993a7fffbccb557aed2842305f3927e5c3b5047a', class: "accordion-body", part: "body" }, index.h("slot", { key: '580eb87b1cb4f88acd7dddddecaa1c1982b7f6e3' }))))));
|
|
56
|
-
}
|
|
57
|
-
get host() { return index.getElement(this); }
|
|
58
|
-
static get watchers() { return {
|
|
59
|
-
"headingLevel": ["validateHeadingLevel"]
|
|
60
|
-
}; }
|
|
61
|
-
};
|
|
62
|
-
PostAccordionItem.style = PostAccordionItemStyle0;
|
|
63
|
-
|
|
64
|
-
exports.PostAccordionItem = PostAccordionItem;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const postAccordionItem = require('./post-accordion-item-86f11a16.js');
|
|
6
|
-
require('./index-b60129c4.js');
|
|
7
|
-
require('./package-3e61e6f3.js');
|
|
8
|
-
require('./heading-levels-608d432e.js');
|
|
9
|
-
require('./index-23e36ff7.js');
|
|
10
|
-
require('./constants-238701d3.js');
|
|
11
|
-
require('./check-one-of-75d270b5.js');
|
|
12
|
-
require('./check-type-cdbf6d29.js');
|
|
13
|
-
require('./check-url-220a286c.js');
|
|
14
|
-
require('./breakpoints-cdf1b747.js');
|
|
15
|
-
require('./event-guard-efabc84f.js');
|
|
16
|
-
require('./index.browser-4af21c17.js');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.post_accordion_item = postAccordionItem.PostAccordionItem;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const postAccordion = require('./post-accordion-e54524be.js');
|
|
6
|
-
require('./index-b60129c4.js');
|
|
7
|
-
require('./package-3e61e6f3.js');
|
|
8
|
-
require('./heading-levels-608d432e.js');
|
|
9
|
-
require('./check-one-of-75d270b5.js');
|
|
10
|
-
require('./breakpoints-cdf1b747.js');
|
|
11
|
-
require('./event-guard-efabc84f.js');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.post_accordion = postAccordion.PostAccordion;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EMPTY_VALUES } from "./constants";
|
|
2
|
-
export function checkNonEmpty(component, prop, customMessage) {
|
|
3
|
-
const componentName = component.host.localName;
|
|
4
|
-
const value = component[prop];
|
|
5
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
6
|
-
const message = customMessage || defaultMessage;
|
|
7
|
-
if (EMPTY_VALUES.some(v => v === value)) {
|
|
8
|
-
throw new Error(message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { E as EMPTY_VALUES } from './constants.js';
|
|
2
|
-
|
|
3
|
-
function checkNonEmpty(component, prop, customMessage) {
|
|
4
|
-
const componentName = component.host.localName;
|
|
5
|
-
const value = component[prop];
|
|
6
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
7
|
-
const message = customMessage || defaultMessage;
|
|
8
|
-
if (EMPTY_VALUES.some(v => v === value)) {
|
|
9
|
-
throw new Error(message);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { checkNonEmpty as c };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
2
|
-
const componentName = component.host.localName;
|
|
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;
|
|
6
|
-
if (!possibleValues.includes(value)) {
|
|
7
|
-
throw new Error(message);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { checkOneOf as c };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function checkType(component, prop, type, customMessage) {
|
|
2
|
-
const componentName = component.host.localName;
|
|
3
|
-
const value = component[prop];
|
|
4
|
-
const typeIsArray = type === 'array';
|
|
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;
|
|
9
|
-
if (typeIsArray || valueIsArray) {
|
|
10
|
-
if (valueIsArray !== typeIsArray) {
|
|
11
|
-
throw new Error(message);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
else if (typeof value !== type) {
|
|
15
|
-
throw new Error(message);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { checkType as c };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { E as EMPTY_VALUES } from './constants-8d548297.js';
|
|
2
|
-
|
|
3
|
-
function checkNonEmpty(component, prop, customMessage) {
|
|
4
|
-
const componentName = component.host.localName;
|
|
5
|
-
const value = component[prop];
|
|
6
|
-
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
7
|
-
const message = customMessage || defaultMessage;
|
|
8
|
-
if (EMPTY_VALUES.some(v => v === value)) {
|
|
9
|
-
throw new Error(message);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { checkNonEmpty as c };
|