@usecapsule/core-components 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/capsule/capsule.esm.js +1 -52
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -572
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/p-0462f723.js +2 -0
- package/dist/capsule/p-0462f723.js.map +1 -0
- package/dist/capsule/p-68c73705.entry.js +2 -0
- package/dist/capsule/p-68c73705.entry.js.map +1 -0
- package/dist/capsule/p-6fb7c4d1.js +3 -0
- package/dist/capsule/p-6fb7c4d1.js.map +1 -0
- package/dist/capsule/p-81a385a0.entry.js +29 -0
- package/dist/capsule/p-81a385a0.entry.js.map +1 -0
- package/dist/capsule/p-91412151.entry.js +2 -0
- package/dist/capsule/p-91412151.entry.js.map +1 -0
- package/dist/capsule/p-a95ec4df.entry.js +2 -0
- package/dist/capsule/p-a95ec4df.entry.js.map +1 -0
- package/dist/capsule/p-c2bf050b.js +2 -0
- package/dist/capsule/p-c2bf050b.js.map +1 -0
- package/dist/capsule/p-d7be092d.entry.js +10 -0
- package/dist/capsule/p-d7be092d.entry.js.map +1 -0
- package/dist/capsule/p-e1255160.js +2 -0
- package/dist/capsule/p-e1255160.js.map +1 -0
- package/dist/capsule/p-f604b591.entry.js +2 -0
- package/dist/capsule/p-f604b591.entry.js.map +1 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +27 -0
- package/dist/cjs/capsule.cjs.js.map +1 -0
- package/dist/cjs/constants-4bb85cc5.js +12 -0
- package/dist/cjs/constants-4bb85cc5.js.map +1 -0
- package/dist/cjs/cpsl-alert_17.cjs.entry.js +10710 -0
- package/dist/cjs/cpsl-alert_17.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +20129 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-col.cjs.entry.js +125 -0
- package/dist/cjs/cpsl-col.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-grid.cjs.entry.js +25 -0
- package/dist/cjs/cpsl-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-info-box.cjs.entry.js +22 -0
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-row.cjs.entry.js +22 -0
- package/dist/cjs/cpsl-row.cjs.entry.js.map +1 -0
- package/dist/cjs/index-3fccb5b4.js +2012 -0
- package/dist/cjs/index-3fccb5b4.js.map +1 -0
- package/dist/cjs/index.cjs.js +342 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/assets/icons/alert-circle.svg +3 -0
- package/dist/collection/assets/icons/angel-list-brand.svg +3 -0
- package/dist/collection/assets/icons/angel-list.svg +3 -0
- package/dist/collection/assets/icons/apple-brand.svg +3 -0
- package/dist/collection/assets/icons/apple.svg +3 -0
- package/dist/collection/assets/icons/arrow-narrow.svg +3 -0
- package/dist/collection/assets/icons/arrow.svg +3 -0
- package/dist/collection/assets/icons/backup-kit.svg +4 -0
- package/dist/collection/assets/icons/capsule-logo.svg +18 -0
- package/dist/collection/assets/icons/capsule-rings-dark.svg +34 -0
- package/dist/collection/assets/icons/capsule-rings.svg +34 -0
- package/dist/collection/assets/icons/capsule.svg +4 -0
- package/dist/collection/assets/icons/check.svg +3 -0
- package/dist/collection/assets/icons/clock.svg +3 -0
- package/dist/collection/assets/icons/close.svg +4 -0
- package/dist/collection/assets/icons/clubhouse-brand.svg +4 -0
- package/dist/collection/assets/icons/clubhouse.svg +4 -0
- package/dist/collection/assets/icons/copy.svg +3 -0
- package/dist/collection/assets/icons/discord-brand.svg +4 -0
- package/dist/collection/assets/icons/discord.svg +4 -0
- package/dist/collection/assets/icons/download-cloud.svg +3 -0
- package/dist/collection/assets/icons/dribbble-brand.svg +4 -0
- package/dist/collection/assets/icons/dribbble.svg +3 -0
- package/dist/collection/assets/icons/eye-off.svg +3 -0
- package/dist/collection/assets/icons/eye.svg +4 -0
- package/dist/collection/assets/icons/facebook-brand.svg +11 -0
- package/dist/collection/assets/icons/facebook.svg +10 -0
- package/dist/collection/assets/icons/figma-brand.svg +14 -0
- package/dist/collection/assets/icons/figma.svg +3 -0
- package/dist/collection/assets/icons/github-brand.svg +10 -0
- package/dist/collection/assets/icons/github.svg +10 -0
- package/dist/collection/assets/icons/google-brand.svg +13 -0
- package/dist/collection/assets/icons/google.svg +10 -0
- package/dist/collection/assets/icons/help-circle.svg +3 -0
- package/dist/collection/assets/icons/hero-email.svg +12 -0
- package/dist/collection/assets/icons/hero-lock.svg +4 -0
- package/dist/collection/assets/icons/hero-passkey.svg +12 -0
- package/dist/collection/assets/icons/hero-phone.svg +4 -0
- package/dist/collection/assets/icons/hero-wallet.svg +5 -0
- package/dist/collection/assets/icons/index.js +70 -0
- package/dist/collection/assets/icons/index.js.map +1 -0
- package/dist/collection/assets/icons/info-circle.svg +3 -0
- package/dist/collection/assets/icons/instagram-brand.svg +12 -0
- package/dist/collection/assets/icons/instagram.svg +12 -0
- package/dist/collection/assets/icons/key.svg +3 -0
- package/dist/collection/assets/icons/linkedin-brand.svg +10 -0
- package/dist/collection/assets/icons/linkedin.svg +10 -0
- package/dist/collection/assets/icons/mail.svg +3 -0
- package/dist/collection/assets/icons/more-login-options.svg +13 -0
- package/dist/collection/assets/icons/phone.svg +3 -0
- package/dist/collection/assets/icons/pintrest-brand.svg +11 -0
- package/dist/collection/assets/icons/pintrest.svg +10 -0
- package/dist/collection/assets/icons/plus-circle.svg +5 -0
- package/dist/collection/assets/icons/reddit-brand.svg +11 -0
- package/dist/collection/assets/icons/reddit.svg +3 -0
- package/dist/collection/assets/icons/signal-brand.svg +3 -0
- package/dist/collection/assets/icons/signal.svg +3 -0
- package/dist/collection/assets/icons/snapchat-brand.svg +4 -0
- package/dist/collection/assets/icons/snapchat.svg +3 -0
- package/dist/collection/assets/icons/telegram-brand.svg +15 -0
- package/dist/collection/assets/icons/telegram.svg +10 -0
- package/dist/collection/assets/icons/tik-tok-brand.svg +5 -0
- package/dist/collection/assets/icons/tik-tok.svg +3 -0
- package/dist/collection/assets/icons/tumblr-brand.svg +10 -0
- package/dist/collection/assets/icons/tumblr.svg +10 -0
- package/dist/collection/assets/icons/twitter-brand.svg +3 -0
- package/dist/collection/assets/icons/twitter.svg +3 -0
- package/dist/collection/assets/icons/wallet.svg +5 -0
- package/dist/collection/assets/icons/youtube-brand.svg +11 -0
- package/dist/collection/assets/icons/youtube.svg +3 -0
- package/dist/collection/collection-manifest.json +33 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.css +98 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +80 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -0
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js +29 -0
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js +37 -0
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js.map +1 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.css +17 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js +102 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +29 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +37 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +1 -0
- package/dist/collection/components/cpsl-button/cpsl-button.css +162 -0
- package/dist/collection/components/cpsl-button/cpsl-button.js +68 -0
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -0
- package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js +29 -0
- package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js +37 -0
- package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js.map +1 -0
- package/dist/collection/components/cpsl-code-input/code-change-interface.js +2 -0
- package/dist/collection/components/cpsl-code-input/code-change-interface.js.map +1 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +134 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +223 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -0
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js +29 -0
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js +37 -0
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js.map +1 -0
- package/dist/collection/components/cpsl-col/cpsl-col.css +200 -0
- package/dist/collection/components/cpsl-col/cpsl-col.js +528 -0
- package/dist/collection/components/cpsl-col/cpsl-col.js.map +1 -0
- package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js +29 -0
- package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js +37 -0
- package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js.map +1 -0
- package/dist/collection/components/cpsl-divider/cpsl-divider.css +73 -0
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +19 -0
- package/dist/collection/components/cpsl-divider/cpsl-divider.js.map +1 -0
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js +29 -0
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js +37 -0
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js.map +1 -0
- package/dist/collection/components/cpsl-grid/cpsl-grid.css +235 -0
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +46 -0
- package/dist/collection/components/cpsl-grid/cpsl-grid.js.map +1 -0
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js +29 -0
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js +37 -0
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js.map +1 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +95 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +68 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -0
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js +29 -0
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js +37 -0
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js.map +1 -0
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +77 -0
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +19 -0
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js.map +1 -0
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js +29 -0
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js +37 -0
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js.map +1 -0
- package/dist/collection/components/cpsl-input/cpsl-input.css +194 -0
- package/dist/collection/components/cpsl-input/cpsl-input.js +708 -0
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -0
- package/dist/collection/components/cpsl-input/input-interface.js +2 -0
- package/dist/collection/components/cpsl-input/input-interface.js.map +1 -0
- package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js +29 -0
- package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js +37 -0
- package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js.map +1 -0
- package/dist/collection/components/cpsl-modal/cpsl-modal.css +172 -0
- package/dist/collection/components/cpsl-modal/cpsl-modal.js +429 -0
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -0
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js +29 -0
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js +37 -0
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js.map +1 -0
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +11 -0
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +108 -0
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -0
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js +29 -0
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js +37 -0
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js.map +1 -0
- package/dist/collection/components/cpsl-pill/cpsl-pill.css +92 -0
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +43 -0
- package/dist/collection/components/cpsl-pill/cpsl-pill.js.map +1 -0
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js +29 -0
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js +37 -0
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js.map +1 -0
- package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +82 -0
- package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.js +71 -0
- package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.js.map +1 -0
- package/dist/collection/components/cpsl-progress-indicator/progress-indicator-interface.js +2 -0
- package/dist/collection/components/cpsl-progress-indicator/progress-indicator-interface.js.map +1 -0
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js +29 -0
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js +37 -0
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js.map +1 -0
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +81 -0
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +107 -0
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -0
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js +29 -0
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js +37 -0
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js.map +1 -0
- package/dist/collection/components/cpsl-row/cpsl-row.css +136 -0
- package/dist/collection/components/cpsl-row/cpsl-row.js +19 -0
- package/dist/collection/components/cpsl-row/cpsl-row.js.map +1 -0
- package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js +29 -0
- package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js +37 -0
- package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js.map +1 -0
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +175 -0
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +252 -0
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -0
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js +29 -0
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js +37 -0
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js.map +1 -0
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +68 -0
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +69 -0
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -0
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js +29 -0
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js +37 -0
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js.map +1 -0
- package/dist/collection/components/cpsl-tab/cpsl-tab.css +23 -0
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +121 -0
- package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -0
- package/dist/collection/components/cpsl-tab/tab-interface.js +2 -0
- package/dist/collection/components/cpsl-tab/tab-interface.js.map +1 -0
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js +29 -0
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js +37 -0
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js.map +1 -0
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +111 -0
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +170 -0
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -0
- package/dist/collection/components/cpsl-tabs/tabs-interface.js +2 -0
- package/dist/collection/components/cpsl-tabs/tabs-interface.js.map +1 -0
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js +29 -0
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js +37 -0
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js.map +1 -0
- package/dist/collection/components/cpsl-text/cpsl-text.css +59 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js +19 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -0
- package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js +29 -0
- package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js +37 -0
- package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js.map +1 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +97 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +67 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js.map +1 -0
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js +29 -0
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js +37 -0
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js.map +1 -0
- package/dist/collection/constants.js +6 -0
- package/dist/collection/constants.js.map +1 -0
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/interface.js +2 -0
- package/dist/collection/interface.js.map +1 -0
- package/dist/collection/utils/media.js +18 -0
- package/dist/collection/utils/media.js.map +1 -0
- package/dist/collection/utils/theme/generateBorderRadii.js +56 -0
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -0
- package/dist/collection/utils/theme/generateFont.js +7 -0
- package/dist/collection/utils/theme/generateFont.js.map +1 -0
- package/dist/collection/utils/theme/generatePalette.js +46 -0
- package/dist/collection/utils/theme/generatePalette.js.map +1 -0
- package/dist/collection/utils/theme/generateTheme.js +12 -0
- package/dist/collection/utils/theme/generateTheme.js.map +1 -0
- package/dist/collection/utils/theme/utils.js +21 -0
- package/dist/collection/utils/theme/utils.js.map +1 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/esm/capsule.js +22 -0
- package/dist/esm/capsule.js.map +1 -0
- package/dist/esm/cpsl-alert_17.entry.js +10690 -0
- package/dist/esm/cpsl-alert_17.entry.js.map +1 -0
- package/dist/{capsule → esm}/cpsl-animation.entry.js +20 -114
- package/dist/esm/cpsl-animation.entry.js.map +1 -0
- package/dist/{capsule → esm}/cpsl-col.entry.js +4 -3
- package/dist/esm/cpsl-col.entry.js.map +1 -0
- package/dist/{capsule → esm}/cpsl-grid.entry.js +5 -4
- package/dist/esm/cpsl-grid.entry.js.map +1 -0
- package/dist/{capsule → esm}/cpsl-info-box.entry.js +4 -3
- package/dist/esm/cpsl-info-box.entry.js.map +1 -0
- package/dist/esm/cpsl-row.entry.js +18 -0
- package/dist/esm/cpsl-row.entry.js.map +1 -0
- package/dist/esm/index-f00e090c.js +1982 -0
- package/dist/esm/index-f00e090c.js.map +1 -0
- package/dist/esm/index.js +338 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +11 -0
- package/dist/scripts/buildIconLibrary.js +33 -0
- package/dist/scripts/buildIconLibrary.js.map +1 -0
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +0 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interface.d.ts +0 -15
- package/dist/types/utils/theme/generateFont.d.ts +1 -1
- package/dist/types/utils/theme/generateTheme.d.ts +2 -1
- package/package.json +2 -2
- package/dist/capsule/_commonjsHelpers-bc8ff177.js +0 -36
- package/dist/capsule/_commonjsHelpers-bc8ff177.js.map +0 -1
- package/dist/capsule/cpsl-alert.entry.js +0 -31
- package/dist/capsule/cpsl-alert.entry.js.map +0 -1
- package/dist/capsule/cpsl-animation.entry.js.map +0 -1
- package/dist/capsule/cpsl-button.entry.js +0 -24
- package/dist/capsule/cpsl-button.entry.js.map +0 -1
- package/dist/capsule/cpsl-code-input.entry.js +0 -106
- package/dist/capsule/cpsl-code-input.entry.js.map +0 -1
- package/dist/capsule/cpsl-col.entry.js.map +0 -1
- package/dist/capsule/cpsl-divider.entry.js +0 -17
- package/dist/capsule/cpsl-divider.entry.js.map +0 -1
- package/dist/capsule/cpsl-grid.entry.js.map +0 -1
- package/dist/capsule/cpsl-icon.entry.js +0 -20
- package/dist/capsule/cpsl-icon.entry.js.map +0 -1
- package/dist/capsule/cpsl-info-box.entry.js.map +0 -1
- package/dist/capsule/cpsl-input.entry.js +0 -124
- package/dist/capsule/cpsl-input.entry.js.map +0 -1
- package/dist/capsule/cpsl-modal.entry.js +0 -3338
- package/dist/capsule/cpsl-modal.entry.js.map +0 -1
- package/dist/capsule/cpsl-overlay.entry.js +0 -44
- package/dist/capsule/cpsl-overlay.entry.js.map +0 -1
- package/dist/capsule/cpsl-pill.entry.js +0 -18
- package/dist/capsule/cpsl-pill.entry.js.map +0 -1
- package/dist/capsule/cpsl-progress-indicator.entry.js +0 -29
- package/dist/capsule/cpsl-progress-indicator.entry.js.map +0 -1
- package/dist/capsule/cpsl-qr-code.entry.js +0 -56
- package/dist/capsule/cpsl-qr-code.entry.js.map +0 -1
- package/dist/capsule/cpsl-row.entry.js +0 -17
- package/dist/capsule/cpsl-row.entry.js.map +0 -1
- package/dist/capsule/cpsl-slide-button.entry.js +0 -130
- package/dist/capsule/cpsl-slide-button.entry.js.map +0 -1
- package/dist/capsule/cpsl-spinner.entry.js +0 -25
- package/dist/capsule/cpsl-spinner.entry.js.map +0 -1
- package/dist/capsule/cpsl-tab.entry.js +0 -37
- package/dist/capsule/cpsl-tab.entry.js.map +0 -1
- package/dist/capsule/cpsl-tabs.entry.js +0 -71
- package/dist/capsule/cpsl-tabs.entry.js.map +0 -1
- package/dist/capsule/cpsl-text.entry.js +0 -66
- package/dist/capsule/cpsl-text.entry.js.map +0 -1
- package/dist/capsule/cpsl-tile-button.entry.js +0 -19
- package/dist/capsule/cpsl-tile-button.entry.js.map +0 -1
- package/dist/capsule/index-3ac1b9e9.js +0 -617
- package/dist/capsule/index-3ac1b9e9.js.map +0 -1
- package/dist/capsule/index-3ad00c7e.js +0 -6064
- package/dist/capsule/index-3ad00c7e.js.map +0 -1
- package/dist/capsule/index-f19e63df.js +0 -4148
- package/dist/capsule/index-f19e63df.js.map +0 -1
- package/dist/capsule/shadow-css-bc9e2af8.js +0 -478
- package/dist/capsule/shadow-css-bc9e2af8.js.map +0 -1
- /package/dist/{capsule → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{capsule → esm}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{capsule → esm}/constants-7b49abd5.js +0 -0
- /package/dist/{capsule → esm}/constants-7b49abd5.js.map +0 -0
@@ -0,0 +1,429 @@
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
|
+
import gsap from "gsap";
|
3
|
+
import Draggable from "gsap/Draggable";
|
4
|
+
import { MOBILE_SIZE } from "../../constants";
|
5
|
+
gsap.registerPlugin(Draggable);
|
6
|
+
const mm = gsap.matchMedia();
|
7
|
+
export class CpslModal {
|
8
|
+
constructor() {
|
9
|
+
this.getDraggableHeight = () => {
|
10
|
+
return this.innerContainerEl.clientHeight;
|
11
|
+
};
|
12
|
+
this.hasFooter = undefined;
|
13
|
+
this.enterTransitionDuration = 0.15;
|
14
|
+
this.exitTransitionDuration = 0.15;
|
15
|
+
this.footerExpanded = undefined;
|
16
|
+
this.footerTransitionDuration = 0.15;
|
17
|
+
this.noOverlay = undefined;
|
18
|
+
this.open = undefined;
|
19
|
+
}
|
20
|
+
toggleHeight() {
|
21
|
+
this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();
|
22
|
+
}
|
23
|
+
toggleModal() {
|
24
|
+
if (this.hasAnimatedIn) {
|
25
|
+
this.handleAnimation();
|
26
|
+
}
|
27
|
+
}
|
28
|
+
componentDidLoad() {
|
29
|
+
this.handleAnimation();
|
30
|
+
this.hasAnimatedIn = true;
|
31
|
+
mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {
|
32
|
+
var _a;
|
33
|
+
(_a = this.draggable) === null || _a === void 0 ? void 0 : _a.disable();
|
34
|
+
gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });
|
35
|
+
});
|
36
|
+
mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {
|
37
|
+
this.initDraggable();
|
38
|
+
gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });
|
39
|
+
});
|
40
|
+
this.footerSlotEl.addEventListener('slotchange', () => {
|
41
|
+
if (this.footerSlotEl.assignedNodes().length >= 1) {
|
42
|
+
this.hasFooter = true;
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
this.hasFooter = false;
|
46
|
+
}
|
47
|
+
});
|
48
|
+
}
|
49
|
+
handleAnimation() {
|
50
|
+
if (this.open) {
|
51
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
52
|
+
gsap
|
53
|
+
.timeline({
|
54
|
+
onStart: () => {
|
55
|
+
this.cpslModalEntering.emit();
|
56
|
+
},
|
57
|
+
onComplete: () => {
|
58
|
+
this.addExpandAnim();
|
59
|
+
this.cpslModalEntered.emit();
|
60
|
+
},
|
61
|
+
})
|
62
|
+
.set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })
|
63
|
+
.to(this.modalWrapperEl, {
|
64
|
+
scale: 1,
|
65
|
+
opacity: 1,
|
66
|
+
duration: this.enterTransitionDuration,
|
67
|
+
});
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
gsap
|
71
|
+
.timeline({
|
72
|
+
onStart: () => {
|
73
|
+
this.cpslModalEntering.emit();
|
74
|
+
},
|
75
|
+
onComplete: () => {
|
76
|
+
this.addExpandAnim();
|
77
|
+
this.cpslModalEntered.emit();
|
78
|
+
},
|
79
|
+
})
|
80
|
+
.set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })
|
81
|
+
.to(this.modalWrapperEl, {
|
82
|
+
yPercent: -100,
|
83
|
+
duration: this.enterTransitionDuration,
|
84
|
+
});
|
85
|
+
}
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
89
|
+
gsap
|
90
|
+
.timeline({
|
91
|
+
onStart: () => {
|
92
|
+
this.cpslModalExiting.emit();
|
93
|
+
},
|
94
|
+
onComplete: () => {
|
95
|
+
this.cpslModalExited.emit();
|
96
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
97
|
+
},
|
98
|
+
})
|
99
|
+
.to(this.modalWrapperEl, {
|
100
|
+
scale: 0.8,
|
101
|
+
opacity: 0,
|
102
|
+
duration: this.exitTransitionDuration,
|
103
|
+
});
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
gsap
|
107
|
+
.timeline({
|
108
|
+
onStart: () => {
|
109
|
+
this.cpslModalExiting.emit();
|
110
|
+
},
|
111
|
+
onComplete: () => {
|
112
|
+
this.cpslModalExited.emit();
|
113
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
114
|
+
},
|
115
|
+
})
|
116
|
+
.to(this.modalWrapperEl, {
|
117
|
+
yPercent: 0,
|
118
|
+
duration: this.exitTransitionDuration,
|
119
|
+
})
|
120
|
+
.set(this.modalContainerEl, { y: 0 });
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
addExpandAnim() {
|
125
|
+
setTimeout(() => {
|
126
|
+
this.expandFooterTl = gsap
|
127
|
+
.timeline({
|
128
|
+
reversed: true,
|
129
|
+
paused: true,
|
130
|
+
onReverseComplete: () => {
|
131
|
+
this.contentEl.style.setProperty('height', 'auto');
|
132
|
+
},
|
133
|
+
defaults: {
|
134
|
+
duration: this.footerTransitionDuration,
|
135
|
+
},
|
136
|
+
})
|
137
|
+
.set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })
|
138
|
+
.set(this.headerExpandedEl, { display: 'block' })
|
139
|
+
.to(this.innerContainerEl, { paddingBottom: '8px' })
|
140
|
+
.to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
141
|
+
.to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
142
|
+
.to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')
|
143
|
+
.to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');
|
144
|
+
}, 10);
|
145
|
+
}
|
146
|
+
initDraggable() {
|
147
|
+
this.draggable = Draggable.create(this.modalContainerEl, {
|
148
|
+
trigger: this.headerEl,
|
149
|
+
dragClickables: false,
|
150
|
+
type: 'y',
|
151
|
+
edgeResistance: 0.2,
|
152
|
+
liveSnap: {
|
153
|
+
y: function (y) {
|
154
|
+
if (y < 0)
|
155
|
+
return 0;
|
156
|
+
return y;
|
157
|
+
},
|
158
|
+
},
|
159
|
+
onDrag: () => {
|
160
|
+
const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);
|
161
|
+
gsap.set(this.overlayEl, { opacity: y });
|
162
|
+
},
|
163
|
+
onDragEnd: () => {
|
164
|
+
if (this.draggable.y > 60) {
|
165
|
+
this.cpslModalRequestClose.emit();
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
gsap.set(this.overlayEl, { opacity: 1 });
|
169
|
+
gsap.set(this.modalWrapperEl, { yPercent: -100 });
|
170
|
+
gsap.set(this.modalContainerEl, { y: 0 });
|
171
|
+
}
|
172
|
+
},
|
173
|
+
})[0];
|
174
|
+
}
|
175
|
+
get footerEl() {
|
176
|
+
return this.el.shadowRoot.getElementById('modal-footer');
|
177
|
+
}
|
178
|
+
get footerExpandedEl() {
|
179
|
+
return this.el.shadowRoot.getElementById('modal-footer-expanded');
|
180
|
+
}
|
181
|
+
get headerExpandedEl() {
|
182
|
+
return this.el.shadowRoot.getElementById('modal-header-expanded');
|
183
|
+
}
|
184
|
+
get innerContainerEl() {
|
185
|
+
return this.el.shadowRoot.getElementById('modal-inner-container');
|
186
|
+
}
|
187
|
+
get contentEl() {
|
188
|
+
return this.el.shadowRoot.getElementById('modal-content');
|
189
|
+
}
|
190
|
+
get modalWrapperEl() {
|
191
|
+
return this.el.shadowRoot.getElementById('modal-wrapper');
|
192
|
+
}
|
193
|
+
get modalContainerEl() {
|
194
|
+
return this.el.shadowRoot.getElementById('modal-container');
|
195
|
+
}
|
196
|
+
get overlayEl() {
|
197
|
+
return this.el.shadowRoot.getElementById('overlay');
|
198
|
+
}
|
199
|
+
get footerSlotEl() {
|
200
|
+
return this.footerEl.querySelectorAll('slot')[0];
|
201
|
+
}
|
202
|
+
get headerEl() {
|
203
|
+
return this.el.shadowRoot.getElementById('modal-header');
|
204
|
+
}
|
205
|
+
get Modal() {
|
206
|
+
return (h("div", { class: { 'modal-container': true, 'no-footer': !this.hasFooter }, part: "modal-container", id: "modal-container" }, h("slot", null), h("div", { id: "modal-inner-container", class: { 'modal-inner-container': true, 'no-footer': !this.hasFooter }, part: "modal-inner-container" }, h("div", { id: "modal-content", part: "modal-content" }, h("div", { id: "modal-header", class: "modal-header", part: "modal-header" }, h("slot", { name: "header" })), h("div", { id: "modal-body", class: "modal-body", part: "modal-body" }, h("slot", { name: "body" }))), h("div", { id: "modal-header-expanded", class: { 'modal-header': true, 'expanded': true, 'no-opacity': true }, part: "modal-header-expanded" }, h("slot", { name: "footerExpandedHeader" }))), h("div", { id: "modal-footer", part: "modal-footer" }, h("slot", { name: "footer" })), h("div", { id: "modal-footer-expanded", class: { 'expanded': true, 'no-opacity': true }, part: "modal-footer-expanded" }, h("slot", { name: "footerExpandedFooter" }))));
|
207
|
+
}
|
208
|
+
render() {
|
209
|
+
if (this.noOverlay) {
|
210
|
+
return h(Host, null, this.Modal);
|
211
|
+
}
|
212
|
+
return (h(Host, { class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
|
213
|
+
}
|
214
|
+
static get is() { return "cpsl-modal"; }
|
215
|
+
static get encapsulation() { return "shadow"; }
|
216
|
+
static get originalStyleUrls() {
|
217
|
+
return {
|
218
|
+
"$": ["cpsl-modal.scss"]
|
219
|
+
};
|
220
|
+
}
|
221
|
+
static get styleUrls() {
|
222
|
+
return {
|
223
|
+
"$": ["cpsl-modal.css"]
|
224
|
+
};
|
225
|
+
}
|
226
|
+
static get properties() {
|
227
|
+
return {
|
228
|
+
"enterTransitionDuration": {
|
229
|
+
"type": "number",
|
230
|
+
"mutable": false,
|
231
|
+
"complexType": {
|
232
|
+
"original": "number",
|
233
|
+
"resolved": "number",
|
234
|
+
"references": {}
|
235
|
+
},
|
236
|
+
"required": false,
|
237
|
+
"optional": true,
|
238
|
+
"docs": {
|
239
|
+
"tags": [],
|
240
|
+
"text": "Duration in seconds of the modal entering.\nDefault is .15."
|
241
|
+
},
|
242
|
+
"attribute": "enter-transition-duration",
|
243
|
+
"reflect": false,
|
244
|
+
"defaultValue": "0.15"
|
245
|
+
},
|
246
|
+
"exitTransitionDuration": {
|
247
|
+
"type": "number",
|
248
|
+
"mutable": false,
|
249
|
+
"complexType": {
|
250
|
+
"original": "number",
|
251
|
+
"resolved": "number",
|
252
|
+
"references": {}
|
253
|
+
},
|
254
|
+
"required": false,
|
255
|
+
"optional": true,
|
256
|
+
"docs": {
|
257
|
+
"tags": [],
|
258
|
+
"text": "Duration in seconds of the modal exiting.\nDefault is .15."
|
259
|
+
},
|
260
|
+
"attribute": "exit-transition-duration",
|
261
|
+
"reflect": false,
|
262
|
+
"defaultValue": "0.15"
|
263
|
+
},
|
264
|
+
"footerExpanded": {
|
265
|
+
"type": "boolean",
|
266
|
+
"mutable": false,
|
267
|
+
"complexType": {
|
268
|
+
"original": "boolean",
|
269
|
+
"resolved": "boolean",
|
270
|
+
"references": {}
|
271
|
+
},
|
272
|
+
"required": false,
|
273
|
+
"optional": true,
|
274
|
+
"docs": {
|
275
|
+
"tags": [],
|
276
|
+
"text": "Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots."
|
277
|
+
},
|
278
|
+
"attribute": "footer-expanded",
|
279
|
+
"reflect": false
|
280
|
+
},
|
281
|
+
"footerTransitionDuration": {
|
282
|
+
"type": "number",
|
283
|
+
"mutable": false,
|
284
|
+
"complexType": {
|
285
|
+
"original": "number",
|
286
|
+
"resolved": "number",
|
287
|
+
"references": {}
|
288
|
+
},
|
289
|
+
"required": false,
|
290
|
+
"optional": true,
|
291
|
+
"docs": {
|
292
|
+
"tags": [],
|
293
|
+
"text": "Duration in seconds of the footer expansion animation.\nDefault is 0.15."
|
294
|
+
},
|
295
|
+
"attribute": "footer-transition-duration",
|
296
|
+
"reflect": false,
|
297
|
+
"defaultValue": "0.15"
|
298
|
+
},
|
299
|
+
"noOverlay": {
|
300
|
+
"type": "boolean",
|
301
|
+
"mutable": false,
|
302
|
+
"complexType": {
|
303
|
+
"original": "boolean",
|
304
|
+
"resolved": "boolean",
|
305
|
+
"references": {}
|
306
|
+
},
|
307
|
+
"required": false,
|
308
|
+
"optional": true,
|
309
|
+
"docs": {
|
310
|
+
"tags": [],
|
311
|
+
"text": "Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`."
|
312
|
+
},
|
313
|
+
"attribute": "no-overlay",
|
314
|
+
"reflect": false
|
315
|
+
},
|
316
|
+
"open": {
|
317
|
+
"type": "boolean",
|
318
|
+
"mutable": false,
|
319
|
+
"complexType": {
|
320
|
+
"original": "boolean",
|
321
|
+
"resolved": "boolean",
|
322
|
+
"references": {}
|
323
|
+
},
|
324
|
+
"required": false,
|
325
|
+
"optional": false,
|
326
|
+
"docs": {
|
327
|
+
"tags": [],
|
328
|
+
"text": "Whether or not to show the modal."
|
329
|
+
},
|
330
|
+
"attribute": "open",
|
331
|
+
"reflect": false
|
332
|
+
}
|
333
|
+
};
|
334
|
+
}
|
335
|
+
static get states() {
|
336
|
+
return {
|
337
|
+
"hasFooter": {}
|
338
|
+
};
|
339
|
+
}
|
340
|
+
static get events() {
|
341
|
+
return [{
|
342
|
+
"method": "cpslModalEntering",
|
343
|
+
"name": "cpslModalEntering",
|
344
|
+
"bubbles": true,
|
345
|
+
"cancelable": true,
|
346
|
+
"composed": true,
|
347
|
+
"docs": {
|
348
|
+
"tags": [],
|
349
|
+
"text": "Emitted when enter animation starts."
|
350
|
+
},
|
351
|
+
"complexType": {
|
352
|
+
"original": "null",
|
353
|
+
"resolved": "null",
|
354
|
+
"references": {}
|
355
|
+
}
|
356
|
+
}, {
|
357
|
+
"method": "cpslModalEntered",
|
358
|
+
"name": "cpslModalEntered",
|
359
|
+
"bubbles": true,
|
360
|
+
"cancelable": true,
|
361
|
+
"composed": true,
|
362
|
+
"docs": {
|
363
|
+
"tags": [],
|
364
|
+
"text": "Emitted when enter animation finishes."
|
365
|
+
},
|
366
|
+
"complexType": {
|
367
|
+
"original": "null",
|
368
|
+
"resolved": "null",
|
369
|
+
"references": {}
|
370
|
+
}
|
371
|
+
}, {
|
372
|
+
"method": "cpslModalExiting",
|
373
|
+
"name": "cpslModalExiting",
|
374
|
+
"bubbles": true,
|
375
|
+
"cancelable": true,
|
376
|
+
"composed": true,
|
377
|
+
"docs": {
|
378
|
+
"tags": [],
|
379
|
+
"text": "Emitted when exit animation starts."
|
380
|
+
},
|
381
|
+
"complexType": {
|
382
|
+
"original": "null",
|
383
|
+
"resolved": "null",
|
384
|
+
"references": {}
|
385
|
+
}
|
386
|
+
}, {
|
387
|
+
"method": "cpslModalExited",
|
388
|
+
"name": "cpslModalExited",
|
389
|
+
"bubbles": true,
|
390
|
+
"cancelable": true,
|
391
|
+
"composed": true,
|
392
|
+
"docs": {
|
393
|
+
"tags": [],
|
394
|
+
"text": "Emitted when exit animation finishes."
|
395
|
+
},
|
396
|
+
"complexType": {
|
397
|
+
"original": "null",
|
398
|
+
"resolved": "null",
|
399
|
+
"references": {}
|
400
|
+
}
|
401
|
+
}, {
|
402
|
+
"method": "cpslModalRequestClose",
|
403
|
+
"name": "cpslModalRequestClose",
|
404
|
+
"bubbles": true,
|
405
|
+
"cancelable": true,
|
406
|
+
"composed": true,
|
407
|
+
"docs": {
|
408
|
+
"tags": [],
|
409
|
+
"text": "Emitted when exit animation finishes."
|
410
|
+
},
|
411
|
+
"complexType": {
|
412
|
+
"original": "null",
|
413
|
+
"resolved": "null",
|
414
|
+
"references": {}
|
415
|
+
}
|
416
|
+
}];
|
417
|
+
}
|
418
|
+
static get elementRef() { return "el"; }
|
419
|
+
static get watchers() {
|
420
|
+
return [{
|
421
|
+
"propName": "footerExpanded",
|
422
|
+
"methodName": "toggleHeight"
|
423
|
+
}, {
|
424
|
+
"propName": "open",
|
425
|
+
"methodName": "toggleModal"
|
426
|
+
}];
|
427
|
+
}
|
428
|
+
}
|
429
|
+
//# sourceMappingURL=cpsl-modal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-modal.js","sourceRoot":"","sources":["../../../../src/components/cpsl-modal/cpsl-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SA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Ac,EAAC,IAAI,EAAC,cAAc;gBACxC,YAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB;YACN,WAAK,EAAE,EAAC,uBAAuB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,IAAI,EAAC,uBAAuB;gBAC3G,YAAM,IAAI,EAAC,sBAAsB,GAAQ,CACrC,CACF,CACP,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,EAAC,IAAI,QAAE,IAAI,CAAC,KAAK,CAAQ,CAAC;QACnC,CAAC;QAED,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,wBAAwB,EAAE,IAAI,EAAE;YAC7C,oBAAc,EAAE,EAAC,SAAS,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GAAI;YAC1J,WAAK,EAAE,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe,IAC1C,IAAI,CAAC,KAAK,CACP,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport gsap from 'gsap';\nimport Draggable from 'gsap/Draggable';\nimport { MOBILE_SIZE } from '../../constants';\n\ngsap.registerPlugin(Draggable);\nconst mm = gsap.matchMedia();\n@Component({\n tag: 'cpsl-modal',\n styleUrl: 'cpsl-modal.scss',\n shadow: true,\n})\nexport class CpslModal {\n private draggable: Draggable;\n private expandFooterTl: gsap.core.Timeline;\n private hasAnimatedIn: boolean;\n\n @Element() el!: HTMLCpslModalElement;\n\n @State() hasFooter: boolean;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.\n */\n @Prop() footerExpanded?: boolean;\n\n /**\n * Duration in seconds of the footer expansion animation.\n * Default is 0.15.\n */\n @Prop() footerTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.\n */\n @Prop() noOverlay?: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalRequestClose!: EventEmitter<null>;\n\n @Watch('footerExpanded')\n toggleHeight() {\n this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();\n }\n\n @Watch('open')\n toggleModal() {\n if (this.hasAnimatedIn) {\n this.handleAnimation();\n }\n }\n\n componentDidLoad() {\n this.handleAnimation();\n this.hasAnimatedIn = true;\n\n mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {\n this.draggable?.disable();\n gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });\n });\n mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {\n this.initDraggable();\n gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });\n });\n\n this.footerSlotEl.addEventListener('slotchange', () => {\n if (this.footerSlotEl.assignedNodes().length >= 1) {\n this.hasFooter = true;\n } else {\n this.hasFooter = false;\n }\n });\n }\n\n private handleAnimation() {\n if (this.open) {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })\n .to(this.modalWrapperEl, {\n scale: 1,\n opacity: 1,\n duration: this.enterTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })\n .to(this.modalWrapperEl, {\n yPercent: -100,\n duration: this.enterTransitionDuration,\n });\n }\n } else {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n scale: 0.8,\n opacity: 0,\n duration: this.exitTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n yPercent: 0,\n duration: this.exitTransitionDuration,\n })\n .set(this.modalContainerEl, { y: 0 });\n }\n }\n }\n\n private addExpandAnim() {\n setTimeout(() => {\n this.expandFooterTl = gsap\n .timeline({\n reversed: true,\n paused: true,\n onReverseComplete: () => {\n this.contentEl.style.setProperty('height', 'auto');\n },\n defaults: {\n duration: this.footerTransitionDuration,\n },\n })\n .set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })\n .set(this.headerExpandedEl, { display: 'block' })\n .to(this.innerContainerEl, { paddingBottom: '8px' })\n .to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')\n .to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');\n }, 10);\n }\n\n private getDraggableHeight = () => {\n return this.innerContainerEl.clientHeight;\n };\n\n private initDraggable() {\n this.draggable = Draggable.create(this.modalContainerEl, {\n trigger: this.headerEl,\n dragClickables: false,\n type: 'y',\n edgeResistance: 0.2,\n liveSnap: {\n y: function (y) {\n if (y < 0) return 0; // Restricts dragging to down\n return y;\n },\n },\n onDrag: () => {\n const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);\n gsap.set(this.overlayEl, { opacity: y });\n },\n onDragEnd: () => {\n if (this.draggable.y > 60) {\n this.cpslModalRequestClose.emit();\n } else {\n gsap.set(this.overlayEl, { opacity: 1 });\n gsap.set(this.modalWrapperEl, { yPercent: -100 });\n gsap.set(this.modalContainerEl, { y: 0 });\n }\n },\n })[0];\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get footerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-footer-expanded');\n }\n\n private get headerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-header-expanded');\n }\n\n private get innerContainerEl() {\n return this.el.shadowRoot.getElementById('modal-inner-container');\n }\n\n private get contentEl() {\n return this.el.shadowRoot.getElementById('modal-content');\n }\n\n private get modalWrapperEl() {\n return this.el.shadowRoot.getElementById('modal-wrapper');\n }\n\n private get modalContainerEl() {\n return this.el.shadowRoot.getElementById('modal-container');\n }\n\n private get overlayEl() {\n return this.el.shadowRoot.getElementById('overlay');\n }\n\n private get footerSlotEl() {\n return this.footerEl.querySelectorAll('slot')[0];\n }\n\n private get headerEl() {\n return this.el.shadowRoot.getElementById('modal-header');\n }\n\n private get Modal() {\n return (\n <div class={{ 'modal-container': true, 'no-footer': !this.hasFooter }} part=\"modal-container\" id=\"modal-container\">\n <slot></slot>\n <div id=\"modal-inner-container\" class={{ 'modal-inner-container': true, 'no-footer': !this.hasFooter }} part=\"modal-inner-container\">\n <div id=\"modal-content\" part=\"modal-content\">\n <div id=\"modal-header\" class=\"modal-header\" part=\"modal-header\">\n <slot name=\"header\"></slot>\n </div>\n <div id=\"modal-body\" class=\"modal-body\" part=\"modal-body\">\n <slot name=\"body\"></slot>\n </div>\n </div>\n <div id=\"modal-header-expanded\" class={{ 'modal-header': true, 'expanded': true, 'no-opacity': true }} part=\"modal-header-expanded\">\n <slot name=\"footerExpandedHeader\"></slot>\n </div>\n </div>\n <div id=\"modal-footer\" part=\"modal-footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div id=\"modal-footer-expanded\" class={{ 'expanded': true, 'no-opacity': true }} part=\"modal-footer-expanded\">\n <slot name=\"footerExpandedFooter\"></slot>\n </div>\n </div>\n );\n }\n\n render() {\n if (this.noOverlay) {\n return <Host>{this.Modal}</Host>;\n }\n\n return (\n <Host class={{ 'include-mobile-styling': true }}>\n <cpsl-overlay id=\"overlay\" open={this.open} enterTransitionDuration={this.enterTransitionDuration} exitTransitionDuration={this.exitTransitionDuration} />\n <div id=\"modal-wrapper\" class=\"modal-wrapper\">\n {this.Modal}\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try {
|
5
|
+
step(generator.next(value));
|
6
|
+
}
|
7
|
+
catch (e) {
|
8
|
+
reject(e);
|
9
|
+
} }
|
10
|
+
function rejected(value) { try {
|
11
|
+
step(generator["throw"](value));
|
12
|
+
}
|
13
|
+
catch (e) {
|
14
|
+
reject(e);
|
15
|
+
} }
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
|
+
});
|
19
|
+
};
|
20
|
+
import { newE2EPage } from "@stencil/core/testing";
|
21
|
+
describe('cpsl-modal', () => {
|
22
|
+
it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const page = yield newE2EPage();
|
24
|
+
yield page.setContent('<cpsl-modal></cpsl-modal>');
|
25
|
+
const element = yield page.find('cpsl-modal');
|
26
|
+
expect(element).toHaveClass('hydrated');
|
27
|
+
}));
|
28
|
+
});
|
29
|
+
//# sourceMappingURL=cpsl-modal.e2e.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-modal.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-modal/test/cpsl-modal.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QAEnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cpsl-modal', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-modal></cpsl-modal>');\n\n const element = await page.find('cpsl-modal');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try {
|
5
|
+
step(generator.next(value));
|
6
|
+
}
|
7
|
+
catch (e) {
|
8
|
+
reject(e);
|
9
|
+
} }
|
10
|
+
function rejected(value) { try {
|
11
|
+
step(generator["throw"](value));
|
12
|
+
}
|
13
|
+
catch (e) {
|
14
|
+
reject(e);
|
15
|
+
} }
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
|
+
});
|
19
|
+
};
|
20
|
+
import { newSpecPage } from "@stencil/core/testing";
|
21
|
+
import { CpslModal } from "../cpsl-modal";
|
22
|
+
describe('cpsl-modal', () => {
|
23
|
+
it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
+
const page = yield newSpecPage({
|
25
|
+
components: [CpslModal],
|
26
|
+
html: `<cpsl-modal></cpsl-modal>`,
|
27
|
+
});
|
28
|
+
expect(page.root).toEqualHtml(`
|
29
|
+
<cpsl-modal>
|
30
|
+
<mock:shadow-root>
|
31
|
+
<slot></slot>
|
32
|
+
</mock:shadow-root>
|
33
|
+
</cpsl-modal>
|
34
|
+
`);
|
35
|
+
}));
|
36
|
+
});
|
37
|
+
//# sourceMappingURL=cpsl-modal.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-modal.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-modal/test/cpsl-modal.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,2BAA2B;SAClC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CpslModal } from '../cpsl-modal';\n\ndescribe('cpsl-modal', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslModal],\n html: `<cpsl-modal></cpsl-modal>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-modal>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-modal>\n `);\n });\n});\n"]}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
|
+
import gsap from "gsap";
|
3
|
+
export class CpslOverlay {
|
4
|
+
constructor() {
|
5
|
+
this.open = undefined;
|
6
|
+
this.enterTransitionDuration = 0.5;
|
7
|
+
this.exitTransitionDuration = 0.5;
|
8
|
+
}
|
9
|
+
toggleHeight() {
|
10
|
+
this.open
|
11
|
+
? gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 })
|
12
|
+
: gsap.timeline({ defaults: { duration: this.exitTransitionDuration } }).to(this.el, { display: 'none', opacity: 0 });
|
13
|
+
if (this.open) {
|
14
|
+
document.documentElement.style.overflow = 'hidden';
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
setTimeout(() => {
|
18
|
+
document.documentElement.style.overflow = 'auto';
|
19
|
+
}, this.exitTransitionDuration * 1000);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
componentDidLoad() {
|
23
|
+
if (this.open) {
|
24
|
+
gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 });
|
25
|
+
document.documentElement.style.overflow = 'hidden';
|
26
|
+
}
|
27
|
+
}
|
28
|
+
render() {
|
29
|
+
return (h(Host, { key: '4d8c07e1704e32808745d92d5befa8a4145a779f' }, h("slot", { key: 'f767b8da95b657cf8c118c298c38acaf72af8e8c' })));
|
30
|
+
}
|
31
|
+
static get is() { return "cpsl-overlay"; }
|
32
|
+
static get encapsulation() { return "shadow"; }
|
33
|
+
static get originalStyleUrls() {
|
34
|
+
return {
|
35
|
+
"$": ["cpsl-overlay.scss"]
|
36
|
+
};
|
37
|
+
}
|
38
|
+
static get styleUrls() {
|
39
|
+
return {
|
40
|
+
"$": ["cpsl-overlay.css"]
|
41
|
+
};
|
42
|
+
}
|
43
|
+
static get properties() {
|
44
|
+
return {
|
45
|
+
"open": {
|
46
|
+
"type": "boolean",
|
47
|
+
"mutable": false,
|
48
|
+
"complexType": {
|
49
|
+
"original": "boolean",
|
50
|
+
"resolved": "boolean",
|
51
|
+
"references": {}
|
52
|
+
},
|
53
|
+
"required": false,
|
54
|
+
"optional": false,
|
55
|
+
"docs": {
|
56
|
+
"tags": [],
|
57
|
+
"text": "Whether or not to show the overlay."
|
58
|
+
},
|
59
|
+
"attribute": "open",
|
60
|
+
"reflect": false
|
61
|
+
},
|
62
|
+
"enterTransitionDuration": {
|
63
|
+
"type": "number",
|
64
|
+
"mutable": false,
|
65
|
+
"complexType": {
|
66
|
+
"original": "number",
|
67
|
+
"resolved": "number",
|
68
|
+
"references": {}
|
69
|
+
},
|
70
|
+
"required": false,
|
71
|
+
"optional": true,
|
72
|
+
"docs": {
|
73
|
+
"tags": [],
|
74
|
+
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
75
|
+
},
|
76
|
+
"attribute": "enter-transition-duration",
|
77
|
+
"reflect": false,
|
78
|
+
"defaultValue": "0.5"
|
79
|
+
},
|
80
|
+
"exitTransitionDuration": {
|
81
|
+
"type": "number",
|
82
|
+
"mutable": false,
|
83
|
+
"complexType": {
|
84
|
+
"original": "number",
|
85
|
+
"resolved": "number",
|
86
|
+
"references": {}
|
87
|
+
},
|
88
|
+
"required": false,
|
89
|
+
"optional": true,
|
90
|
+
"docs": {
|
91
|
+
"tags": [],
|
92
|
+
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
93
|
+
},
|
94
|
+
"attribute": "exit-transition-duration",
|
95
|
+
"reflect": false,
|
96
|
+
"defaultValue": "0.5"
|
97
|
+
}
|
98
|
+
};
|
99
|
+
}
|
100
|
+
static get elementRef() { return "el"; }
|
101
|
+
static get watchers() {
|
102
|
+
return [{
|
103
|
+
"propName": "open",
|
104
|
+
"methodName": "toggleHeight"
|
105
|
+
}];
|
106
|
+
}
|
107
|
+
}
|
108
|
+
//# sourceMappingURL=cpsl-overlay.js.map
|