@usecapsule/core-components 2.0.2 → 2.0.4-dev.1
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-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-cacdef26.entry.js +29 -0
- package/dist/capsule/p-cacdef26.entry.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 +10737 -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/decent-brand.svg +3 -0
- package/dist/collection/assets/icons/decent.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 +75 -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/lightning.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/ramp-network-brand.svg +3 -0
- package/dist/collection/assets/icons/ramp-network.svg +3 -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 +431 -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 +10717 -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/assets/icons/index.d.ts +5 -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
@@ -1,24 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, a as Host } from './index-f19e63df.js';
|
2
|
-
|
3
|
-
const cpslButtonCss = ":host{--button-border-radius:var(--cpsl-border-radius-primary-button);--button-border-width:1px;--button-gap:4px;--button-box-shadow:0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 2px 2px 0px var(--cpsl-color-alpha-white-25) inset, 0px -2px 2px 0px var(--cpsl-color-alpha-black-25) inset;--button-padding-top:10px;--button-padding-bottom:10px;--button-padding-start:16px;--button-padding-end:16px;--button-font-size:clamp(14px, 0.875rem, 21px);height:100%;width:100%;font-family:var(--cpsl-font-family, inherit)}:host(.button-disabled){cursor:default;pointer-events:none}:host(.primary){--button-color:var(--cpsl-color-text-inverted);--button-background-color:var(--cpsl-color-primary-button-surface-default);--button-border-color:var(--cpsl-color-primary-button-border-default)}:host(.primary):host(.button-disabled){--button-background-color:var(--cpsl-color-primary-button-surface-disabled);--button-border-color:var(--cpsl-color-primary-button-border-disabled);--button-box-shadow:none;--button-outline-color:transparent}:host(.primary) :not(.button-disabled):hover{--button-background-color:var(--cpsl-color-primary-button-surface-hover)}:host(.primary) :not(.button-disabled):active{--button-background-color:var(--cpsl-color-primary-button-surface-pressed)}:host(.primary) :not(.button-disabled):focus-visible{--button-outline-color:var(--cpsl-color-primary-button-outline)}:host(.primary) ::slotted(cpsl-icon){--icon-color:var(--cpsl-text-inverted)}:host(.secondary){--button-color:var(--cpsl-color-text-primary);--button-background-color:var(--cpsl-color-secondary-button-surface-default);--button-border-color:var(--cpsl-color-secondary-button-border-default)}:host(.secondary):host(.button-disabled){--button-background-color:var(--cpsl-color-secondary-button-surface-disabled);--button-border-color:var(--cpsl-color-secondary-button-border-disabled);--button-box-shadow:none;--button-outline-color:transparent}:host(.secondary) :not(.button-disabled):hover{--button-background-color:var(--cpsl-color-secondary-button-surface-hover)}:host(.secondary) :not(.button-disabled):active{--button-background-color:var(--cpsl-color-secondary-button-surface-pressed)}:host(.secondary) :not(.button-disabled):focus-visible{--button-outline-color:var(--cpsl-color-secondary-button-outline)}:host(.secondary) ::slotted(cpsl-icon){--icon-color:var(--cpsl-text-primary)}:host(.icon){--button-color:transparent;--button-background-color:transparent;--button-border-color:transparent;--button-box-shadow:none;--button-outline-color:transparent}:host(.icon) ::slotted(cpsl-icon){--icon-color:var(--cpsl-color-text-secondary)}:host(.icon) :not(.button-disabled):hover ::slotted(cpsl-icon){--icon-color:var(--cpsl-color-text-primary)}.button-native{border-radius:var(--button-border-radius);-webkit-padding-start:var(--button-padding-start);padding-inline-start:var(--button-padding-start);-webkit-padding-end:var(--button-padding-end);padding-inline-end:var(--button-padding-end);padding-top:var(--button-padding-top);padding-bottom:var(--button-padding-bottom);font-size:var(--container-font-size);font-weight:500;border:var(--button-border-width) solid transparent;cursor:pointer;color:var(--button-color);background-color:var(--button-background-color);border-color:var(--button-border-color);display:flex;justify-content:center;align-items:center;height:100%;width:100%;box-shadow:var(--button-box-shadow);gap:var(--button-gap);word-break:break-all;outline-color:var(--button-outline-color)}";
|
4
|
-
|
5
|
-
const CpslButton = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
this.disabled = false;
|
9
|
-
this.variant = 'primary';
|
10
|
-
}
|
11
|
-
render() {
|
12
|
-
return (h(Host, { key: '8711ac6dda1247f9b9d9fded64e280a880b46a4a', class: {
|
13
|
-
'primary': this.variant === 'primary',
|
14
|
-
'secondary': this.variant === 'secondary',
|
15
|
-
'icon': this.variant === 'icon',
|
16
|
-
'button-disabled': this.disabled,
|
17
|
-
} }, h("button", { key: '8dd8b7008fcace9f2dd967b88adaa5962f638aaa', class: "button-native" }, h("slot", { key: '3dbaf7349773a3c5f24beaa2c99904e782f0f4a5', name: "start" }), h("slot", { key: '586091b1a7392abd93a4e43c6a4bff35554cf552' }), h("slot", { key: '08e032dd50aa6b2a109a8a315d1c45c37367bc54', name: "end" }))));
|
18
|
-
}
|
19
|
-
};
|
20
|
-
CpslButton.style = cpslButtonCss;
|
21
|
-
|
22
|
-
export { CpslButton as cpsl_button };
|
23
|
-
|
24
|
-
//# sourceMappingURL=cpsl-button.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-button.entry.esm.js","mappings":";;AAAA,MAAM,aAAa,GAAG,+5GAA+5G;;MCOx6G,UAAU;;;wBAKyB,KAAK;uBAOmB,SAAS;;IAE/E,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACrC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBACzC,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,MAAM;gBAC/B,iBAAiB,EAAE,IAAI,CAAC,QAAQ;aACjC,IAED,+DAAQ,KAAK,EAAC,eAAe,IAC3B,6DAAM,IAAI,EAAC,OAAO,GAAQ,EAC1B,8DAAa,EACb,6DAAM,IAAI,EAAC,KAAK,GAAQ,CACjB,CACJ,EACP;KACH;;;;;;","names":[],"sources":["src/components/cpsl-button/cpsl-button.scss?tag=cpsl-button&encapsulation=shadow","src/components/cpsl-button/cpsl-button.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n --button-border-radius: var(--cpsl-border-radius-primary-button);\n --button-border-width: 1px;\n --button-gap: 4px;\n\n --button-box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 2px 2px 0px var(--cpsl-color-alpha-white-25) inset, 0px -2px 2px 0px var(--cpsl-color-alpha-black-25) inset;\n\n --button-padding-top: 10px;\n --button-padding-bottom: 10px;\n --button-padding-start: 16px;\n --button-padding-end: 16px;\n\n --button-font-size: #{dynamic-font-clamp(1, 14px, 1.5)};\n\n height: 100%;\n width: 100%;\n\n font-family: $font-family-base;\n}\n\n:host(.button-disabled) {\n cursor: default;\n pointer-events: none;\n}\n\n:host(.primary) {\n --button-color: var(--cpsl-color-text-inverted);\n --button-background-color: var(--cpsl-color-primary-button-surface-default);\n --button-border-color: var(--cpsl-color-primary-button-border-default);\n\n &:host(.button-disabled) {\n --button-background-color: var(--cpsl-color-primary-button-surface-disabled);\n --button-border-color: var(--cpsl-color-primary-button-border-disabled);\n --button-box-shadow: none;\n --button-outline-color: transparent;\n }\n\n :not(.button-disabled) {\n &:hover {\n --button-background-color: var(--cpsl-color-primary-button-surface-hover);\n }\n &:active {\n --button-background-color: var(--cpsl-color-primary-button-surface-pressed);\n }\n &:focus-visible {\n --button-outline-color: var(--cpsl-color-primary-button-outline);\n }\n }\n\n ::slotted(cpsl-icon) {\n --icon-color: var(--cpsl-text-inverted);\n }\n}\n\n:host(.secondary) {\n --button-color: var(--cpsl-color-text-primary);\n --button-background-color: var(--cpsl-color-secondary-button-surface-default);\n --button-border-color: var(--cpsl-color-secondary-button-border-default);\n\n &:host(.button-disabled) {\n --button-background-color: var(--cpsl-color-secondary-button-surface-disabled);\n --button-border-color: var(--cpsl-color-secondary-button-border-disabled);\n --button-box-shadow: none;\n --button-outline-color: transparent;\n }\n\n :not(.button-disabled) {\n &:hover {\n --button-background-color: var(--cpsl-color-secondary-button-surface-hover);\n }\n &:active {\n --button-background-color: var(--cpsl-color-secondary-button-surface-pressed);\n }\n &:focus-visible {\n --button-outline-color: var(--cpsl-color-secondary-button-outline);\n }\n }\n\n ::slotted(cpsl-icon) {\n --icon-color: var(--cpsl-text-primary);\n }\n}\n\n:host(.icon) {\n ::slotted(cpsl-icon) {\n --icon-color: var(--cpsl-color-text-secondary);\n }\n\n --button-color: transparent;\n --button-background-color: transparent;\n --button-border-color: transparent;\n --button-box-shadow: none;\n --button-outline-color: transparent;\n\n :not(.button-disabled) {\n &:hover {\n ::slotted(cpsl-icon) {\n --icon-color: var(--cpsl-color-text-primary);\n }\n }\n }\n}\n\n.button-native {\n @include border-radius(var(--button-border-radius));\n @include padding(var(--button-padding-top), var(--button-padding-end), var(--button-padding-bottom), var(--button-padding-start));\n\n font-size: var(--container-font-size);\n font-weight: 500;\n\n border: var(--button-border-width) solid transparent;\n cursor: pointer;\n\n color: var(--button-color);\n background-color: var(--button-background-color);\n border-color: var(--button-border-color);\n\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n box-shadow: var(--button-box-shadow);\n gap: var(--button-gap);\n word-break: break-all;\n\n outline-color: var(--button-outline-color);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button',\n styleUrl: 'cpsl-button.scss',\n shadow: true,\n})\nexport class CpslButton {\n /**\n * If the button is disabled.\n * Default is: false.\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * The variant of button.\n * Options are: `\"primary\"`, `\"secondary\", `\"icon\".\n * Default is: `\"primary\"`.\n */\n @Prop({ reflect: true }) variant?: 'primary' | 'secondary' | 'icon' = 'primary';\n\n render() {\n return (\n <Host\n class={{\n 'primary': this.variant === 'primary',\n 'secondary': this.variant === 'secondary',\n 'icon': this.variant === 'icon',\n 'button-disabled': this.disabled,\n }}\n >\n <button class=\"button-native\">\n <slot name=\"start\"></slot>\n <slot></slot>\n <slot name=\"end\"></slot>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,106 +0,0 @@
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, a as Host, g as getElement } from './index-f19e63df.js';
|
2
|
-
|
3
|
-
const cpslCodeInputCss = ":host{--input-width:40px;--input-height:54px;--input-border-radius:var(--cpsl-border-radius-input);--input-border-color:var(--cpsl-color-input-border-placeholder);--input-border-width:1px;--input-background-color:var(--cpsl-color-input-surface-default);--input-border-error-color:var(--cpsl-color-input-border-error);--input-font-size:clamp(20px, 1.25rem, 30px);--input-color:var(--cpsl-color-text-primary);--helper-text-color:var(--cpsl-color-text-secondary);--helper-text-error-color:var(--cpsl-color-text-error);--helper-text-icon-color:var(--cpsl-color-text-secondary);--helper-text-icon-error-color:var(--cpsl-color-text-error);--helper-text-icon-size:16px;--helper-text-font-size:12px;--helper-text-margin-top:6px;display:block;font-family:var(--cpsl-font-family, inherit)}.code-container{display:flex;gap:8px}.code-input{font-family:var(--cpsl-font-family, inherit);border-radius:var(--input-border-radius);font-size:var(--input-font-size);border-color:var(--input-border-color);border-width:var(--input-border-width);border-style:solid;font-size:var(--input-font-size);color:var(--input-color);width:var(--input-width);height:var(--input-height);background-color:var(--input-background-color);box-sizing:border-box;text-align:center;outline:none}.code-input:focus{--input-border-color:var(--cpsl-color-input-border-active)}.code-input::-webkit-outer-spin-button,.code-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.code-input .error-container{border-color:var(--input-border-error-color)}input[type=number]{-moz-appearance:textfield}.helper-text-container{flex-basis:100%;display:flex;align-items:center;gap:4px;color:var(--helper-text-color);font-size:var(--helper-text-font-size);margin-top:var(--helper-text-margin-top)}.helper-text-container cpsl-icon{--height:var(--helper-text-icon-size);--width:var(--helper-text-icon-size);--icon-color:var(--helper-text-icon-color)}.error-text{color:var(--helper-text-error-color)}.error-text cpsl-icon{--icon-color:var(--helper-text-icon-error-color)}";
|
4
|
-
|
5
|
-
const CpslCodeInput = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
this.cpslInput = createEvent(this, "cpslInput", 7);
|
9
|
-
this.handleInput = (ind, ev) => {
|
10
|
-
var _a;
|
11
|
-
const inputElements = this.inputs;
|
12
|
-
if (ev.inputType == 'insertText') {
|
13
|
-
if (this.type === 'number' && isNaN(parseInt(ev.data))) {
|
14
|
-
inputElements[ind].value = '';
|
15
|
-
return;
|
16
|
-
}
|
17
|
-
inputElements[Math.min(this.length - 1, ind + 1)].focus();
|
18
|
-
const newCode = `${(_a = this.code) !== null && _a !== void 0 ? _a : ''}${ev.data}`;
|
19
|
-
this.cpslInput.emit({ value: newCode });
|
20
|
-
this.code = newCode;
|
21
|
-
}
|
22
|
-
};
|
23
|
-
this.handleKeyDown = (ind, ev) => {
|
24
|
-
const inputElements = this.inputs;
|
25
|
-
switch (ev.key) {
|
26
|
-
case 'Backspace': {
|
27
|
-
let newCode;
|
28
|
-
if (!inputElements[ind].value) {
|
29
|
-
inputElements[Math.max(0, ind - 1)].value = '';
|
30
|
-
inputElements[Math.max(0, ind - 1)].focus();
|
31
|
-
newCode = this.code.substring(0, ind - 1);
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
newCode = this.code.substring(0, ind);
|
35
|
-
}
|
36
|
-
this.cpslInput.emit({ value: newCode });
|
37
|
-
this.code = newCode;
|
38
|
-
break;
|
39
|
-
}
|
40
|
-
case 'ArrowLeft': {
|
41
|
-
setTimeout(() => {
|
42
|
-
this.inputs[ind].setSelectionRange(1, 1);
|
43
|
-
}, 0);
|
44
|
-
break;
|
45
|
-
}
|
46
|
-
default: {
|
47
|
-
break;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
};
|
51
|
-
this.handleFocus = (ind) => {
|
52
|
-
const inputElements = this.inputs;
|
53
|
-
for (const input of inputElements) {
|
54
|
-
if (!input.value) {
|
55
|
-
input.focus();
|
56
|
-
break;
|
57
|
-
}
|
58
|
-
else if (input.id === `code-input-${this.length - 1}`) {
|
59
|
-
input.focus();
|
60
|
-
break;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
setTimeout(() => {
|
64
|
-
inputElements[ind].setSelectionRange(1, 1);
|
65
|
-
}, 0);
|
66
|
-
};
|
67
|
-
this.handlePaste = (e) => {
|
68
|
-
const inputElements = this.inputs;
|
69
|
-
const pastedCode = e.clipboardData.getData('text');
|
70
|
-
if (this.type === 'number' && isNaN(parseInt(pastedCode))) {
|
71
|
-
setTimeout(() => {
|
72
|
-
inputElements[0].value = '';
|
73
|
-
}, 0);
|
74
|
-
return;
|
75
|
-
}
|
76
|
-
this.cpslInput.emit({
|
77
|
-
value: pastedCode,
|
78
|
-
});
|
79
|
-
inputElements.forEach((input, index) => {
|
80
|
-
input.value = pastedCode.charAt(index);
|
81
|
-
});
|
82
|
-
inputElements[this.length - 1].focus();
|
83
|
-
};
|
84
|
-
this.code = undefined;
|
85
|
-
this.errorText = undefined;
|
86
|
-
this.helperText = undefined;
|
87
|
-
this.length = undefined;
|
88
|
-
this.type = 'number';
|
89
|
-
}
|
90
|
-
get inputs() {
|
91
|
-
return Array.from(this.el.shadowRoot.querySelectorAll('input'));
|
92
|
-
}
|
93
|
-
render() {
|
94
|
-
var _a;
|
95
|
-
return (h(Host, { key: 'a4b4a56e66db775da02f84249fd5abe801400436' }, h("div", { key: 'dc980c83134e9f99e6581d0a1d469a62bfd26117', class: "code-container" }, new Array(this.length).fill(0).map((_, i) => {
|
96
|
-
var _a;
|
97
|
-
return (h("input", { class: { 'code-input': true, 'error': Boolean(this.errorText) }, id: `code-input-${i}`, maxLength: 1, onKeyDown: ev => this.handleKeyDown(i, ev), onInput: ev => this.handleInput(i, ev), onFocus: () => this.handleFocus(i), onPaste: this.handlePaste, min: 0, max: 9, value: (_a = this.code) === null || _a === void 0 ? void 0 : _a[i], inputMode: this.type === 'number' ? 'numeric' : 'text' }));
|
98
|
-
})), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("cpsl-icon", { icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
|
99
|
-
}
|
100
|
-
get el() { return getElement(this); }
|
101
|
-
};
|
102
|
-
CpslCodeInput.style = cpslCodeInputCss;
|
103
|
-
|
104
|
-
export { CpslCodeInput as cpsl_code_input };
|
105
|
-
|
106
|
-
//# sourceMappingURL=cpsl-code-input.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-code-input.entry.esm.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,w+DAAw+D;;MCQp/D,aAAa;;;;QAmChB,gBAAW,GAAG,CAAC,GAAW,EAAE,EAAc;;YAChD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;YAClC,IAAI,EAAE,CAAC,SAAS,IAAI,YAAY,EAAE;gBAChC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE;oBACtD,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EA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,IAAI,CAAC,UAAU,MACjC,WAAK,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAClF,iBAAW,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,aAAa,GAAG,YAAY,GAAI,EAC3E,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,EACP;KACH;;;;;;;","names":[],"sources":["src/components/cpsl-code-input/cpsl-code-input.scss?tag=cpsl-code-input&encapsulation=shadow","src/components/cpsl-code-input/cpsl-code-input.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n --input-width: 40px;\n --input-height: 54px;\n\n --input-border-radius: var(--cpsl-border-radius-input);\n --input-border-color: var(--cpsl-color-input-border-placeholder);\n --input-border-width: 1px;\n --input-background-color: var(--cpsl-color-input-surface-default);\n --input-border-error-color: var(--cpsl-color-input-border-error);\n\n --input-font-size: #{dynamic-font-clamp(1, 20px, 1.5)};\n --input-color: var(--cpsl-color-text-primary);\n\n --helper-text-color: var(--cpsl-color-text-secondary);\n --helper-text-error-color: var(--cpsl-color-text-error);\n --helper-text-icon-color: var(--cpsl-color-text-secondary);\n --helper-text-icon-error-color: var(--cpsl-color-text-error);\n --helper-text-icon-size: 16px;\n --helper-text-font-size: 12px;\n --helper-text-margin-top: 6px;\n\n display: block;\n font-family: $font-family-base;\n}\n\n.code-container {\n display: flex;\n gap: 8px;\n}\n\n.code-input {\n font-family: $font-family-base;\n @include border-radius(var(--input-border-radius));\n font-size: var(--input-font-size);\n\n border-color: var(--input-border-color);\n border-width: var(--input-border-width);\n border-style: solid;\n\n font-size: var(--input-font-size);\n color: var(--input-color);\n\n width: var(--input-width);\n height: var(--input-height);\n background-color: var(--input-background-color);\n\n box-sizing: border-box;\n text-align: center;\n outline: none;\n\n &:focus {\n --input-border-color: var(--cpsl-color-input-border-active);\n }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n}\n\n.code-input .error-container {\n border-color: var(--input-border-error-color);\n}\n\ninput[type='number'] {\n -moz-appearance: textfield;\n}\n\n.helper-text-container {\n flex-basis: 100%;\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--helper-text-color);\n font-size: var(--helper-text-font-size);\n\n margin-top: var(--helper-text-margin-top);\n\n cpsl-icon {\n --height: var(--helper-text-icon-size);\n --width: var(--helper-text-icon-size);\n --icon-color: var(--helper-text-icon-color);\n }\n}\n\n.error-text {\n color: var(--helper-text-error-color);\n\n cpsl-icon {\n --icon-color: var(--helper-text-icon-error-color);\n }\n}\n","import { Component, Host, h, Prop, Element, Event, EventEmitter } from '@stencil/core';\nimport { CodeChangeEventDetail } from './code-change-interface';\n\n@Component({\n tag: 'cpsl-code-input',\n styleUrl: 'cpsl-code-input.scss',\n shadow: true,\n})\nexport class CpslCodeInput {\n @Element() el!: HTMLCpslCodeInputElement;\n\n /**\n * Value of the code.\n */\n // eslint-disable-next-line @stencil-community/strict-mutable\n @Prop({ mutable: true }) code: string;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * Length of the code.\n */\n @Prop() length: number;\n\n /**\n * Type of characters to accept in the code.\n * Defaults to number.\n */\n @Prop() type?: 'number' | 'string' = 'number';\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n */\n @Event() cpslInput!: EventEmitter<CodeChangeEventDetail>;\n\n private handleInput = (ind: number, ev: InputEvent) => {\n const inputElements = this.inputs;\n if (ev.inputType == 'insertText') {\n if (this.type === 'number' && isNaN(parseInt(ev.data))) {\n inputElements[ind].value = '';\n return;\n }\n inputElements[Math.min(this.length - 1, ind + 1)].focus();\n\n const newCode = `${this.code ?? ''}${ev.data}`;\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n }\n };\n\n private handleKeyDown = (ind: number, ev: KeyboardEvent) => {\n const inputElements = this.inputs;\n\n switch (ev.key) {\n case 'Backspace': {\n let newCode;\n if (!inputElements[ind].value) {\n inputElements[Math.max(0, ind - 1)].value = '';\n inputElements[Math.max(0, ind - 1)].focus();\n newCode = this.code.substring(0, ind - 1);\n } else {\n newCode = this.code.substring(0, ind);\n }\n this.cpslInput.emit({ value: newCode });\n this.code = newCode;\n break;\n }\n case 'ArrowLeft': {\n setTimeout(() => {\n this.inputs[ind].setSelectionRange(1, 1);\n }, 0);\n break;\n }\n default: {\n break;\n }\n }\n };\n\n private handleFocus = (ind: number) => {\n const inputElements = this.inputs;\n\n for (const input of inputElements) {\n if (!input.value) {\n input.focus();\n break;\n } else if (input.id === `code-input-${this.length - 1}`) {\n input.focus();\n break;\n }\n }\n\n setTimeout(() => {\n inputElements[ind].setSelectionRange(1, 1);\n }, 0);\n };\n\n // TODO: figure out why pasting a string populates the first input\n private handlePaste = (e: ClipboardEvent) => {\n const inputElements = this.inputs;\n const pastedCode = e.clipboardData.getData('text');\n\n if (this.type === 'number' && isNaN(parseInt(pastedCode))) {\n // Remove illegal value from the first input. Not using a timeout here doesn't change the value properly.\n setTimeout(() => {\n inputElements[0].value = '';\n }, 0);\n return;\n }\n\n this.cpslInput.emit({\n value: pastedCode,\n });\n inputElements.forEach((input, index) => {\n input.value = pastedCode.charAt(index);\n });\n inputElements[this.length - 1].focus();\n };\n\n private get inputs() {\n return Array.from(this.el.shadowRoot.querySelectorAll('input'));\n }\n\n render() {\n return (\n <Host>\n <div class=\"code-container\">\n {new Array(this.length).fill(0).map((_, i) => (\n <input\n class={{ 'code-input': true, 'error': Boolean(this.errorText) }}\n id={`code-input-${i}`}\n maxLength={1}\n onKeyDown={ev => this.handleKeyDown(i, ev)}\n onInput={ev => this.handleInput(i, ev)}\n onFocus={() => this.handleFocus(i)}\n onPaste={this.handlePaste}\n min={0}\n max={9}\n value={this.code?.[i]}\n inputMode={this.type === 'number' ? 'numeric' : 'text'}\n />\n ))}\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-col.entry.esm.js","mappings":";;AAAO,MAAM,aAAa,GAAQ;IAChC,EAAE,EAAE,kBAAkB;IACtB,EAAE,EAAE,oBAAoB;IACxB,EAAE,EAAE,oBAAoB;IACxB,EAAE,EAAE,oBAAoB;IACxB,EAAE,EAAE,qBAAqB;CAC1B,CAAC;AAKK,MAAM,eAAe,GAAG,CAAC,UAA8B;IAC5D,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE,EAAE;QACjD,OAAO,IAAI,CAAC;KACb;IACD,IAAK,MAAc,CAAC,UAAU,EAAE;QAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;KAC9C;IACD,OAAO,KAAK,CAAC;AACf,CAAC;;ACpBD,MAAM,UAAU,GAAG,g+FAAg+F;;ACGn/F,MAAM,GAAG,GAAG,OAAQ,MAAc,KAAK,WAAW,GAAI,MAAc,GAAG,SAAS,CAAC;AACjF,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3F,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;MAO1C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E;sBACzB,CAAC,OAAO,GAAG,EAAE,IAAI,GAAG,GAAG,GAAG;sBAC1B,MAAM,CAAC;QAEX,OAAO;YACL,CAAC,QAAQ,GAAG,MAAM;SACnB,CAAC;KACH;IAEO,eAAe,CAAC,KAAc;QACpC,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC,CAAC;KACjF;IAEO,aAAa,CAAC,KAAc;QAClC,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;KACjE;IAEO,aAAa,CAAC,KAAc;QAClC,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;KACjE;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,KAAK,KAAK,CAAC;QACrC,QACE,EAAC,IAAI,qDACH,KAAK,8DACA,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,GAC3B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GACzB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GACzB,IAAI,CAAC,aAAa,EAAE,KAGzB,8DAAa,CACR,EACP;KACH;;;;;;","names":[],"sources":["src/utils/media.ts","src/components/cpsl-col/cpsl-col.scss?tag=cpsl-col&encapsulation=shadow","src/components/cpsl-col/cpsl-col.tsx"],"sourcesContent":["export const SIZE_TO_MEDIA: any = {\n xs: '(min-width: 0px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n};\n\n// Check if the window matches the media query\n// at the breakpoint passed\n// e.g. matchBreakpoint('sm') => true if screen width exceeds 576px\nexport const matchBreakpoint = (breakpoint: string | undefined) => {\n if (breakpoint === undefined || breakpoint === '') {\n return true;\n }\n if ((window as any).matchMedia) {\n const mediaQuery = SIZE_TO_MEDIA[breakpoint];\n return window.matchMedia(mediaQuery).matches;\n }\n return false;\n};\n","@import './cpsl-col.vars';\n\n// Column\n// --------------------------------------------------\n\n:host {\n /**\n * @prop --cpsl-grid-columns: The number of total Columns in the Grid\n * @prop --cpsl-grid-column-padding: Padding for the Column\n * @prop --cpsl-grid-column-padding-xs: Padding for the Column on xs screens and up\n * @prop --cpsl-grid-column-padding-sm: Padding for the Column on sm screens and up\n * @prop --cpsl-grid-column-padding-md: Padding for the Column on md screens and up\n * @prop --cpsl-grid-column-padding-lg: Padding for the Column on lg screens and up\n * @prop --cpsl-grid-column-padding-xl: Padding for the Column on xl screens and up\n */\n @include make-breakpoint-padding($grid-column-paddings);\n @include margin(0);\n\n box-sizing: border-box;\n\n position: relative;\n\n flex-basis: 0;\n flex-grow: 1;\n\n width: 100%;\n max-width: 100%;\n min-height: 1px; // Prevent columns from collapsing when empty\n}\n","import { Component, Host, Listen, Prop, forceUpdate, h } from '@stencil/core';\nimport { matchBreakpoint } from '../../utils/media';\n\nconst win = typeof (window as any) !== 'undefined' ? (window as any) : undefined;\nconst SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));\nconst BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];\n\n@Component({\n tag: 'cpsl-col',\n styleUrl: 'cpsl-col.scss',\n shadow: true,\n})\nexport class CpslCol {\n /**\n * The amount to offset the column, in terms of how many columns it should shift to the end\n * of the total available.\n */\n @Prop() offset?: string;\n\n /**\n * The amount to offset the column for xs screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetXs?: string;\n\n /**\n * The amount to offset the column for sm screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetSm?: string;\n\n /**\n * The amount to offset the column for md screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetMd?: string;\n\n /**\n * The amount to offset the column for lg screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetLg?: string;\n\n /**\n * The amount to offset the column for xl screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetXl?: string;\n\n /**\n * The amount to pull the column, in terms of how many columns it should shift to the start of\n * the total available.\n */\n @Prop() pull?: string;\n\n /**\n * The amount to pull the column for xs screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullXs?: string;\n /**\n * The amount to pull the column for sm screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullSm?: string;\n /**\n * The amount to pull the column for md screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullMd?: string;\n /**\n * The amount to pull the column for lg screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullLg?: string;\n /**\n * The amount to pull the column for xl screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullXl?: string;\n\n /**\n * The amount to push the column, in terms of how many columns it should shift to the end\n * of the total available.\n */\n @Prop() push?: string;\n\n /**\n * The amount to push the column for xs screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushXs?: string;\n\n /**\n * The amount to push the column for sm screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushSm?: string;\n\n /**\n * The amount to push the column for md screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushMd?: string;\n\n /**\n * The amount to push the column for lg screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushLg?: string;\n\n /**\n * The amount to push the column for xl screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushXl?: string;\n\n /**\n * The size of the column, in terms of how many columns it should take up out of the total\n * available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() size?: string;\n\n /**\n * The size of the column for xs screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeXs?: string;\n\n /**\n * The size of the column for sm screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeSm?: string;\n\n /**\n * The size of the column for md screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeMd?: string;\n\n /**\n * The size of the column for lg screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeLg?: string;\n\n /**\n * The size of the column for xl screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeXl?: string;\n\n @Listen('resize', { target: 'window' })\n onResize() {\n forceUpdate(this);\n }\n\n // Loop through all of the breakpoints to see if the media query\n // matches and grab the column value from the relevant prop if so\n private getColumns(property: string) {\n let matched;\n\n for (const breakpoint of BREAKPOINTS) {\n const matches = matchBreakpoint(breakpoint);\n\n // Grab the value of the property, if it exists and our\n // media query matches we return the value\n const columns = (this as any)[property + breakpoint.charAt(0).toUpperCase() + breakpoint.slice(1)];\n\n if (matches && columns !== undefined) {\n matched = columns;\n }\n }\n\n // Return the last matched columns since the breakpoints\n // increase in size and we want to return the largest match\n return matched;\n }\n\n private calculateSize() {\n const columns = this.getColumns('size');\n\n // If size wasn't set for any breakpoint\n // or if the user set the size without a value\n // it means we need to stick with the default and return\n // e.g. <ion-col size-md>\n if (!columns || columns === '') {\n return;\n }\n\n // If the size is set to auto then don't calculate a size\n const colSize =\n columns === 'auto'\n ? 'auto'\n : // If CSS supports variables we should use the grid columns var\n SUPPORTS_VARS\n ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`\n : // Convert the columns to a percentage by dividing by the total number\n // of columns (12) and then multiplying by 100\n (columns / 12) * 100 + '%';\n\n return {\n 'flex': `0 0 ${colSize}`,\n 'width': `${colSize}`,\n 'max-width': `${colSize}`,\n };\n }\n\n // Called by push, pull, and offset since they use the same calculations\n private calculatePosition(property: string, modifier: string) {\n const columns = this.getColumns(property);\n\n if (!columns) {\n return;\n }\n\n // If the number of columns passed are greater than 0 and less than\n // 12 we can position the column, else default to auto\n const amount = SUPPORTS_VARS\n ? // If CSS supports variables we should use the grid columns var\n `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`\n : // Convert the columns to a percentage by dividing by the total number\n // of columns (12) and then multiplying by 100\n columns > 0 && columns < 12\n ? (columns / 12) * 100 + '%'\n : 'auto';\n\n return {\n [modifier]: amount,\n };\n }\n\n private calculateOffset(isRTL: boolean) {\n return this.calculatePosition('offset', isRTL ? 'margin-right' : 'margin-left');\n }\n\n private calculatePull(isRTL: boolean) {\n return this.calculatePosition('pull', isRTL ? 'left' : 'right');\n }\n\n private calculatePush(isRTL: boolean) {\n return this.calculatePosition('push', isRTL ? 'right' : 'left');\n }\n\n render() {\n const isRTL = document.dir === 'rtl';\n return (\n <Host\n style={{\n ...this.calculateOffset(isRTL),\n ...this.calculatePull(isRTL),\n ...this.calculatePush(isRTL),\n ...this.calculateSize(),\n }}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, a as Host } from './index-f19e63df.js';
|
2
|
-
|
3
|
-
const cpslDividerCss = ":host{--divider-height:1px;--divider-color:var(--cpsl-color-divider);display:flex;align-items:center;height:24px;color:var(--cpsl-color-text-subtle);font-family:var(--cpsl-font-family, inherit);font-size:clamp(14px, 0.875rem, 21px);font-weight:600;gap:16px}:host div{flex:1;background-color:var(--divider-color);height:var(--divider-height)}";
|
4
|
-
|
5
|
-
const CpslDivider = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
}
|
9
|
-
render() {
|
10
|
-
return (h(Host, { key: 'd8f063dddcda35ed9b72bc12d46d233ea8bf5792' }, h("div", { key: 'f9dd7054b6e4d3559d0708be84e85018601830f0' }), h("slot", { key: '2dfff05360f5f8f1c72c429486a3c6cff88eab9d' }), h("div", { key: '44abb6e586d757b0665407e33c51d1d0ac8812af' })));
|
11
|
-
}
|
12
|
-
};
|
13
|
-
CpslDivider.style = cpslDividerCss;
|
14
|
-
|
15
|
-
export { CpslDivider as cpsl_divider };
|
16
|
-
|
17
|
-
//# sourceMappingURL=cpsl-divider.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-divider.entry.esm.js","mappings":";;AAAA,MAAM,cAAc,GAAG,uVAAuV;;MCOjW,WAAW;;;;IACtB,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,6DAAO,EACP,8DAAa,EACb,6DAAO,CACF,EACP;KACH;;;;;;","names":[],"sources":["src/components/cpsl-divider/cpsl-divider.scss?tag=cpsl-divider&encapsulation=shadow","src/components/cpsl-divider/cpsl-divider.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n --divider-height: 1px;\n --divider-color: var(--cpsl-color-divider);\n\n display: flex;\n align-items: center;\n height: 24px;\n color: var(--cpsl-color-text-subtle);\n\n font-family: $font-family-base;\n font-size: #{dynamic-font-clamp(1, 14px, 1.5)};\n font-weight: 600;\n gap: 16px;\n}\n\n:host div {\n flex: 1;\n background-color: var(--divider-color);\n height: var(--divider-height);\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-divider',\n styleUrl: 'cpsl-divider.scss',\n shadow: true,\n})\nexport class CpslDivider {\n render() {\n return (\n <Host>\n <div />\n <slot></slot>\n <div />\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-grid.entry.esm.js","mappings":";;AAAA,MAAM,WAAW,GAAG,0vGAA0vG;;MCOjwG,QAAQ;;;qBAIH,KAAK;;IAErB,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,YAAY,EAAE,IAAI,CAAC,KAAK;aACzB,IAED,8DAAa,CACR,EACP;KACH;;;;;;","names":[],"sources":["src/components/cpsl-grid/cpsl-grid.scss?tag=cpsl-grid&encapsulation=shadow","src/components/cpsl-grid/cpsl-grid.tsx"],"sourcesContent":["@import './cpsl-grid.vars';\n\n// Grid\n// --------------------------------------------------\n\n:host {\n /**\n * @prop --cpsl-grid-padding: Padding for the Grid\n * @prop --cpsl-grid-padding-xs: Padding for the Grid on xs screens\n * @prop --cpsl-grid-padding-sm: Padding for the Grid on sm screens\n * @prop --cpsl-grid-padding-md: Padding for the Grid on md screens\n * @prop --cpsl-grid-padding-lg: Padding for the Grid on lg screens\n * @prop --cpsl-grid-padding-xl: Padding for the Grid on xl screens\n *\n * @prop --cpsl-grid-width: Width of the fixed Grid\n * @prop --cpsl-grid-width-xs: Width of the fixed Grid on xs screens\n * @prop --cpsl-grid-width-sm: Width of the fixed Grid on sm screens\n * @prop --cpsl-grid-width-md: Width of the fixed Grid on md screens\n * @prop --cpsl-grid-width-lg: Width of the fixed Grid on lg screens\n * @prop --cpsl-grid-width-xl: Width of the fixed Grid on xl screens\n */\n\n @include make-breakpoint-padding($grid-paddings);\n @include margin-horizontal(auto);\n\n display: block;\n\n flex: 1;\n}\n\n// Fixed Grid\n// --------------------------------------------------\n\n:host(.grid-fixed) {\n @include make-grid-widths();\n}\n\n// Grid Padding\n// --------------------------------------------------\n\n// Remove the padding from grid and all immediate children columns\n:host(.cpsl-no-padding) {\n --cpsl-grid-column-padding: 0;\n --cpsl-grid-column-padding-xs: 0;\n --cpsl-grid-column-padding-sm: 0;\n --cpsl-grid-column-padding-md: 0;\n --cpsl-grid-column-padding-lg: 0;\n --cpsl-grid-column-padding-xl: 0;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-grid',\n styleUrl: 'cpsl-grid.scss',\n shadow: true,\n})\nexport class CpslGrid {\n /**\n * If `true`, the grid will have a fixed width based on the screen size.\n */\n @Prop() fixed = false;\n\n render() {\n return (\n <Host\n class={{\n 'grid-fixed': this.fixed,\n }}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, a as Host } from './index-f19e63df.js';
|
2
|
-
import { I as Icons } from './index-3ac1b9e9.js';
|
3
|
-
|
4
|
-
const cpslIconCss = ":host{display:block;--height:24px;--width:24px;--icon-color:var(--cpsl-color-text-primary);--icon-fill-color:var(--cpsl-color-text-primary);--icon-stroke-color:var(--cpsl-color-text-primary);width:var(--width);height:var(--height)}:host div{display:flex;width:var(--width);height:var(--height);color:var(--icon-color)}:host svg{width:var(--width);height:var(--height)}:host svg .background-16{fill:var(--cpsl-color-background-16)}:host svg .foreground-0{fill:var(--cpsl-color-foreground-0)}:host svg .fill{fill:var(--icon-fill-color)}:host svg .stroke{stroke:var(--icon-stroke-color)}:host img{width:var(--width);height:var(--height);object-fit:contain}";
|
5
|
-
|
6
|
-
const CpslIcon = class {
|
7
|
-
constructor(hostRef) {
|
8
|
-
registerInstance(this, hostRef);
|
9
|
-
this.src = undefined;
|
10
|
-
this.icon = undefined;
|
11
|
-
}
|
12
|
-
render() {
|
13
|
-
return (h(Host, { key: '221616eef514df7fc93201275db3e6b965651373', part: "icon", role: "img" }, !Boolean(this.icon) ? h("img", { src: this.src }) : h("div", { innerHTML: Icons[this.icon] })));
|
14
|
-
}
|
15
|
-
};
|
16
|
-
CpslIcon.style = cpslIconCss;
|
17
|
-
|
18
|
-
export { CpslIcon as cpsl_icon };
|
19
|
-
|
20
|
-
//# sourceMappingURL=cpsl-icon.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-icon.entry.esm.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,+oBAA+oB;;MCStpB,QAAQ;;;;;;IAWnB,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,IACzB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,WAAK,GAAG,EAAE,IAAI,CAAC,GAAG,GAAI,GAAG,WAAK,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAI,CAC/E,EACP;KACH;;;;;;","names":[],"sources":["src/components/cpsl-icon/cpsl-icon.scss?tag=cpsl-icon&encapsulation=shadow","src/components/cpsl-icon/cpsl-icon.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n display: block;\n\n --height: 24px;\n --width: 24px;\n\n --icon-color: var(--cpsl-color-text-primary);\n --icon-fill-color: var(--cpsl-color-text-primary);\n --icon-stroke-color: var(--cpsl-color-text-primary);\n\n width: var(--width);\n height: var(--height);\n}\n\n:host div {\n display: flex;\n\n width: var(--width);\n height: var(--height);\n\n color: var(--icon-color);\n}\n\n:host svg {\n width: var(--width);\n height: var(--height);\n\n & .background-16 {\n fill: var(--cpsl-color-background-16);\n }\n\n & .foreground-0 {\n fill: var(--cpsl-color-foreground-0);\n }\n\n & .fill {\n fill: var(--icon-fill-color);\n }\n\n & .stroke {\n stroke: var(--icon-stroke-color);\n }\n}\n\n:host img {\n width: var(--width);\n height: var(--height);\n\n object-fit: contain;\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\nimport { IconType } from '../../interface';\nimport { Icons } from '../../assets/icons';\n\n@Component({\n tag: 'cpsl-icon',\n styleUrl: 'cpsl-icon.scss',\n shadow: true,\n})\nexport class CpslIcon {\n /**\n * The external source of the icon. If both `icon` and `src` are provided, `icon` will be used.\n */\n @Prop() src?: string;\n\n /**\n * The name of the icon. If both `icon` and `src` are provided, `icon` will be used.\n */\n @Prop() icon?: IconType;\n\n render() {\n return (\n <Host part=\"icon\" role=\"img\">\n {!Boolean(this.icon) ? <img src={this.src} /> : <div innerHTML={Icons[this.icon]} />}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-info-box.entry.esm.js","mappings":";;AAAA,MAAM,cAAc,GAAG,8qBAA8qB;;MCOxrB,WAAW;;;;IACtB,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,4DAAK,KAAK,EAAC,oBAAoB,IAC7B,8DAAa,CACT,CACD,EACP;KACH;;;;;;","names":[],"sources":["src/components/cpsl-info-box/cpsl-info-box.scss?tag=cpsl-info-box&encapsulation=shadow","src/components/cpsl-info-box/cpsl-info-box.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n --box-border-radius: var(--cpsl-border-radius-info-box);\n --box-padding-top: 16px;\n --box-padding-bottom: 16px;\n --box-padding-start: 16px;\n --box-padding-end: 16px;\n --box-border-width: 1px;\n}\n\n.info-box-container {\n @include border-radius(var(--input-border-radius));\n @include padding(var(--box-padding-top), var(--box-padding-end), var(--box-padding-bottom), var(--box-padding-start));\n\n display: flex;\n background-color: var(--cpsl-color-background-secondary);\n border: var(--box-border-width) solid var(--cpsl-color-input-border-placeholder);\n border-radius: var(--box-border-radius);\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-info-box',\n styleUrl: 'cpsl-info-box.scss',\n shadow: true,\n})\nexport class CpslInfoBox {\n render() {\n return (\n <Host>\n <div class=\"info-box-container\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,124 +0,0 @@
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, a as Host, g as getElement } from './index-f19e63df.js';
|
2
|
-
|
3
|
-
const cpslInputCss = ":host{--container-box-shadow:none;--container-box-shadow-color:var(--cpsl-color-alpha-black-16);--container-border-color:var(--cpsl-color-input-border-active);--container-border-error-color:var(--cpsl-color-input-border-error);--container-background-color:var(--cpsl-color-input-surface-default);--container-background-color-disabled:var(--cpsl-color-input-surface-disabled);--container-border-width:1px;--container-border-radius:var(--cpsl-border-radius-input);--container-padding-top:4px;--container-padding-bottom:4px;--container-padding-end:4px;--container-padding-start:8px;--container-height:46px;--container-gap:8px;--input-background-color:var(--cpsl-color-input-surface-default);--input-background-color-disabled:var(--cpsl-color-input-surface-disabled);--input-color:var(--cpsl-color-text-primary);--input-placeholder-color:var(--cpsl-color-text-secondary);--input-font-size:var(--cpsl-font-size-body-m);--label-color:var(--cpsl-color-text-primary);--label-font-size:var(--cpsl-font-size-body-s);--label-margin-bottom:5px;--helper-text-color:var(--cpsl-color-text-secondary);--helper-text-error-color:var(--cpsl-color-text-error);--helper-text-icon-color:var(--cpsl-color-text-secondary);--helper-text-icon-error-color:var(--cpsl-color-text-error);--helper-text-icon-size:16px;--helper-text-font-size:var(--cpsl-font-size-body-xs);--helper-text-margin-top:8px;display:block;font-family:var(--cpsl-font-family, inherit)}:host(.disabled){--container-background-color:var(--container-background-color-disabled);--input-background-color:var(--input-background-color-disabled);--input-color:var(--cpsl-color-text-secondary)}:host(:not(.has-value)){--container-border-color:var(--cpsl-color-input-border-placeholder);--input-color:var(--cpsl-color-text-secondary);--container-background-color:transparent;--input-background-color:transparent}:host(.focused){--container-box-shadow:0px 0px 0px 2px var(--container-box-shadow-color);--container-border-color:var(--cpsl-color-input-border-active);--container-background-color:var(--cpsl-color-input-surface-default)}.input-container{-webkit-padding-start:var(--container-padding-start);padding-inline-start:var(--container-padding-start);-webkit-padding-end:var(--container-padding-end);padding-inline-end:var(--container-padding-end);padding-top:var(--container-padding-top);padding-bottom:var(--container-padding-bottom);display:flex;align-items:center;box-sizing:border-box;height:var(--container-height);gap:var(--container-gap);border-style:solid;border-width:var(--container-border-width);border-color:var(--container-border-color);border-radius:var(--container-border-radius);background-color:var(--container-background-color);box-shadow:var(--container-box-shadow)}.error-container{border-color:var(--container-border-error-color)}.native-input{flex:1;min-width:0;border:none;height:100%;box-sizing:border-box;font-size:var(--input-font-size);color:var(--input-color);background-color:var(--input-background-color);font-family:var(--cpsl-font-family, inherit)}.native-input:focus,.native-input:focus-visible{outline:none}.native-input::placeholder{color:var(--input-placeholder-color);opacity:1;}.label{display:inline-block;color:var(--label-color);font-size:var(--label-font-size);font-weight:500;margin-bottom:var(--label-margin-bottom)}.helper-text-container{display:flex;align-items:center;gap:4px;color:var(--helper-text-color);font-size:var(--helper-text-font-size);font-weight:500;margin-top:var(--helper-text-margin-top)}.helper-text-container cpsl-icon{--height:var(--helper-text-icon-size);--width:var(--helper-text-icon-size);--icon-color:var(--helper-text-icon-color)}.error-text{color:var(--helper-text-error-color)}.error-text cpsl-icon{--icon-color:var(--helper-text-icon-error-color)}:host ::slotted([slot=start]){flex:0}:host ::slotted([slot=end]){flex:0}:host ::slotted(cpsl-icon){--icon-color:var(--input-color)}:host ::slotted(cpsl-button){width:calc(var(--container-height) - var(--container-padding-top) - var(--container-padding-bottom) - var(--container-border-width) * 2);--button-border-radius:calc(var(--container-border-radius) - 2px)}";
|
4
|
-
|
5
|
-
const CpslInput = class {
|
6
|
-
constructor(hostRef) {
|
7
|
-
registerInstance(this, hostRef);
|
8
|
-
this.cpslInput = createEvent(this, "cpslInput", 7);
|
9
|
-
this.cpslChange = createEvent(this, "cpslChange", 7);
|
10
|
-
this.cpslBlur = createEvent(this, "cpslBlur", 7);
|
11
|
-
this.cpslFocus = createEvent(this, "cpslFocus", 7);
|
12
|
-
this.inputId = `cpsl-input-${inputIds++}`;
|
13
|
-
this.onInput = (ev) => {
|
14
|
-
const input = ev.target;
|
15
|
-
if (Boolean(input)) {
|
16
|
-
this.value = input.value || '';
|
17
|
-
input.value === '' ? this.disableSlots() : this.enableSlots();
|
18
|
-
}
|
19
|
-
this.emitInputChange(ev);
|
20
|
-
};
|
21
|
-
this.onChange = (ev) => {
|
22
|
-
this.emitValueChange(ev);
|
23
|
-
};
|
24
|
-
this.onBlur = (ev) => {
|
25
|
-
this.hasFocus = false;
|
26
|
-
if (this.focusedValue !== this.value) {
|
27
|
-
this.emitValueChange(ev);
|
28
|
-
}
|
29
|
-
this.cpslBlur.emit(ev);
|
30
|
-
};
|
31
|
-
this.onFocus = (ev) => {
|
32
|
-
this.hasFocus = true;
|
33
|
-
this.focusedValue = this.value;
|
34
|
-
this.cpslFocus.emit(ev);
|
35
|
-
};
|
36
|
-
this.focusInput = () => {
|
37
|
-
this.nativeInput.focus();
|
38
|
-
};
|
39
|
-
this.hasFocus = false;
|
40
|
-
this.autocapitalize = 'off';
|
41
|
-
this.autocomplete = 'off';
|
42
|
-
this.autocorrect = 'off';
|
43
|
-
this.noAutoDisable = undefined;
|
44
|
-
this.autofocus = false;
|
45
|
-
this.disabled = false;
|
46
|
-
this.enterkeyhint = undefined;
|
47
|
-
this.errorText = undefined;
|
48
|
-
this.helperText = undefined;
|
49
|
-
this.inputmode = undefined;
|
50
|
-
this.label = undefined;
|
51
|
-
this.max = undefined;
|
52
|
-
this.maxlength = undefined;
|
53
|
-
this.min = undefined;
|
54
|
-
this.minlength = undefined;
|
55
|
-
this.multiple = undefined;
|
56
|
-
this.name = this.inputId;
|
57
|
-
this.pattern = undefined;
|
58
|
-
this.placeholder = undefined;
|
59
|
-
this.readonly = false;
|
60
|
-
this.required = false;
|
61
|
-
this.spellcheck = false;
|
62
|
-
this.startIconSrc = undefined;
|
63
|
-
this.startIcon = undefined;
|
64
|
-
this.step = undefined;
|
65
|
-
this.type = 'text';
|
66
|
-
this.value = undefined;
|
67
|
-
}
|
68
|
-
handleDisable() {
|
69
|
-
if (this.disabled) {
|
70
|
-
this.disableSlots();
|
71
|
-
}
|
72
|
-
else {
|
73
|
-
this.enableSlots();
|
74
|
-
}
|
75
|
-
}
|
76
|
-
componentDidLoad() {
|
77
|
-
if (Boolean(this.value)) {
|
78
|
-
this.enableSlots();
|
79
|
-
}
|
80
|
-
else {
|
81
|
-
this.disableSlots();
|
82
|
-
}
|
83
|
-
}
|
84
|
-
disableSlots() {
|
85
|
-
var _a, _b;
|
86
|
-
if (!this.noAutoDisable) {
|
87
|
-
(_a = this.el.querySelector('[slot="end"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'true');
|
88
|
-
(_b = this.el.querySelector('[slot="start"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'true');
|
89
|
-
}
|
90
|
-
}
|
91
|
-
enableSlots() {
|
92
|
-
var _a, _b;
|
93
|
-
(_a = this.el.querySelector('[slot="end"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'false');
|
94
|
-
(_b = this.el.querySelector('[slot="start"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'false');
|
95
|
-
}
|
96
|
-
emitInputChange(event) {
|
97
|
-
const { value } = this;
|
98
|
-
const newValue = value == null ? value : value.toString();
|
99
|
-
this.cpslInput.emit({ value: newValue, event });
|
100
|
-
}
|
101
|
-
emitValueChange(event) {
|
102
|
-
const { value } = this;
|
103
|
-
const newValue = value == null ? value : value.toString();
|
104
|
-
this.focusedValue = newValue;
|
105
|
-
this.cpslChange.emit({ value: newValue, event });
|
106
|
-
}
|
107
|
-
get nativeInput() {
|
108
|
-
return this.el.shadowRoot.getElementById(this.inputId);
|
109
|
-
}
|
110
|
-
render() {
|
111
|
-
var _a;
|
112
|
-
return (h(Host, { key: '03549333919caa7f2a931ce0a42dce520b3cf446', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (h("label", { class: "label", htmlFor: this.inputId }, this.label)), h("div", { key: '0bf904fc38ea4179893fe75cfcc5e31cafa468b8', onClick: this.focusInput, class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: 'eab1ed0f2809cf9c2fd0a789e3268b8eb3597eb4', name: "start" }), h("input", { key: '13bc645f2d72cc3c951ee7816a0afcfe33639acd', class: "native-input", id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur }), h("slot", { key: 'c8b1057ebecac42add5453fcf5decb472bd792bd', name: "end" })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("cpsl-icon", { icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
|
113
|
-
}
|
114
|
-
get el() { return getElement(this); }
|
115
|
-
static get watchers() { return {
|
116
|
-
"disabled": ["handleDisable"]
|
117
|
-
}; }
|
118
|
-
};
|
119
|
-
let inputIds = 0;
|
120
|
-
CpslInput.style = cpslInputCss;
|
121
|
-
|
122
|
-
export { CpslInput as cpsl_input };
|
123
|
-
|
124
|
-
//# sourceMappingURL=cpsl-input.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cpsl-input.entry.esm.js","mappings":";;AAAA,MAAM,YAAY,GAAG,4hIAA4hI;;MCSpiI,SAAS;;;;;;;QAGZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QAwPrC,YAAO,GAAG,CAAC,EAAsB;YACvC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;gBAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,KAAK,KAAK,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;aAC/D;YACD,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;SAC1B,CAAC;QAEM,aAAQ,GAAG,CAAC,EAAS;YAC3B,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;SAC1B,CAAC;QAEM,WAAM,GAAG,CAAC,EAAc;YAC9B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,EAAE;gBAKpC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;aAC1B;YAED,IAAI,CAAC,QAAQ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AAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAClF,iBAAW,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,aAAa,GAAG,YAAY,GAAI,EAC3E,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,EACP;KACH;;;;;;AAGH,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;;","names":[],"sources":["src/components/cpsl-input/cpsl-input.scss?tag=cpsl-input&encapsulation=shadow","src/components/cpsl-input/cpsl-input.tsx"],"sourcesContent":["@import '../../themes/capsule.globals';\n\n:host {\n --container-box-shadow: none;\n --container-box-shadow-color: var(--cpsl-color-alpha-black-16);\n --container-border-color: var(--cpsl-color-input-border-active);\n --container-border-error-color: var(--cpsl-color-input-border-error);\n --container-background-color: var(--cpsl-color-input-surface-default);\n --container-background-color-disabled: var(--cpsl-color-input-surface-disabled);\n --container-border-width: 1px;\n --container-border-radius: var(--cpsl-border-radius-input);\n --container-padding-top: 4px;\n --container-padding-bottom: 4px;\n --container-padding-end: 4px;\n --container-padding-start: 8px;\n --container-height: 46px;\n --container-gap: 8px;\n\n --input-background-color: var(--cpsl-color-input-surface-default);\n --input-background-color-disabled: var(--cpsl-color-input-surface-disabled);\n --input-color: var(--cpsl-color-text-primary);\n --input-placeholder-color: var(--cpsl-color-text-secondary);\n --input-font-size: var(--cpsl-font-size-body-m);\n\n --label-color: var(--cpsl-color-text-primary);\n --label-font-size: var(--cpsl-font-size-body-s);\n --label-margin-bottom: 5px;\n\n --helper-text-color: var(--cpsl-color-text-secondary);\n --helper-text-error-color: var(--cpsl-color-text-error);\n --helper-text-icon-color: var(--cpsl-color-text-secondary);\n --helper-text-icon-error-color: var(--cpsl-color-text-error);\n --helper-text-icon-size: 16px;\n --helper-text-font-size: var(--cpsl-font-size-body-xs);\n --helper-text-margin-top: 8px;\n\n display: block;\n\n font-family: $font-family-base;\n}\n\n:host(.disabled) {\n --container-background-color: var(--container-background-color-disabled);\n --input-background-color: var(--input-background-color-disabled);\n --input-color: var(--cpsl-color-text-secondary);\n}\n\n:host(:not(.has-value)) {\n --container-border-color: var(--cpsl-color-input-border-placeholder);\n --input-color: var(--cpsl-color-text-secondary);\n --container-background-color: transparent;\n --input-background-color: transparent;\n}\n\n:host(.focused) {\n --container-box-shadow: 0px 0px 0px 2px var(--container-box-shadow-color);\n --container-border-color: var(--cpsl-color-input-border-active);\n --container-background-color: var(--cpsl-color-input-surface-default);\n}\n\n.input-container {\n @include padding(var(--container-padding-top), var(--container-padding-end), var(--container-padding-bottom), var(--container-padding-start));\n\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: var(--container-height);\n gap: var(--container-gap);\n\n border-style: solid;\n border-width: var(--container-border-width);\n border-color: var(--container-border-color);\n border-radius: var(--container-border-radius);\n background-color: var(--container-background-color);\n\n box-shadow: var(--container-box-shadow);\n}\n\n.error-container {\n border-color: var(--container-border-error-color);\n}\n\n.native-input {\n flex: 1;\n min-width: 0;\n border: none;\n height: 100%;\n box-sizing: border-box;\n\n font-size: var(--input-font-size);\n color: var(--input-color);\n background-color: var(--input-background-color);\n\n &:focus,\n &:focus-visible {\n outline: none;\n }\n\n &::placeholder {\n color: var(--input-placeholder-color);\n opacity: 1; /* Firefox */\n }\n\n font-family: $font-family-base;\n}\n\n.label {\n display: inline-block;\n color: var(--label-color);\n font-size: var(--label-font-size);\n font-weight: 500;\n\n margin-bottom: var(--label-margin-bottom);\n}\n\n.helper-text-container {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--helper-text-color);\n font-size: var(--helper-text-font-size);\n font-weight: 500;\n\n margin-top: var(--helper-text-margin-top);\n\n cpsl-icon {\n --height: var(--helper-text-icon-size);\n --width: var(--helper-text-icon-size);\n --icon-color: var(--helper-text-icon-color);\n }\n}\n\n.error-text {\n color: var(--helper-text-error-color);\n\n cpsl-icon {\n --icon-color: var(--helper-text-icon-error-color);\n }\n}\n\n:host {\n ::slotted([slot='start']) {\n flex: 0;\n }\n ::slotted([slot='end']) {\n flex: 0;\n }\n ::slotted(cpsl-icon) {\n --icon-color: var(--input-color);\n }\n ::slotted(cpsl-button) {\n width: calc(var(--container-height) - var(--container-padding-top) - var(--container-padding-bottom) - var(--container-border-width) * 2);\n --button-border-radius: calc(var(--container-border-radius) - 2px);\n }\n}\n","import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n componentDidLoad() {\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'true');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'false');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'false');\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.cpslInput.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent | Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get nativeInput() {\n return this.el.shadowRoot.getElementById(this.inputId);\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <div onClick={this.focusInput} class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"],"version":3}
|