kemet-ui 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2144 -1522
- package/dist/{components/kemet-accordion/styles.js → styles/elements/accordion.ts} +4 -3
- package/dist/{components/kemet-alert/styles.js → styles/elements/alert.ts} +53 -3
- package/dist/{components/kemet-avatar/styles.js → styles/elements/avatar.ts} +26 -12
- package/dist/styles/elements/badge.ts +92 -0
- package/dist/{components/kemet-button/styles.js → styles/elements/button.ts} +32 -13
- package/dist/{components/kemet-card/styles.js → styles/elements/card.ts} +3 -3
- package/dist/{components/kemet-carousel/styles.js → styles/elements/carousel.ts} +2 -2
- package/dist/{components/kemet-checkbox/styles.js → styles/elements/checkbox.ts} +2 -2
- package/dist/{components/kemet-combo/styles.js → styles/elements/combo.ts} +2 -2
- package/dist/{components/kemet-drawer/styles.js → styles/elements/drawer.ts} +5 -3
- package/dist/{components/kemet-fab/styles.js → styles/elements/fab.ts} +2 -2
- package/dist/{components/kemet-field/styles.js → styles/elements/field.ts} +2 -14
- package/dist/{components/kemet-flipcard/styles.js → styles/elements/flipcard.ts} +2 -2
- package/dist/styles/elements/icon-lucide.ts +7 -0
- package/dist/{components/kemet-input/styles.js → styles/elements/input.ts} +36 -12
- package/dist/{components/kemet-modal/styles.js → styles/elements/modal.ts} +27 -6
- package/dist/{components/kemet-multi-input/styles.js → styles/elements/multi-input.ts} +41 -3
- package/dist/{components/kemet-password/styles.js → styles/elements/password.ts} +3 -3
- package/dist/{components/kemet-popper/styles.effects.js → styles/elements/popper.ts} +52 -9
- package/dist/{components/kemet-radio/styles.js → styles/elements/radio.ts} +4 -3
- package/dist/{components/kemet-rotator/styles.js → styles/elements/rotator.ts} +2 -2
- package/dist/{components/kemet-scroll-nav/styles.js → styles/elements/scroll-nav.ts} +2 -2
- package/dist/{components/kemet-scroll-snap/styles.js → styles/elements/scroll-snap.ts} +4 -3
- package/dist/{components/kemet-select/styles.js → styles/elements/select.ts} +34 -10
- package/dist/{components/kemet-sortable/styles.js → styles/elements/sortable.ts} +4 -3
- package/dist/{components/kemet-tabs/styles.js → styles/elements/tabs.ts} +7 -5
- package/dist/{components/kemet-textarea/styles.js → styles/elements/textarea.ts} +29 -4
- package/dist/{components/kemet-timer/styles.js → styles/elements/timer.ts} +4 -3
- package/dist/{components/kemet-toggle/styles.js → styles/elements/toggle.ts} +2 -2
- package/dist/{components/kemet-tooltip/styles.js → styles/elements/tooltip.ts} +2 -2
- package/dist/{components/kemet-tracker/styles.js → styles/elements/tracker.ts} +2 -2
- package/dist/{components/kemet-upload/styles.js → styles/elements/upload.ts} +6 -4
- package/dist/styles/kemet.base.css +1 -1
- package/dist/styles/kemet.base.css.map +1 -1
- package/dist/styles/kemet.core.css +1 -1
- package/dist/styles/kemet.core.css.map +1 -1
- package/dist/styles/shared/_helpers.scss +19 -18
- package/package.json +71 -88
- package/types/global.d.ts +3 -0
- package/types/jsx.d.ts +140 -0
- package/dist/components/kemet-accordion/docs/stories.d.ts +0 -12
- package/dist/components/kemet-accordion/docs/stories.js +0 -99
- package/dist/components/kemet-accordion/docs/stories.js.map +0 -1
- package/dist/components/kemet-accordion/kemet-accordion-panel.d.ts +0 -50
- package/dist/components/kemet-accordion/kemet-accordion-panel.js +0 -137
- package/dist/components/kemet-accordion/kemet-accordion-panel.js.map +0 -1
- package/dist/components/kemet-accordion/kemet-accordion.d.ts +0 -38
- package/dist/components/kemet-accordion/kemet-accordion.js +0 -138
- package/dist/components/kemet-accordion/kemet-accordion.js.map +0 -1
- package/dist/components/kemet-accordion/spec.d.ts +0 -2
- package/dist/components/kemet-accordion/spec.js +0 -132
- package/dist/components/kemet-accordion/spec.js.map +0 -1
- package/dist/components/kemet-accordion/styles.d.ts +0 -2
- package/dist/components/kemet-accordion/styles.js.map +0 -1
- package/dist/components/kemet-alert/docs/stories.d.ts +0 -21
- package/dist/components/kemet-alert/docs/stories.js +0 -222
- package/dist/components/kemet-alert/docs/stories.js.map +0 -1
- package/dist/components/kemet-alert/kemet-alert.d.ts +0 -51
- package/dist/components/kemet-alert/kemet-alert.js +0 -111
- package/dist/components/kemet-alert/kemet-alert.js.map +0 -1
- package/dist/components/kemet-alert/spec.d.ts +0 -1
- package/dist/components/kemet-alert/spec.js +0 -35
- package/dist/components/kemet-alert/spec.js.map +0 -1
- package/dist/components/kemet-alert/styles.d.ts +0 -1
- package/dist/components/kemet-alert/styles.js.map +0 -1
- package/dist/components/kemet-alert/types.d.ts +0 -1
- package/dist/components/kemet-alert/types.js +0 -2
- package/dist/components/kemet-alert/types.js.map +0 -1
- package/dist/components/kemet-avatar/docs/stories.d.ts +0 -15
- package/dist/components/kemet-avatar/docs/stories.js +0 -108
- package/dist/components/kemet-avatar/docs/stories.js.map +0 -1
- package/dist/components/kemet-avatar/kemet-avatar.d.ts +0 -43
- package/dist/components/kemet-avatar/kemet-avatar.js +0 -78
- package/dist/components/kemet-avatar/kemet-avatar.js.map +0 -1
- package/dist/components/kemet-avatar/kemet-avatars.d.ts +0 -20
- package/dist/components/kemet-avatar/kemet-avatars.js +0 -25
- package/dist/components/kemet-avatar/kemet-avatars.js.map +0 -1
- package/dist/components/kemet-avatar/spec.d.ts +0 -1
- package/dist/components/kemet-avatar/spec.js +0 -26
- package/dist/components/kemet-avatar/spec.js.map +0 -1
- package/dist/components/kemet-avatar/styles.d.ts +0 -2
- package/dist/components/kemet-avatar/styles.js.map +0 -1
- package/dist/components/kemet-badge/docs/stories.d.ts +0 -15
- package/dist/components/kemet-badge/docs/stories.js +0 -76
- package/dist/components/kemet-badge/docs/stories.js.map +0 -1
- package/dist/components/kemet-badge/kemet-badge.d.ts +0 -31
- package/dist/components/kemet-badge/kemet-badge.js +0 -55
- package/dist/components/kemet-badge/kemet-badge.js.map +0 -1
- package/dist/components/kemet-badge/spec.d.ts +0 -1
- package/dist/components/kemet-badge/spec.js +0 -21
- package/dist/components/kemet-badge/spec.js.map +0 -1
- package/dist/components/kemet-badge/styles.d.ts +0 -1
- package/dist/components/kemet-badge/styles.js +0 -42
- package/dist/components/kemet-badge/styles.js.map +0 -1
- package/dist/components/kemet-badge/types.d.ts +0 -1
- package/dist/components/kemet-badge/types.js +0 -2
- package/dist/components/kemet-badge/types.js.map +0 -1
- package/dist/components/kemet-button/docs/stories.d.ts +0 -21
- package/dist/components/kemet-button/docs/stories.js +0 -112
- package/dist/components/kemet-button/docs/stories.js.map +0 -1
- package/dist/components/kemet-button/kemet-button.d.ts +0 -89
- package/dist/components/kemet-button/kemet-button.js +0 -155
- package/dist/components/kemet-button/kemet-button.js.map +0 -1
- package/dist/components/kemet-button/spec.d.ts +0 -1
- package/dist/components/kemet-button/spec.js +0 -49
- package/dist/components/kemet-button/spec.js.map +0 -1
- package/dist/components/kemet-button/styles.d.ts +0 -1
- package/dist/components/kemet-button/styles.js.map +0 -1
- package/dist/components/kemet-button/types.d.ts +0 -1
- package/dist/components/kemet-button/types.js +0 -2
- package/dist/components/kemet-button/types.js.map +0 -1
- package/dist/components/kemet-card/docs/stories.d.ts +0 -19
- package/dist/components/kemet-card/docs/stories.js +0 -120
- package/dist/components/kemet-card/docs/stories.js.map +0 -1
- package/dist/components/kemet-card/kemet-card.d.ts +0 -47
- package/dist/components/kemet-card/kemet-card.js +0 -65
- package/dist/components/kemet-card/kemet-card.js.map +0 -1
- package/dist/components/kemet-card/spec.d.ts +0 -1
- package/dist/components/kemet-card/spec.js +0 -31
- package/dist/components/kemet-card/spec.js.map +0 -1
- package/dist/components/kemet-card/styles.d.ts +0 -1
- package/dist/components/kemet-card/styles.js.map +0 -1
- package/dist/components/kemet-carousel/docs/stories.d.ts +0 -23
- package/dist/components/kemet-carousel/docs/stories.js +0 -180
- package/dist/components/kemet-carousel/docs/stories.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-current.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-current.js +0 -44
- package/dist/components/kemet-carousel/kemet-carousel-current.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-first.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-first.js +0 -57
- package/dist/components/kemet-carousel/kemet-carousel-first.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-last.js +0 -57
- package/dist/components/kemet-carousel/kemet-carousel-last.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-link.d.ts +0 -32
- package/dist/components/kemet-carousel/kemet-carousel-link.js +0 -74
- package/dist/components/kemet-carousel/kemet-carousel-link.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-next.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-next.js +0 -57
- package/dist/components/kemet-carousel/kemet-carousel-next.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-prev.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-prev.js +0 -57
- package/dist/components/kemet-carousel/kemet-carousel-prev.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-slide.d.ts +0 -29
- package/dist/components/kemet-carousel/kemet-carousel-slide.js +0 -53
- package/dist/components/kemet-carousel/kemet-carousel-slide.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel-total.d.ts +0 -26
- package/dist/components/kemet-carousel/kemet-carousel-total.js +0 -44
- package/dist/components/kemet-carousel/kemet-carousel-total.js.map +0 -1
- package/dist/components/kemet-carousel/kemet-carousel.d.ts +0 -118
- package/dist/components/kemet-carousel/kemet-carousel.js +0 -429
- package/dist/components/kemet-carousel/kemet-carousel.js.map +0 -1
- package/dist/components/kemet-carousel/spec.d.ts +0 -10
- package/dist/components/kemet-carousel/spec.js +0 -168
- package/dist/components/kemet-carousel/spec.js.map +0 -1
- package/dist/components/kemet-carousel/styles.d.ts +0 -1
- package/dist/components/kemet-carousel/styles.js.map +0 -1
- package/dist/components/kemet-checkbox/docs/stories.d.ts +0 -13
- package/dist/components/kemet-checkbox/docs/stories.js +0 -45
- package/dist/components/kemet-checkbox/docs/stories.js.map +0 -1
- package/dist/components/kemet-checkbox/kemet-checkbox.d.ts +0 -71
- package/dist/components/kemet-checkbox/kemet-checkbox.js +0 -192
- package/dist/components/kemet-checkbox/kemet-checkbox.js.map +0 -1
- package/dist/components/kemet-checkbox/spec.d.ts +0 -1
- package/dist/components/kemet-checkbox/spec.js +0 -33
- package/dist/components/kemet-checkbox/spec.js.map +0 -1
- package/dist/components/kemet-checkbox/styles.d.ts +0 -1
- package/dist/components/kemet-checkbox/styles.js.map +0 -1
- package/dist/components/kemet-checkbox/types.d.ts +0 -15
- package/dist/components/kemet-checkbox/types.js +0 -2
- package/dist/components/kemet-checkbox/types.js.map +0 -1
- package/dist/components/kemet-combo/docs/stories.d.ts +0 -11
- package/dist/components/kemet-combo/docs/stories.js +0 -32
- package/dist/components/kemet-combo/docs/stories.js.map +0 -1
- package/dist/components/kemet-combo/kemet-combo.d.ts +0 -51
- package/dist/components/kemet-combo/kemet-combo.js +0 -163
- package/dist/components/kemet-combo/kemet-combo.js.map +0 -1
- package/dist/components/kemet-combo/spec.d.ts +0 -3
- package/dist/components/kemet-combo/spec.js +0 -46
- package/dist/components/kemet-combo/spec.js.map +0 -1
- package/dist/components/kemet-combo/styles.d.ts +0 -1
- package/dist/components/kemet-combo/styles.js.map +0 -1
- package/dist/components/kemet-count/docs/stories.d.ts +0 -11
- package/dist/components/kemet-count/docs/stories.js +0 -36
- package/dist/components/kemet-count/docs/stories.js.map +0 -1
- package/dist/components/kemet-count/kemet-count.d.ts +0 -39
- package/dist/components/kemet-count/kemet-count.js +0 -98
- package/dist/components/kemet-count/kemet-count.js.map +0 -1
- package/dist/components/kemet-count/spec.d.ts +0 -4
- package/dist/components/kemet-count/spec.js +0 -45
- package/dist/components/kemet-count/spec.js.map +0 -1
- package/dist/components/kemet-draggable/docs/stories.d.ts +0 -10
- package/dist/components/kemet-draggable/docs/stories.js +0 -25
- package/dist/components/kemet-draggable/docs/stories.js.map +0 -1
- package/dist/components/kemet-draggable/kemet-draggable.d.ts +0 -49
- package/dist/components/kemet-draggable/kemet-draggable.js +0 -138
- package/dist/components/kemet-draggable/kemet-draggable.js.map +0 -1
- package/dist/components/kemet-draggable/spec.d.ts +0 -1
- package/dist/components/kemet-draggable/spec.js +0 -30
- package/dist/components/kemet-draggable/spec.js.map +0 -1
- package/dist/components/kemet-drawer/docs/stories.d.ts +0 -16
- package/dist/components/kemet-drawer/docs/stories.js +0 -90
- package/dist/components/kemet-drawer/docs/stories.js.map +0 -1
- package/dist/components/kemet-drawer/kemet-drawer.d.ts +0 -48
- package/dist/components/kemet-drawer/kemet-drawer.js +0 -95
- package/dist/components/kemet-drawer/kemet-drawer.js.map +0 -1
- package/dist/components/kemet-drawer/spec.d.ts +0 -1
- package/dist/components/kemet-drawer/spec.js +0 -21
- package/dist/components/kemet-drawer/spec.js.map +0 -1
- package/dist/components/kemet-drawer/styles.d.ts +0 -2
- package/dist/components/kemet-drawer/styles.js.map +0 -1
- package/dist/components/kemet-drawer/types.d.ts +0 -2
- package/dist/components/kemet-drawer/types.js +0 -2
- package/dist/components/kemet-drawer/types.js.map +0 -1
- package/dist/components/kemet-fab/docs/stories.d.ts +0 -14
- package/dist/components/kemet-fab/docs/stories.js +0 -78
- package/dist/components/kemet-fab/docs/stories.js.map +0 -1
- package/dist/components/kemet-fab/kemet-fab.d.ts +0 -49
- package/dist/components/kemet-fab/kemet-fab.js +0 -101
- package/dist/components/kemet-fab/kemet-fab.js.map +0 -1
- package/dist/components/kemet-fab/spec.d.ts +0 -2
- package/dist/components/kemet-fab/spec.js +0 -43
- package/dist/components/kemet-fab/spec.js.map +0 -1
- package/dist/components/kemet-fab/styles.d.ts +0 -1
- package/dist/components/kemet-fab/styles.js.map +0 -1
- package/dist/components/kemet-fab/types.d.ts +0 -8
- package/dist/components/kemet-fab/types.js +0 -2
- package/dist/components/kemet-fab/types.js.map +0 -1
- package/dist/components/kemet-field/docs/stories.d.ts +0 -15
- package/dist/components/kemet-field/docs/stories.js +0 -55
- package/dist/components/kemet-field/docs/stories.js.map +0 -1
- package/dist/components/kemet-field/kemet-field.d.ts +0 -61
- package/dist/components/kemet-field/kemet-field.js +0 -139
- package/dist/components/kemet-field/kemet-field.js.map +0 -1
- package/dist/components/kemet-field/spec.d.ts +0 -2
- package/dist/components/kemet-field/spec.js +0 -38
- package/dist/components/kemet-field/spec.js.map +0 -1
- package/dist/components/kemet-field/styles.d.ts +0 -1
- package/dist/components/kemet-field/styles.js.map +0 -1
- package/dist/components/kemet-field/types.d.ts +0 -13
- package/dist/components/kemet-field/types.js +0 -2
- package/dist/components/kemet-field/types.js.map +0 -1
- package/dist/components/kemet-flipcard/docs/stories.d.ts +0 -14
- package/dist/components/kemet-flipcard/docs/stories.js +0 -60
- package/dist/components/kemet-flipcard/docs/stories.js.map +0 -1
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.d.ts +0 -21
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js +0 -41
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js.map +0 -1
- package/dist/components/kemet-flipcard/kemet-flipcard.d.ts +0 -52
- package/dist/components/kemet-flipcard/kemet-flipcard.js +0 -129
- package/dist/components/kemet-flipcard/kemet-flipcard.js.map +0 -1
- package/dist/components/kemet-flipcard/spec.d.ts +0 -3
- package/dist/components/kemet-flipcard/spec.js +0 -38
- package/dist/components/kemet-flipcard/spec.js.map +0 -1
- package/dist/components/kemet-flipcard/styles.d.ts +0 -1
- package/dist/components/kemet-flipcard/styles.js.map +0 -1
- package/dist/components/kemet-flipcard/types.d.ts +0 -7
- package/dist/components/kemet-flipcard/types.js +0 -2
- package/dist/components/kemet-flipcard/types.js.map +0 -1
- package/dist/components/kemet-icon/docs/stories.d.ts +0 -9
- package/dist/components/kemet-icon/docs/stories.js +0 -27
- package/dist/components/kemet-icon/docs/stories.js.map +0 -1
- package/dist/components/kemet-icon/kemet-icon.d.ts +0 -28
- package/dist/components/kemet-icon/kemet-icon.js +0 -114
- package/dist/components/kemet-icon/kemet-icon.js.map +0 -1
- package/dist/components/kemet-icon/spec.d.ts +0 -1
- package/dist/components/kemet-icon/spec.js +0 -69
- package/dist/components/kemet-icon/spec.js.map +0 -1
- package/dist/components/kemet-icon/styles.d.ts +0 -1
- package/dist/components/kemet-icon/styles.js +0 -9
- package/dist/components/kemet-icon/styles.js.map +0 -1
- package/dist/components/kemet-icon/types.d.ts +0 -5
- package/dist/components/kemet-icon/types.js +0 -2
- package/dist/components/kemet-icon/types.js.map +0 -1
- package/dist/components/kemet-input/docs/stories.d.ts +0 -13
- package/dist/components/kemet-input/docs/stories.js +0 -83
- package/dist/components/kemet-input/docs/stories.js.map +0 -1
- package/dist/components/kemet-input/kemet-input.d.ts +0 -174
- package/dist/components/kemet-input/kemet-input.js +0 -397
- package/dist/components/kemet-input/kemet-input.js.map +0 -1
- package/dist/components/kemet-input/spec.d.ts +0 -1
- package/dist/components/kemet-input/spec.js +0 -83
- package/dist/components/kemet-input/spec.js.map +0 -1
- package/dist/components/kemet-input/styles.d.ts +0 -1
- package/dist/components/kemet-input/styles.js.map +0 -1
- package/dist/components/kemet-input/types.d.ts +0 -35
- package/dist/components/kemet-input/types.js +0 -2
- package/dist/components/kemet-input/types.js.map +0 -1
- package/dist/components/kemet-modal/docs/stories.d.ts +0 -12
- package/dist/components/kemet-modal/docs/stories.js +0 -58
- package/dist/components/kemet-modal/docs/stories.js.map +0 -1
- package/dist/components/kemet-modal/kemet-modal-close.d.ts +0 -21
- package/dist/components/kemet-modal/kemet-modal-close.js +0 -40
- package/dist/components/kemet-modal/kemet-modal-close.js.map +0 -1
- package/dist/components/kemet-modal/kemet-modal.d.ts +0 -59
- package/dist/components/kemet-modal/kemet-modal.js +0 -150
- package/dist/components/kemet-modal/kemet-modal.js.map +0 -1
- package/dist/components/kemet-modal/styles.d.ts +0 -2
- package/dist/components/kemet-modal/styles.js.map +0 -1
- package/dist/components/kemet-modal/types.d.ts +0 -8
- package/dist/components/kemet-modal/types.js +0 -2
- package/dist/components/kemet-modal/types.js.map +0 -1
- package/dist/components/kemet-multi-input/docs/stories.d.ts +0 -8
- package/dist/components/kemet-multi-input/docs/stories.js +0 -33
- package/dist/components/kemet-multi-input/docs/stories.js.map +0 -1
- package/dist/components/kemet-multi-input/kemet-multi-input.d.ts +0 -116
- package/dist/components/kemet-multi-input/kemet-multi-input.js +0 -193
- package/dist/components/kemet-multi-input/kemet-multi-input.js.map +0 -1
- package/dist/components/kemet-multi-input/styles.d.ts +0 -1
- package/dist/components/kemet-multi-input/styles.js.map +0 -1
- package/dist/components/kemet-multi-input/types.d.ts +0 -5
- package/dist/components/kemet-multi-input/types.js +0 -2
- package/dist/components/kemet-multi-input/types.js.map +0 -1
- package/dist/components/kemet-password/docs/stories.d.ts +0 -10
- package/dist/components/kemet-password/docs/stories.js +0 -29
- package/dist/components/kemet-password/docs/stories.js.map +0 -1
- package/dist/components/kemet-password/kemet-password.d.ts +0 -83
- package/dist/components/kemet-password/kemet-password.js +0 -155
- package/dist/components/kemet-password/kemet-password.js.map +0 -1
- package/dist/components/kemet-password/styles.d.ts +0 -1
- package/dist/components/kemet-password/styles.js.map +0 -1
- package/dist/components/kemet-password/types.d.ts +0 -10
- package/dist/components/kemet-password/types.js +0 -2
- package/dist/components/kemet-password/types.js.map +0 -1
- package/dist/components/kemet-popper/docs/stories.d.ts +0 -12
- package/dist/components/kemet-popper/docs/stories.js +0 -65
- package/dist/components/kemet-popper/docs/stories.js.map +0 -1
- package/dist/components/kemet-popper/kemet-popper-close.d.ts +0 -22
- package/dist/components/kemet-popper/kemet-popper-close.js +0 -48
- package/dist/components/kemet-popper/kemet-popper-close.js.map +0 -1
- package/dist/components/kemet-popper/kemet-popper.d.ts +0 -72
- package/dist/components/kemet-popper/kemet-popper.js +0 -173
- package/dist/components/kemet-popper/kemet-popper.js.map +0 -1
- package/dist/components/kemet-popper/styles.d.ts +0 -1
- package/dist/components/kemet-popper/styles.effects.d.ts +0 -8
- package/dist/components/kemet-popper/styles.effects.js.map +0 -1
- package/dist/components/kemet-popper/styles.js +0 -37
- package/dist/components/kemet-popper/styles.js.map +0 -1
- package/dist/components/kemet-popper/types.d.ts +0 -3
- package/dist/components/kemet-popper/types.js +0 -2
- package/dist/components/kemet-popper/types.js.map +0 -1
- package/dist/components/kemet-radio/docs/stories.d.ts +0 -12
- package/dist/components/kemet-radio/docs/stories.js +0 -44
- package/dist/components/kemet-radio/docs/stories.js.map +0 -1
- package/dist/components/kemet-radio/kemet-radio.d.ts +0 -57
- package/dist/components/kemet-radio/kemet-radio.js +0 -130
- package/dist/components/kemet-radio/kemet-radio.js.map +0 -1
- package/dist/components/kemet-radio/kemet-radios.d.ts +0 -50
- package/dist/components/kemet-radio/kemet-radios.js +0 -149
- package/dist/components/kemet-radio/kemet-radios.js.map +0 -1
- package/dist/components/kemet-radio/spec.d.ts +0 -3
- package/dist/components/kemet-radio/spec.js +0 -67
- package/dist/components/kemet-radio/spec.js.map +0 -1
- package/dist/components/kemet-radio/styles.d.ts +0 -2
- package/dist/components/kemet-radio/styles.js.map +0 -1
- package/dist/components/kemet-radio/types.d.ts +0 -20
- package/dist/components/kemet-radio/types.js +0 -2
- package/dist/components/kemet-radio/types.js.map +0 -1
- package/dist/components/kemet-rotator/docs/stories.d.ts +0 -10
- package/dist/components/kemet-rotator/docs/stories.js +0 -34
- package/dist/components/kemet-rotator/docs/stories.js.map +0 -1
- package/dist/components/kemet-rotator/kemet-rotator.d.ts +0 -40
- package/dist/components/kemet-rotator/kemet-rotator.js +0 -121
- package/dist/components/kemet-rotator/kemet-rotator.js.map +0 -1
- package/dist/components/kemet-rotator/styles.d.ts +0 -1
- package/dist/components/kemet-rotator/styles.js.map +0 -1
- package/dist/components/kemet-rotator/types.d.ts +0 -9
- package/dist/components/kemet-rotator/types.js +0 -2
- package/dist/components/kemet-rotator/types.js.map +0 -1
- package/dist/components/kemet-scroll-link/docs/stories.d.ts +0 -9
- package/dist/components/kemet-scroll-link/docs/stories.js +0 -97
- package/dist/components/kemet-scroll-link/docs/stories.js.map +0 -1
- package/dist/components/kemet-scroll-link/kemet-scroll-link.d.ts +0 -31
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js +0 -83
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js.map +0 -1
- package/dist/components/kemet-scroll-link/types.d.ts +0 -6
- package/dist/components/kemet-scroll-link/types.js +0 -2
- package/dist/components/kemet-scroll-link/types.js.map +0 -1
- package/dist/components/kemet-scroll-nav/docs/stories.d.ts +0 -10
- package/dist/components/kemet-scroll-nav/docs/stories.js +0 -162
- package/dist/components/kemet-scroll-nav/docs/stories.js.map +0 -1
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.d.ts +0 -34
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js +0 -65
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js.map +0 -1
- package/dist/components/kemet-scroll-nav/styles.d.ts +0 -1
- package/dist/components/kemet-scroll-nav/styles.js.map +0 -1
- package/dist/components/kemet-scroll-nav/types.d.ts +0 -6
- package/dist/components/kemet-scroll-nav/types.js +0 -2
- package/dist/components/kemet-scroll-nav/types.js.map +0 -1
- package/dist/components/kemet-scroll-snap/docs/stories.d.ts +0 -17
- package/dist/components/kemet-scroll-snap/docs/stories.js +0 -121
- package/dist/components/kemet-scroll-snap/docs/stories.js.map +0 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.d.ts +0 -45
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js +0 -120
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js.map +0 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.d.ts +0 -30
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js +0 -53
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js.map +0 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.d.ts +0 -47
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js +0 -117
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js.map +0 -1
- package/dist/components/kemet-scroll-snap/styles.d.ts +0 -2
- package/dist/components/kemet-scroll-snap/styles.js.map +0 -1
- package/dist/components/kemet-scroll-snap/types.d.ts +0 -20
- package/dist/components/kemet-scroll-snap/types.js +0 -2
- package/dist/components/kemet-scroll-snap/types.js.map +0 -1
- package/dist/components/kemet-select/docs/stories.d.ts +0 -13
- package/dist/components/kemet-select/docs/stories.js +0 -49
- package/dist/components/kemet-select/docs/stories.js.map +0 -1
- package/dist/components/kemet-select/kemet-option.d.ts +0 -29
- package/dist/components/kemet-select/kemet-option.js +0 -45
- package/dist/components/kemet-select/kemet-option.js.map +0 -1
- package/dist/components/kemet-select/kemet-select.d.ts +0 -119
- package/dist/components/kemet-select/kemet-select.js +0 -198
- package/dist/components/kemet-select/kemet-select.js.map +0 -1
- package/dist/components/kemet-select/spec.d.ts +0 -3
- package/dist/components/kemet-select/spec.js +0 -53
- package/dist/components/kemet-select/spec.js.map +0 -1
- package/dist/components/kemet-select/styles.d.ts +0 -1
- package/dist/components/kemet-select/styles.js.map +0 -1
- package/dist/components/kemet-select/types.d.ts +0 -20
- package/dist/components/kemet-select/types.js +0 -2
- package/dist/components/kemet-select/types.js.map +0 -1
- package/dist/components/kemet-sortable/docs/stories.d.ts +0 -10
- package/dist/components/kemet-sortable/docs/stories.js +0 -29
- package/dist/components/kemet-sortable/docs/stories.js.map +0 -1
- package/dist/components/kemet-sortable/kemet-sortable-item.d.ts +0 -21
- package/dist/components/kemet-sortable/kemet-sortable-item.js +0 -30
- package/dist/components/kemet-sortable/kemet-sortable-item.js.map +0 -1
- package/dist/components/kemet-sortable/kemet-sortable.d.ts +0 -25
- package/dist/components/kemet-sortable/kemet-sortable.js +0 -77
- package/dist/components/kemet-sortable/kemet-sortable.js.map +0 -1
- package/dist/components/kemet-sortable/styles.d.ts +0 -2
- package/dist/components/kemet-sortable/styles.js.map +0 -1
- package/dist/components/kemet-sortable/types.d.ts +0 -3
- package/dist/components/kemet-sortable/types.js +0 -2
- package/dist/components/kemet-sortable/types.js.map +0 -1
- package/dist/components/kemet-svgs/docs/stories.d.ts +0 -10
- package/dist/components/kemet-svgs/docs/stories.js +0 -67
- package/dist/components/kemet-svgs/docs/stories.js.map +0 -1
- package/dist/components/kemet-svgs/kemet-svg.d.ts +0 -38
- package/dist/components/kemet-svgs/kemet-svg.js +0 -97
- package/dist/components/kemet-svgs/kemet-svg.js.map +0 -1
- package/dist/components/kemet-svgs/kemet-svgs.d.ts +0 -27
- package/dist/components/kemet-svgs/kemet-svgs.js +0 -51
- package/dist/components/kemet-svgs/kemet-svgs.js.map +0 -1
- package/dist/components/kemet-svgs/types.d.ts +0 -10
- package/dist/components/kemet-svgs/types.js +0 -2
- package/dist/components/kemet-svgs/types.js.map +0 -1
- package/dist/components/kemet-tabs/docs/stories.d.ts +0 -18
- package/dist/components/kemet-tabs/docs/stories.js +0 -142
- package/dist/components/kemet-tabs/docs/stories.js.map +0 -1
- package/dist/components/kemet-tabs/kemet-tab-panel.d.ts +0 -28
- package/dist/components/kemet-tabs/kemet-tab-panel.js +0 -55
- package/dist/components/kemet-tabs/kemet-tab-panel.js.map +0 -1
- package/dist/components/kemet-tabs/kemet-tab.d.ts +0 -38
- package/dist/components/kemet-tabs/kemet-tab.js +0 -82
- package/dist/components/kemet-tabs/kemet-tab.js.map +0 -1
- package/dist/components/kemet-tabs/kemet-tabs.d.ts +0 -100
- package/dist/components/kemet-tabs/kemet-tabs.js +0 -487
- package/dist/components/kemet-tabs/kemet-tabs.js.map +0 -1
- package/dist/components/kemet-tabs/styles.d.ts +0 -3
- package/dist/components/kemet-tabs/styles.js.map +0 -1
- package/dist/components/kemet-tabs/types.d.ts +0 -27
- package/dist/components/kemet-tabs/types.js +0 -2
- package/dist/components/kemet-tabs/types.js.map +0 -1
- package/dist/components/kemet-textarea/docs/stories.d.ts +0 -12
- package/dist/components/kemet-textarea/docs/stories.js +0 -58
- package/dist/components/kemet-textarea/docs/stories.js.map +0 -1
- package/dist/components/kemet-textarea/kemet-textarea.d.ts +0 -123
- package/dist/components/kemet-textarea/kemet-textarea.js +0 -293
- package/dist/components/kemet-textarea/kemet-textarea.js.map +0 -1
- package/dist/components/kemet-textarea/spec.d.ts +0 -3
- package/dist/components/kemet-textarea/spec.js +0 -69
- package/dist/components/kemet-textarea/spec.js.map +0 -1
- package/dist/components/kemet-textarea/styles.d.ts +0 -1
- package/dist/components/kemet-textarea/styles.js.map +0 -1
- package/dist/components/kemet-textarea/types.d.ts +0 -20
- package/dist/components/kemet-textarea/types.js +0 -2
- package/dist/components/kemet-textarea/types.js.map +0 -1
- package/dist/components/kemet-timer/docs/stories.d.ts +0 -10
- package/dist/components/kemet-timer/docs/stories.js +0 -40
- package/dist/components/kemet-timer/docs/stories.js.map +0 -1
- package/dist/components/kemet-timer/kemet-timer-display.d.ts +0 -25
- package/dist/components/kemet-timer/kemet-timer-display.js +0 -65
- package/dist/components/kemet-timer/kemet-timer-display.js.map +0 -1
- package/dist/components/kemet-timer/kemet-timer.d.ts +0 -36
- package/dist/components/kemet-timer/kemet-timer.js +0 -103
- package/dist/components/kemet-timer/kemet-timer.js.map +0 -1
- package/dist/components/kemet-timer/styles.d.ts +0 -2
- package/dist/components/kemet-timer/styles.js.map +0 -1
- package/dist/components/kemet-timer/types.d.ts +0 -1
- package/dist/components/kemet-timer/types.js +0 -2
- package/dist/components/kemet-timer/types.js.map +0 -1
- package/dist/components/kemet-toggle/docs/stories.d.ts +0 -11
- package/dist/components/kemet-toggle/docs/stories.js +0 -43
- package/dist/components/kemet-toggle/docs/stories.js.map +0 -1
- package/dist/components/kemet-toggle/kemet-toggle.d.ts +0 -60
- package/dist/components/kemet-toggle/kemet-toggle.js +0 -130
- package/dist/components/kemet-toggle/kemet-toggle.js.map +0 -1
- package/dist/components/kemet-toggle/spec.d.ts +0 -1
- package/dist/components/kemet-toggle/spec.js +0 -46
- package/dist/components/kemet-toggle/spec.js.map +0 -1
- package/dist/components/kemet-toggle/styles.d.ts +0 -1
- package/dist/components/kemet-toggle/styles.js.map +0 -1
- package/dist/components/kemet-toggle/types.d.ts +0 -10
- package/dist/components/kemet-toggle/types.js +0 -2
- package/dist/components/kemet-toggle/types.js.map +0 -1
- package/dist/components/kemet-tooltip/docs/stories.d.ts +0 -14
- package/dist/components/kemet-tooltip/docs/stories.js +0 -97
- package/dist/components/kemet-tooltip/docs/stories.js.map +0 -1
- package/dist/components/kemet-tooltip/kemet-tooltip.d.ts +0 -33
- package/dist/components/kemet-tooltip/kemet-tooltip.js +0 -69
- package/dist/components/kemet-tooltip/kemet-tooltip.js.map +0 -1
- package/dist/components/kemet-tooltip/styles.d.ts +0 -1
- package/dist/components/kemet-tooltip/styles.js.map +0 -1
- package/dist/components/kemet-tooltip/types.d.ts +0 -3
- package/dist/components/kemet-tooltip/types.js +0 -2
- package/dist/components/kemet-tooltip/types.js.map +0 -1
- package/dist/components/kemet-tracker/docs/stories.d.ts +0 -11
- package/dist/components/kemet-tracker/docs/stories.js +0 -42
- package/dist/components/kemet-tracker/docs/stories.js.map +0 -1
- package/dist/components/kemet-tracker/kemet-tracker-step.d.ts +0 -63
- package/dist/components/kemet-tracker/kemet-tracker-step.js +0 -127
- package/dist/components/kemet-tracker/kemet-tracker-step.js.map +0 -1
- package/dist/components/kemet-tracker/kemet-tracker.d.ts +0 -27
- package/dist/components/kemet-tracker/kemet-tracker.js +0 -70
- package/dist/components/kemet-tracker/kemet-tracker.js.map +0 -1
- package/dist/components/kemet-tracker/styles.d.ts +0 -1
- package/dist/components/kemet-tracker/styles.js.map +0 -1
- package/dist/components/kemet-tracker/types.d.ts +0 -13
- package/dist/components/kemet-tracker/types.js +0 -2
- package/dist/components/kemet-tracker/types.js.map +0 -1
- package/dist/components/kemet-upload/docs/stories.d.ts +0 -10
- package/dist/components/kemet-upload/docs/stories.js +0 -52
- package/dist/components/kemet-upload/docs/stories.js.map +0 -1
- package/dist/components/kemet-upload/kemet-upload-file.d.ts +0 -46
- package/dist/components/kemet-upload/kemet-upload-file.js +0 -109
- package/dist/components/kemet-upload/kemet-upload-file.js.map +0 -1
- package/dist/components/kemet-upload/kemet-upload.d.ts +0 -58
- package/dist/components/kemet-upload/kemet-upload.js +0 -149
- package/dist/components/kemet-upload/kemet-upload.js.map +0 -1
- package/dist/components/kemet-upload/styles.d.ts +0 -3
- package/dist/components/kemet-upload/styles.js.map +0 -1
- package/dist/components/kemet-upload/types.d.ts +0 -21
- package/dist/components/kemet-upload/types.js +0 -2
- package/dist/components/kemet-upload/types.js.map +0 -1
- package/dist/kemet-components.bundle.js +0 -83
- package/dist/kemet-components.bundle.js.map +0 -1
- package/dist/kemet-components.cjs +0 -12149
- package/dist/kemet-components.js +0 -12147
- package/dist/styles/components/_config.scss +0 -4
- package/dist/styles/components/accordion.scss +0 -9
- package/dist/styles/components/scrollsnap.scss +0 -11
- package/dist/styles/kemet.components.css +0 -23
- package/dist/styles/kemet.components.css.map +0 -1
- package/dist/styles/kemet.components.scss +0 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utilities/controllers/forms.d.ts +0 -11
- package/dist/utilities/controllers/forms.js +0 -100
- package/dist/utilities/controllers/forms.js.map +0 -1
- package/dist/utilities/controllers/forms.spec.d.ts +0 -2
- package/dist/utilities/controllers/forms.spec.js +0 -36
- package/dist/utilities/controllers/forms.spec.js.map +0 -1
- package/dist/utilities/misc/constants.d.ts +0 -5
- package/dist/utilities/misc/constants.js +0 -6
- package/dist/utilities/misc/constants.js.map +0 -1
- package/dist/utilities/misc/drag.d.ts +0 -6
- package/dist/utilities/misc/drag.js +0 -63
- package/dist/utilities/misc/drag.js.map +0 -1
- package/dist/utilities/misc/events.d.ts +0 -1
- package/dist/utilities/misc/events.js +0 -4
- package/dist/utilities/misc/events.js.map +0 -1
- package/index.js +0 -1
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { html, render } from 'lit';
|
|
2
|
-
import { expect } from '@wdio/globals';
|
|
3
|
-
import { getByText, waitFor } from '@testing-library/dom';
|
|
4
|
-
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import './kemet-carousel';
|
|
6
|
-
import './kemet-carousel-slide';
|
|
7
|
-
import './kemet-carousel-current';
|
|
8
|
-
import './kemet-carousel-total';
|
|
9
|
-
import './kemet-carousel-next';
|
|
10
|
-
import './kemet-carousel-prev';
|
|
11
|
-
import './kemet-carousel-first';
|
|
12
|
-
import './kemet-carousel-last';
|
|
13
|
-
import './kemet-carousel-link';
|
|
14
|
-
import '../kemet-icon/kemet-icon';
|
|
15
|
-
describe('Carousel', () => {
|
|
16
|
-
const templates = {
|
|
17
|
-
default: html `
|
|
18
|
-
<kemet-carousel>
|
|
19
|
-
<kemet-carousel-slide slot="slides">Slide 1</kemet-carousel-slide>
|
|
20
|
-
<kemet-carousel-slide slot="slides">Slide 2</kemet-carousel-slide>
|
|
21
|
-
<kemet-carousel-slide slot="slides">Slide 3</kemet-carousel-slide>
|
|
22
|
-
</kemet-carousel>
|
|
23
|
-
`,
|
|
24
|
-
descriptionBar: html `
|
|
25
|
-
<kemet-carousel>
|
|
26
|
-
<kemet-carousel-slide slot="slides">Slide 1</kemet-carousel-slide>
|
|
27
|
-
<kemet-carousel-slide slot="slides">Slide 2</kemet-carousel-slide>
|
|
28
|
-
<kemet-carousel-slide slot="slides">Slide 3</kemet-carousel-slide>
|
|
29
|
-
<div slot="toolbar">
|
|
30
|
-
<div>
|
|
31
|
-
<kemet-carousel-current></kemet-carousel-current>
|
|
32
|
-
of
|
|
33
|
-
<kemet-carousel-total></kemet-carousel-total>
|
|
34
|
-
:
|
|
35
|
-
<kemet-carousel-information>
|
|
36
|
-
<span slot="information"><a href="https://google.com" target="_blank">Title</a>. An image of slide 1.</span>
|
|
37
|
-
</kemet-carousel-information>
|
|
38
|
-
</div>
|
|
39
|
-
<kemet-carousel-prev>
|
|
40
|
-
<kemet-badge circle>
|
|
41
|
-
<kemet-icon icon="chevron-left"></kemet-icon>
|
|
42
|
-
</kemet-badge>
|
|
43
|
-
</kemet-carousel-prev>
|
|
44
|
-
<kemet-carousel-next>
|
|
45
|
-
<kemet-badge circle>
|
|
46
|
-
<kemet-icon icon="chevron-right"></kemet-icon>
|
|
47
|
-
</kemet-badge>
|
|
48
|
-
</kemet-carousel-next>
|
|
49
|
-
</div>
|
|
50
|
-
</kemet-carousel>
|
|
51
|
-
`,
|
|
52
|
-
paginationBar: html `
|
|
53
|
-
<kemet-carousel>
|
|
54
|
-
<kemet-carousel-slide slot="slides" selected>
|
|
55
|
-
<figure>
|
|
56
|
-
<h3>Slide 1</h3>
|
|
57
|
-
<img src="https://via.placeholder.com/1920x1080" alt="a placeholder" />
|
|
58
|
-
<figcaption>An image in a carousel.</figcaption>
|
|
59
|
-
</figure>
|
|
60
|
-
<span slot="information"><a href="https://google.com" target="_blank">Title</a>. An image of slide 1. </span>
|
|
61
|
-
</kemet-carousel-slide>
|
|
62
|
-
|
|
63
|
-
<kemet-carousel-slide slot="slides" selected>
|
|
64
|
-
<figure>
|
|
65
|
-
<h3>Slide 2</h3>
|
|
66
|
-
<img src="https://via.placeholder.com/1920x1080" alt="a placeholder" />
|
|
67
|
-
<figcaption>An image in a carousel.</figcaption>
|
|
68
|
-
</figure>
|
|
69
|
-
<span slot="information"><a href="https://google.com" target="_blank">Title</a>. An image of slide 2. </span>
|
|
70
|
-
</kemet-carousel-slide>
|
|
71
|
-
|
|
72
|
-
<kemet-carousel-slide slot="slides" selected>
|
|
73
|
-
<figure>
|
|
74
|
-
<h3>Slide 3</h3>
|
|
75
|
-
<img src="https://via.placeholder.com/1920x1080" alt="a placeholder" />
|
|
76
|
-
<figcaption>An image in a carousel.</figcaption>
|
|
77
|
-
</figure>
|
|
78
|
-
<span slot="information"><a href="https://google.com" target="_blank">Title</a>. An image of slide 3.</span>
|
|
79
|
-
</kemet-carousel-slide>
|
|
80
|
-
|
|
81
|
-
<kemet-carousel-first slot="toolbar">
|
|
82
|
-
<kemet-icon icon="chevron-double-left"></kemet-icon>
|
|
83
|
-
</kemet-carousel-first>
|
|
84
|
-
<kemet-carousel-prev slot="toolbar">
|
|
85
|
-
<kemet-icon icon="chevron-left"></kemet-icon>
|
|
86
|
-
</kemet-carousel-prev>
|
|
87
|
-
|
|
88
|
-
<kemet-carousel-link slot="toolbar" slide="0">1</kemet-carousel-link>
|
|
89
|
-
<kemet-carousel-link slot="toolbar" slide="1">2</kemet-carousel-link>
|
|
90
|
-
<kemet-carousel-link slot="toolbar" slide="2">3</kemet-carousel-link>
|
|
91
|
-
|
|
92
|
-
<kemet-carousel-next slot="toolbar">
|
|
93
|
-
<kemet-icon icon="chevron-right"></kemet-icon>
|
|
94
|
-
</kemet-carousel-next>
|
|
95
|
-
<kemet-carousel-last slot="toolbar">
|
|
96
|
-
<kemet-icon icon="chevron-double-right"></kemet-icon>
|
|
97
|
-
</kemet-carousel-last>
|
|
98
|
-
</kemet-carousel>
|
|
99
|
-
`,
|
|
100
|
-
};
|
|
101
|
-
it('displays a carousel', async () => {
|
|
102
|
-
render(templates.descriptionBar, document.body);
|
|
103
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
104
|
-
expect(carousel).toBeTruthy();
|
|
105
|
-
});
|
|
106
|
-
describe('Navigation', () => {
|
|
107
|
-
it('handles navigation to the next slide', async () => {
|
|
108
|
-
render(templates.paginationBar, document.body);
|
|
109
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
110
|
-
await waitFor(async () => {
|
|
111
|
-
const next = carousel.querySelector('kemet-carousel-next').shadowRoot.querySelector('button');
|
|
112
|
-
await userEvent.click(next);
|
|
113
|
-
next.focus();
|
|
114
|
-
await userEvent.keyboard('[Enter]');
|
|
115
|
-
expect(carousel.index).toBe(2);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
it('handles navigation to the previous slide', async () => {
|
|
119
|
-
render(templates.paginationBar, document.body);
|
|
120
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
121
|
-
carousel.index = 2;
|
|
122
|
-
await waitFor(async () => {
|
|
123
|
-
const prev = carousel.querySelector('kemet-carousel-prev').shadowRoot.querySelector('button');
|
|
124
|
-
await userEvent.click(prev);
|
|
125
|
-
prev.focus();
|
|
126
|
-
await userEvent.keyboard('[Enter]');
|
|
127
|
-
expect(carousel.index).toBe(0);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
it('handles navigation to the last slide', async () => {
|
|
131
|
-
render(templates.paginationBar, document.body);
|
|
132
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
133
|
-
await waitFor(async () => {
|
|
134
|
-
const last = carousel.querySelector('kemet-carousel-last').shadowRoot.querySelector('button');
|
|
135
|
-
await userEvent.click(last);
|
|
136
|
-
last.focus();
|
|
137
|
-
await userEvent.keyboard('[Enter]');
|
|
138
|
-
expect(carousel.index).toBe(2);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
it('handles navigation to the first slide', async () => {
|
|
142
|
-
render(templates.paginationBar, document.body);
|
|
143
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
144
|
-
carousel.index = 2;
|
|
145
|
-
await waitFor(async () => {
|
|
146
|
-
const first = carousel.querySelector('kemet-carousel-first').shadowRoot.querySelector('button');
|
|
147
|
-
await userEvent.click(first);
|
|
148
|
-
first.focus();
|
|
149
|
-
await userEvent.keyboard('[Enter]');
|
|
150
|
-
expect(carousel.index).toBe(0);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
it('handles navigation a specific slide', async () => {
|
|
154
|
-
render(templates.paginationBar, document.body);
|
|
155
|
-
const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');
|
|
156
|
-
carousel.index = 2;
|
|
157
|
-
await waitFor(async () => {
|
|
158
|
-
const links = carousel.querySelectorAll('kemet-carousel-link');
|
|
159
|
-
const second = links[1].shadowRoot.querySelector('button');
|
|
160
|
-
await userEvent.click(second);
|
|
161
|
-
second.focus();
|
|
162
|
-
await userEvent.keyboard('[Enter]');
|
|
163
|
-
expect(carousel.index).toBe(1);
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
//# sourceMappingURL=spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,kBAAkB,CAAC;AAC1B,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAElC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,SAAS,GAAG;QAChB,OAAO,EAAE,IAAI,CAAA;;;;;;KAMZ;QACD,cAAc,EAAE,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BnB;QACD,aAAa,EAAE,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+ClB;KACF,CAAC;IAEF,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS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CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, render } from 'lit';\nimport { expect } from '@wdio/globals';\nimport { getByText, waitFor } from '@testing-library/dom';\nimport userEvent from '@testing-library/user-event';\n\nimport './kemet-carousel';\nimport './kemet-carousel-slide';\nimport './kemet-carousel-current';\nimport './kemet-carousel-total';\nimport './kemet-carousel-next';\nimport './kemet-carousel-prev';\nimport './kemet-carousel-first';\nimport './kemet-carousel-last';\nimport './kemet-carousel-link';\nimport '../kemet-icon/kemet-icon';\n\ndescribe('Carousel', () => {\n const templates = {\n default: html`\n <kemet-carousel>\n <kemet-carousel-slide slot=\"slides\">Slide 1</kemet-carousel-slide>\n <kemet-carousel-slide slot=\"slides\">Slide 2</kemet-carousel-slide>\n <kemet-carousel-slide slot=\"slides\">Slide 3</kemet-carousel-slide>\n </kemet-carousel>\n `,\n descriptionBar: html`\n <kemet-carousel>\n <kemet-carousel-slide slot=\"slides\">Slide 1</kemet-carousel-slide>\n <kemet-carousel-slide slot=\"slides\">Slide 2</kemet-carousel-slide>\n <kemet-carousel-slide slot=\"slides\">Slide 3</kemet-carousel-slide>\n <div slot=\"toolbar\">\n <div>\n <kemet-carousel-current></kemet-carousel-current>\n of \n <kemet-carousel-total></kemet-carousel-total>\n : \n <kemet-carousel-information>\n <span slot=\"information\"><a href=\"https://google.com\" target=\"_blank\">Title</a>. An image of slide 1.</span>\n </kemet-carousel-information>\n </div>\n <kemet-carousel-prev>\n <kemet-badge circle>\n <kemet-icon icon=\"chevron-left\"></kemet-icon>\n </kemet-badge>\n </kemet-carousel-prev>\n <kemet-carousel-next>\n <kemet-badge circle>\n <kemet-icon icon=\"chevron-right\"></kemet-icon>\n </kemet-badge>\n </kemet-carousel-next>\n </div>\n </kemet-carousel>\n `,\n paginationBar: html`\n <kemet-carousel>\n <kemet-carousel-slide slot=\"slides\" selected>\n <figure>\n <h3>Slide 1</h3>\n <img src=\"https://via.placeholder.com/1920x1080\" alt=\"a placeholder\" />\n <figcaption>An image in a carousel.</figcaption>\n </figure>\n <span slot=\"information\"><a href=\"https://google.com\" target=\"_blank\">Title</a>. An image of slide 1. </span>\n </kemet-carousel-slide>\n\n <kemet-carousel-slide slot=\"slides\" selected>\n <figure>\n <h3>Slide 2</h3>\n <img src=\"https://via.placeholder.com/1920x1080\" alt=\"a placeholder\" />\n <figcaption>An image in a carousel.</figcaption>\n </figure>\n <span slot=\"information\"><a href=\"https://google.com\" target=\"_blank\">Title</a>. An image of slide 2. </span>\n </kemet-carousel-slide>\n\n <kemet-carousel-slide slot=\"slides\" selected>\n <figure>\n <h3>Slide 3</h3>\n <img src=\"https://via.placeholder.com/1920x1080\" alt=\"a placeholder\" />\n <figcaption>An image in a carousel.</figcaption>\n </figure>\n <span slot=\"information\"><a href=\"https://google.com\" target=\"_blank\">Title</a>. An image of slide 3.</span>\n </kemet-carousel-slide>\n\n <kemet-carousel-first slot=\"toolbar\">\n <kemet-icon icon=\"chevron-double-left\"></kemet-icon>\n </kemet-carousel-first>\n <kemet-carousel-prev slot=\"toolbar\">\n <kemet-icon icon=\"chevron-left\"></kemet-icon>\n </kemet-carousel-prev>\n\n <kemet-carousel-link slot=\"toolbar\" slide=\"0\">1</kemet-carousel-link>\n <kemet-carousel-link slot=\"toolbar\" slide=\"1\">2</kemet-carousel-link>\n <kemet-carousel-link slot=\"toolbar\" slide=\"2\">3</kemet-carousel-link>\n\n <kemet-carousel-next slot=\"toolbar\">\n <kemet-icon icon=\"chevron-right\"></kemet-icon>\n </kemet-carousel-next>\n <kemet-carousel-last slot=\"toolbar\">\n <kemet-icon icon=\"chevron-double-right\"></kemet-icon>\n </kemet-carousel-last>\n </kemet-carousel>\n `,\n };\n\n it('displays a carousel', async () => {\n render(templates.descriptionBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n expect(carousel).toBeTruthy();\n });\n\n describe('Navigation', () => {\n it('handles navigation to the next slide', async () => {\n render(templates.paginationBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n\n await waitFor(async () => {\n const next = carousel.querySelector('kemet-carousel-next').shadowRoot.querySelector('button');\n await userEvent.click(next);\n next.focus();\n await userEvent.keyboard('[Enter]');\n expect(carousel.index).toBe(2);\n });\n });\n\n it('handles navigation to the previous slide', async () => {\n render(templates.paginationBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n carousel.index = 2;\n\n await waitFor(async () => {\n const prev = carousel.querySelector('kemet-carousel-prev').shadowRoot.querySelector('button');\n await userEvent.click(prev);\n prev.focus();\n await userEvent.keyboard('[Enter]');\n expect(carousel.index).toBe(0);\n });\n });\n\n it('handles navigation to the last slide', async () => {\n render(templates.paginationBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n\n await waitFor(async () => {\n const last = carousel.querySelector('kemet-carousel-last').shadowRoot.querySelector('button');\n await userEvent.click(last);\n last.focus();\n await userEvent.keyboard('[Enter]');\n expect(carousel.index).toBe(2);\n });\n });\n\n it('handles navigation to the first slide', async () => {\n render(templates.paginationBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n carousel.index = 2;\n\n await waitFor(async () => {\n const first = carousel.querySelector('kemet-carousel-first').shadowRoot.querySelector('button');\n await userEvent.click(first);\n first.focus();\n await userEvent.keyboard('[Enter]');\n expect(carousel.index).toBe(0);\n });\n });\n\n it('handles navigation a specific slide', async () => {\n render(templates.paginationBar, document.body);\n const carousel = getByText(document.body, 'Slide 1').closest('kemet-carousel');\n carousel.index = 2;\n\n await waitFor(async () => {\n const links = carousel.querySelectorAll('kemet-carousel-link');\n const second = links[1].shadowRoot.querySelector('button');\n await userEvent.click(second);\n second.focus();\n await userEvent.keyboard('[Enter]');\n expect(carousel.index).toBe(1);\n });\n });\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const stylesCarousel: import("lit").CSSResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EhC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const stylesCarousel = css`\n :host,\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host {\n --kemet-carousel-width: 100%;\n --kemet-carousel-height: auto;\n --kemet-carousel-toolbar-gap: 1rem;\n --kemet-carousel-toolbar-justify-content: center;\n --kemet-carousel-toolbar-padding: 1rem;\n --kemet-carousel-toolbar-inner-width: 100%;\n --kemet-carousel-toolbar-inner-bottom: 0;\n --kemet-carousel-toolbar-inner-top: auto;\n --kemet-carousel-toolbar-inner-color: rgb(var(--kemet-color-white));\n --kemet-carousel-toolbar-inner-background-color: rgb(var(--kemet-color-black) / 40%);\n --kemet-carousel-slides-border: 1px solid rgb(var(--kemet-color-gray-50));\n --kemet-carousel-transition-speed: 300ms;\n --kemet-carousel-arrows-opacity: 0.25;\n --kemet-carousel-arrows-transition-speed: 300ms;\n --kemet-carousel-arrows-opacity-hover: 1;\n\n position: relative;\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n align-items: center;\n width: var(--kemet-carousel-width);\n height: var(--kemet-carousel-height);\n overflow: visible;\n }\n\n :host([arrows]) {\n grid-template-columns: auto minmax(0, 1fr) auto;\n }\n\n .toolbar {\n display: flex;\n gap: var(--kemet-carousel-toolbar-gap);\n align-items: center;\n justify-content: var(--kemet-carousel-toolbar-justify-content);\n line-height: 1;\n padding: var(--kemet-carousel-toolbar-padding);\n }\n\n :host([inner]) .toolbar {\n width: var(--kemet-carousel-toolbar-inner-width);\n position: absolute;\n bottom: var(--kemet-carousel-toolbar-inner-bottom);\n top: var(--kemet-carousel-toolbar-inner-top);\n color: var(--kemet-carousel-toolbar-inner-color);\n background-color: var(--kemet-carousel-toolbar-inner-background-color);\n }\n\n .slides {\n overflow: hidden;\n position: relative;\n padding: 1rem 0;\n border: var(--kemet-carousel-slides-border);\n }\n\n .slider {\n display: flex;\n flex-wrap: nowrap;\n transition: transform var(--kemet-carousel-transition-speed) ease;\n }\n\n ::slotted([slot='next']),\n ::slotted([slot='prev']) {\n opacity: var(--kemet-carousel-arrows-opacity);\n transition: opacity var(--kemet-carousel-arrows-transition-speed) ease-in-out;\n }\n\n :host(:hover) ::slotted([slot='next']),\n :host(:hover) ::slotted([slot='prev']) {\n opacity: var(--kemet-carousel-arrows-opacity-hover);\n }\n`;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
-
import '../kemet-checkbox';
|
|
3
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
4
|
-
import '../../kemet-tabs/kemet-tab';
|
|
5
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
6
|
-
declare const meta: Meta;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj;
|
|
9
|
-
export declare const Standard: Story;
|
|
10
|
-
export declare const Indeterminate: Story;
|
|
11
|
-
export declare const Disabled: Story;
|
|
12
|
-
export declare const Rounded: Story;
|
|
13
|
-
export declare const Filled: Story;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../kemet-checkbox';
|
|
3
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
4
|
-
import '../../kemet-tabs/kemet-tab';
|
|
5
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Components / Checkbox',
|
|
8
|
-
component: 'kemet-checkbox',
|
|
9
|
-
args: {
|
|
10
|
-
label: 'Label',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
const Template = (args) => html `
|
|
15
|
-
<kemet-checkbox label=${args.label} ?checked=${args.checked} ?indeterminate=${args.indeterminate} ?disabled=${args.disabled} ?rounded=${args.rounded} ?filled=${args.filled}></kemet-checkbox>
|
|
16
|
-
`;
|
|
17
|
-
export const Standard = {
|
|
18
|
-
render: args => Template(args),
|
|
19
|
-
};
|
|
20
|
-
export const Indeterminate = {
|
|
21
|
-
render: args => Template(args),
|
|
22
|
-
args: {
|
|
23
|
-
indeterminate: true,
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export const Disabled = {
|
|
27
|
-
render: args => Template(args),
|
|
28
|
-
args: {
|
|
29
|
-
disabled: true,
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export const Rounded = {
|
|
33
|
-
render: args => Template(args),
|
|
34
|
-
args: {
|
|
35
|
-
rounded: true,
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export const Filled = {
|
|
39
|
-
render: args => Template(args),
|
|
40
|
-
args: {
|
|
41
|
-
checked: true,
|
|
42
|
-
filled: true,
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../../src/components/kemet-checkbox/docs/stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,mBAAmB,CAAC;AAE3B,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;KACf;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;0BACL,IAAI,CAAC,KAAK,aAAa,IAAI,CAAC,OAAO,mBAAmB,IAAI,CAAC,aAAa,cAAc,IAAI,CAAC,QAAQ,aAAa,IAAI,CAAC,OAAO,YAAY,IAAI,CAAC,MAAM;CAC5K,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,IAAI,EAAE;QACJ,aAAa,EAAE,IAAI;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,IAAI,EAAE;QACJ,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;KACd;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAU;IAC3B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;CACF,CAAC","sourcesContent":["import { html } from 'lit';\nimport type { Meta, StoryObj } from '@storybook/web-components';\n\nimport '../kemet-checkbox';\n\nimport '../../kemet-tabs/kemet-tabs';\nimport '../../kemet-tabs/kemet-tab';\nimport '../../kemet-tabs/kemet-tab-panel';\n\nconst meta: Meta = {\n title: 'Components / Checkbox',\n component: 'kemet-checkbox',\n args: {\n label: 'Label',\n },\n};\nexport default meta;\n\ntype Story = StoryObj;\n\nconst Template = (args) => html`\n <kemet-checkbox label=${args.label} ?checked=${args.checked} ?indeterminate=${args.indeterminate} ?disabled=${args.disabled} ?rounded=${args.rounded} ?filled=${args.filled}></kemet-checkbox>\n`;\n\nexport const Standard: Story = {\n render: args => Template(args),\n};\n\nexport const Indeterminate: Story = {\n render: args => Template(args),\n args: {\n indeterminate: true,\n }\n};\n\nexport const Disabled: Story = {\n render: args => Template(args),\n args: {\n disabled: true,\n }\n};\n\nexport const Rounded: Story = {\n render: args => Template(args),\n args: {\n rounded: true,\n }\n};\n\nexport const Filled: Story = {\n render: args => Template(args),\n args: {\n checked: true,\n filled: true,\n }\n};\n"]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { FormSubmitController } from '../../utilities/controllers/forms';
|
|
3
|
-
import { TypeStatus } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* @since 1.0.0
|
|
6
|
-
* @status stable
|
|
7
|
-
*
|
|
8
|
-
* @tagname kemet-checkbox
|
|
9
|
-
* @summary An enhanced checkbox.
|
|
10
|
-
*
|
|
11
|
-
* @prop {string} label - Label text for the checkbox
|
|
12
|
-
* @prop {boolean} checked - Determines if the checkbox is selected
|
|
13
|
-
* @prop {boolean} indeterminate - An indeterminate selection status
|
|
14
|
-
* @prop {string} name - Name of the checkbox
|
|
15
|
-
* @prop {string} value - Value of the checkbox
|
|
16
|
-
* @prop {boolean} disabled - Determines if a checkbox is disabled
|
|
17
|
-
* @prop {boolean} required - Determines if a checkbox is required
|
|
18
|
-
* @prop {boolean} focused - Is true when the checkbox is focused
|
|
19
|
-
* @prop {boolean} rounded - Gives the checkbox rounded edges
|
|
20
|
-
* @prop {boolean} filled - Fills the checkbox with color
|
|
21
|
-
* @prop {string} status - The status of the checkbox
|
|
22
|
-
* @prop {string} message - Message associated with checkbox status
|
|
23
|
-
*
|
|
24
|
-
* @csspart label - The label element.
|
|
25
|
-
* @csspart text - The label's text.
|
|
26
|
-
* @csspart mark - The icon of the check mark.
|
|
27
|
-
*
|
|
28
|
-
* @cssproperty --kemet-checkbox-size - The width and height of the checkbox.
|
|
29
|
-
* @cssproperty --kemet-checkbox-color - The color of the checkbox mark.
|
|
30
|
-
* @cssproperty --kemet-checkbox-border - The border of the checkbox.
|
|
31
|
-
* @cssproperty --kemet-checkbox-border-radius - The border radius of the checkbox.
|
|
32
|
-
* @cssproperty --kemet-checkbox-filled-color - The filled color of the checkbox mark.
|
|
33
|
-
* @cssproperty --kemet-checkbox-filled-background-color - The filled background color.
|
|
34
|
-
*
|
|
35
|
-
* @event kemet-checkbox-change - Fires when the state of the checkbox changes
|
|
36
|
-
* @event kemet-checkbox-focused - Fires when the checkbox loses or receives focus
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
export default class KemetCheckbox extends LitElement {
|
|
40
|
-
/** @internal */
|
|
41
|
-
formSubmitController: FormSubmitController;
|
|
42
|
-
static styles: import("lit").CSSResult[];
|
|
43
|
-
label: string;
|
|
44
|
-
checked: boolean;
|
|
45
|
-
indeterminate: boolean;
|
|
46
|
-
name: string;
|
|
47
|
-
value: boolean;
|
|
48
|
-
disabled: boolean;
|
|
49
|
-
required: boolean;
|
|
50
|
-
focused: boolean;
|
|
51
|
-
rounded: boolean;
|
|
52
|
-
filled: boolean;
|
|
53
|
-
status: TypeStatus;
|
|
54
|
-
message: string;
|
|
55
|
-
input: HTMLInputElement;
|
|
56
|
-
constructor();
|
|
57
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
58
|
-
click(): void;
|
|
59
|
-
handleClick(): void;
|
|
60
|
-
handleBlur(): void;
|
|
61
|
-
handleFocus(): void;
|
|
62
|
-
handleChange(): void;
|
|
63
|
-
makeMessage(): import("lit-html").TemplateResult<1>;
|
|
64
|
-
makeCheckMark(): import("lit-html").TemplateResult<1>;
|
|
65
|
-
checkValidity(): boolean;
|
|
66
|
-
}
|
|
67
|
-
declare global {
|
|
68
|
-
interface HTMLElementTagNameMap {
|
|
69
|
-
'kemet-checkbox': KemetCheckbox;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
-
import { live } from 'lit/directives/live.js';
|
|
6
|
-
import { FormSubmitController } from '../../utilities/controllers/forms';
|
|
7
|
-
import { emitEvent } from '../../utilities/misc/events';
|
|
8
|
-
import { stylesBase } from './styles';
|
|
9
|
-
/**
|
|
10
|
-
* @since 1.0.0
|
|
11
|
-
* @status stable
|
|
12
|
-
*
|
|
13
|
-
* @tagname kemet-checkbox
|
|
14
|
-
* @summary An enhanced checkbox.
|
|
15
|
-
*
|
|
16
|
-
* @prop {string} label - Label text for the checkbox
|
|
17
|
-
* @prop {boolean} checked - Determines if the checkbox is selected
|
|
18
|
-
* @prop {boolean} indeterminate - An indeterminate selection status
|
|
19
|
-
* @prop {string} name - Name of the checkbox
|
|
20
|
-
* @prop {string} value - Value of the checkbox
|
|
21
|
-
* @prop {boolean} disabled - Determines if a checkbox is disabled
|
|
22
|
-
* @prop {boolean} required - Determines if a checkbox is required
|
|
23
|
-
* @prop {boolean} focused - Is true when the checkbox is focused
|
|
24
|
-
* @prop {boolean} rounded - Gives the checkbox rounded edges
|
|
25
|
-
* @prop {boolean} filled - Fills the checkbox with color
|
|
26
|
-
* @prop {string} status - The status of the checkbox
|
|
27
|
-
* @prop {string} message - Message associated with checkbox status
|
|
28
|
-
*
|
|
29
|
-
* @csspart label - The label element.
|
|
30
|
-
* @csspart text - The label's text.
|
|
31
|
-
* @csspart mark - The icon of the check mark.
|
|
32
|
-
*
|
|
33
|
-
* @cssproperty --kemet-checkbox-size - The width and height of the checkbox.
|
|
34
|
-
* @cssproperty --kemet-checkbox-color - The color of the checkbox mark.
|
|
35
|
-
* @cssproperty --kemet-checkbox-border - The border of the checkbox.
|
|
36
|
-
* @cssproperty --kemet-checkbox-border-radius - The border radius of the checkbox.
|
|
37
|
-
* @cssproperty --kemet-checkbox-filled-color - The filled color of the checkbox mark.
|
|
38
|
-
* @cssproperty --kemet-checkbox-filled-background-color - The filled background color.
|
|
39
|
-
*
|
|
40
|
-
* @event kemet-checkbox-change - Fires when the state of the checkbox changes
|
|
41
|
-
* @event kemet-checkbox-focused - Fires when the checkbox loses or receives focus
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
let KemetCheckbox = class KemetCheckbox extends LitElement {
|
|
45
|
-
constructor() {
|
|
46
|
-
super();
|
|
47
|
-
this.label = '';
|
|
48
|
-
this.name = 'checkbox';
|
|
49
|
-
this.disabled = false;
|
|
50
|
-
this.required = false;
|
|
51
|
-
this.rounded = false;
|
|
52
|
-
this.filled = false;
|
|
53
|
-
this.status = 'standard';
|
|
54
|
-
/** @internal */
|
|
55
|
-
this.formSubmitController = new FormSubmitController(this);
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
return html `
|
|
59
|
-
<label part="label">
|
|
60
|
-
<input
|
|
61
|
-
type="checkbox"
|
|
62
|
-
name=${ifDefined(this.name)}
|
|
63
|
-
.value=${this.value}
|
|
64
|
-
.indeterminate=${live(this.indeterminate)}
|
|
65
|
-
.checked=${live(this.checked)}
|
|
66
|
-
.disabled=${this.disabled}
|
|
67
|
-
.required=${this.required}
|
|
68
|
-
aria-checked=${this.checked ? 'true' : 'false'}
|
|
69
|
-
@click=${() => this.handleClick()}
|
|
70
|
-
@blur=${() => this.handleBlur()}
|
|
71
|
-
@focus=${() => this.handleFocus()}
|
|
72
|
-
@change=${() => this.handleChange()}
|
|
73
|
-
/>
|
|
74
|
-
<button part="checkbox" aria-label=${this.label}>
|
|
75
|
-
${this.makeCheckMark()}
|
|
76
|
-
</button>
|
|
77
|
-
<span part="text">${this.label}</span>
|
|
78
|
-
</label>
|
|
79
|
-
${this.makeMessage()}
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
click() {
|
|
83
|
-
this.input.click();
|
|
84
|
-
}
|
|
85
|
-
handleClick() {
|
|
86
|
-
this.checked = !this.checked;
|
|
87
|
-
this.indeterminate = false;
|
|
88
|
-
emitEvent(this, 'kemet-checkbox-change', this);
|
|
89
|
-
}
|
|
90
|
-
handleBlur() {
|
|
91
|
-
this.focused = false;
|
|
92
|
-
emitEvent(this, 'kemet-checkbox-focused', false);
|
|
93
|
-
}
|
|
94
|
-
handleFocus() {
|
|
95
|
-
this.focused = true;
|
|
96
|
-
emitEvent(this, 'kemet-checkbox-focused', true);
|
|
97
|
-
}
|
|
98
|
-
handleChange() {
|
|
99
|
-
this.value = this.checked;
|
|
100
|
-
if (this.input.checkValidity()) {
|
|
101
|
-
this.status = 'standard';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
makeMessage() {
|
|
105
|
-
if (this.status === 'error' || this.status === 'warning') {
|
|
106
|
-
return html `<span part="message">${this.message}</span>`;
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
makeCheckMark() {
|
|
111
|
-
if (this.checked) {
|
|
112
|
-
return html `
|
|
113
|
-
<span part="mark">
|
|
114
|
-
<svg viewBox="0 0 16 16">
|
|
115
|
-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
|
116
|
-
<g stroke="currentColor" stroke-width="2">
|
|
117
|
-
<g transform="translate(3.428571, 3.428571)">
|
|
118
|
-
<path d="M0,5.71428571 L3.42857143,9.14285714"></path>
|
|
119
|
-
<path d="M9.14285714,0 L3.42857143,9.14285714"></path>
|
|
120
|
-
</g>
|
|
121
|
-
</g>
|
|
122
|
-
</g>
|
|
123
|
-
</svg>
|
|
124
|
-
</span>
|
|
125
|
-
`;
|
|
126
|
-
}
|
|
127
|
-
if (!this.checked && this.indeterminate) {
|
|
128
|
-
return html `
|
|
129
|
-
<span part="mark">
|
|
130
|
-
<svg viewBox="0 0 16 16">
|
|
131
|
-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
|
132
|
-
<g stroke="currentColor" stroke-width="2">
|
|
133
|
-
<g transform="translate(2.285714, 6.857143)">
|
|
134
|
-
<path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>
|
|
135
|
-
</g>
|
|
136
|
-
</g>
|
|
137
|
-
</g>
|
|
138
|
-
</svg>
|
|
139
|
-
</span>
|
|
140
|
-
`;
|
|
141
|
-
}
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
checkValidity() {
|
|
145
|
-
return this.input.checkValidity();
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
KemetCheckbox.styles = [stylesBase];
|
|
149
|
-
__decorate([
|
|
150
|
-
property({ type: String })
|
|
151
|
-
], KemetCheckbox.prototype, "label", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
property({ type: Boolean, reflect: true })
|
|
154
|
-
], KemetCheckbox.prototype, "checked", void 0);
|
|
155
|
-
__decorate([
|
|
156
|
-
property({ type: Boolean, reflect: true })
|
|
157
|
-
], KemetCheckbox.prototype, "indeterminate", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
property({ type: String })
|
|
160
|
-
], KemetCheckbox.prototype, "name", void 0);
|
|
161
|
-
__decorate([
|
|
162
|
-
property({ type: Boolean })
|
|
163
|
-
], KemetCheckbox.prototype, "value", void 0);
|
|
164
|
-
__decorate([
|
|
165
|
-
property({ type: Boolean, reflect: true })
|
|
166
|
-
], KemetCheckbox.prototype, "disabled", void 0);
|
|
167
|
-
__decorate([
|
|
168
|
-
property({ type: Boolean, reflect: true })
|
|
169
|
-
], KemetCheckbox.prototype, "required", void 0);
|
|
170
|
-
__decorate([
|
|
171
|
-
property({ type: Boolean, reflect: true })
|
|
172
|
-
], KemetCheckbox.prototype, "focused", void 0);
|
|
173
|
-
__decorate([
|
|
174
|
-
property({ type: Boolean, reflect: true })
|
|
175
|
-
], KemetCheckbox.prototype, "rounded", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
property({ type: Boolean, reflect: true })
|
|
178
|
-
], KemetCheckbox.prototype, "filled", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
property({ type: String, reflect: true })
|
|
181
|
-
], KemetCheckbox.prototype, "status", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
property({ type: String })
|
|
184
|
-
], KemetCheckbox.prototype, "message", void 0);
|
|
185
|
-
__decorate([
|
|
186
|
-
query('input')
|
|
187
|
-
], KemetCheckbox.prototype, "input", void 0);
|
|
188
|
-
KemetCheckbox = __decorate([
|
|
189
|
-
customElement('kemet-checkbox')
|
|
190
|
-
], KemetCheckbox);
|
|
191
|
-
export default KemetCheckbox;
|
|
192
|
-
//# sourceMappingURL=kemet-checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-checkbox.js","sourceRoot":"","sources":["../../../src/components/kemet-checkbox/kemet-checkbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGY,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IA6CnD;QACE,KAAK,EAAE,CAAC;QAvCV,UAAK,GAAW,EAAE,CAAC;QASnB,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,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDACpB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACD;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAClB;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACV;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACX;AAGhB;IADC,KAAK,CAAC,OAAO,CAAC;4CACS;AA3CL,aAAa;IADjC,aAAa,CAAC,gBAAgB,CAAC;GACX,aAAa,CA0JjC;eA1JoB,aAAa","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { FormSubmitController } from '../../utilities/controllers/forms';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { stylesBase } from './styles';\nimport { TypeStatus } from './types';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-checkbox\n * @summary An enhanced checkbox.\n *\n * @prop {string} label - Label text for the checkbox\n * @prop {boolean} checked - Determines if the checkbox is selected\n * @prop {boolean} indeterminate - An indeterminate selection status\n * @prop {string} name - Name of the checkbox\n * @prop {string} value - Value of the checkbox\n * @prop {boolean} disabled - Determines if a checkbox is disabled\n * @prop {boolean} required - Determines if a checkbox is required\n * @prop {boolean} focused - Is true when the checkbox is focused\n * @prop {boolean} rounded - Gives the checkbox rounded edges\n * @prop {boolean} filled - Fills the checkbox with color\n * @prop {string} status - The status of the checkbox\n * @prop {string} message - Message associated with checkbox status\n *\n * @csspart label - The label element.\n * @csspart text - The label's text.\n * @csspart mark - The icon of the check mark.\n *\n * @cssproperty --kemet-checkbox-size - The width and height of the checkbox.\n * @cssproperty --kemet-checkbox-color - The color of the checkbox mark.\n * @cssproperty --kemet-checkbox-border - The border of the checkbox.\n * @cssproperty --kemet-checkbox-border-radius - The border radius of the checkbox.\n * @cssproperty --kemet-checkbox-filled-color - The filled color of the checkbox mark.\n * @cssproperty --kemet-checkbox-filled-background-color - The filled background color.\n *\n * @event kemet-checkbox-change - Fires when the state of the checkbox changes\n * @event kemet-checkbox-focused - Fires when the checkbox loses or receives focus\n *\n */\n\n@customElement('kemet-checkbox')\nexport default class KemetCheckbox extends LitElement {\n /** @internal */\n formSubmitController: FormSubmitController;\n\n static styles = [stylesBase];\n\n @property({ type: String })\n label: string = '';\n\n @property({ type: Boolean, reflect: true })\n checked: boolean;\n\n @property({ type: Boolean, reflect: true })\n indeterminate: boolean;\n\n @property({ type: String })\n name: string = 'checkbox';\n\n @property({ type: Boolean })\n value: boolean;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n required: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n focused: boolean;\n\n @property({ type: Boolean, reflect: true })\n rounded: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n filled: boolean = false;\n\n @property({ type: String, reflect: true })\n status: TypeStatus = 'standard';\n\n @property({ type: String })\n message: string;\n\n @query('input')\n input: HTMLInputElement;\n\n constructor() {\n super();\n\n /** @internal */\n this.formSubmitController = new FormSubmitController(this);\n }\n\n render() {\n return html`\n <label part=\"label\">\n <input\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .indeterminate=${live(this.indeterminate)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n aria-checked=${this.checked ? 'true' : 'false'}\n @click=${() => this.handleClick()}\n @blur=${() => this.handleBlur()}\n @focus=${() => this.handleFocus()}\n @change=${() => this.handleChange()}\n />\n <button part=\"checkbox\" aria-label=${this.label}>\n ${this.makeCheckMark()}\n </button>\n <span part=\"text\">${this.label}</span>\n </label>\n ${this.makeMessage()}\n `;\n }\n\n click() {\n this.input.click();\n }\n\n handleClick() {\n this.checked = !this.checked;\n this.indeterminate = false;\n emitEvent(this, 'kemet-checkbox-change', this);\n }\n\n handleBlur() {\n this.focused = false;\n emitEvent(this, 'kemet-checkbox-focused', false);\n }\n\n handleFocus() {\n this.focused = true;\n emitEvent(this, 'kemet-checkbox-focused', true);\n }\n\n handleChange() {\n this.value = this.checked;\n\n if (this.input.checkValidity()) {\n this.status = 'standard';\n }\n }\n\n makeMessage() {\n if (this.status === 'error' || this.status === 'warning') {\n return html`<span part=\"message\">${this.message}</span>`;\n }\n\n return null;\n }\n\n makeCheckMark() {\n if (this.checked) {\n return html`\n <span part=\"mark\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(3.428571, 3.428571)\">\n <path d=\"M0,5.71428571 L3.42857143,9.14285714\"></path>\n <path d=\"M9.14285714,0 L3.42857143,9.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n `;\n }\n\n if (!this.checked && this.indeterminate) {\n return html`\n <span part=\"mark\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(2.285714, 6.857143)\">\n <path d=\"M10.2857143,1.14285714 L1.14285714,1.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n `;\n }\n\n return null;\n }\n\n checkValidity() {\n return this.input.checkValidity();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-checkbox': KemetCheckbox\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './kemet-checkbox';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { html, render } from 'lit';
|
|
2
|
-
import { expect } from '@wdio/globals';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { fireEvent, waitFor } from '@testing-library/dom';
|
|
5
|
-
import './kemet-checkbox';
|
|
6
|
-
describe('Checkbox', () => {
|
|
7
|
-
const templates = {
|
|
8
|
-
default: html `<kemet-checkbox label="Label"></kemet-checkbox>`,
|
|
9
|
-
error: html `<kemet-checkbox label="Label" status="error" indeterminate message="Message"></kemet-checkbox>`,
|
|
10
|
-
};
|
|
11
|
-
it('should check the box when clicked', async () => {
|
|
12
|
-
render(templates.default, document.body);
|
|
13
|
-
const checkbox = document.querySelector('kemet-checkbox');
|
|
14
|
-
await waitFor(async () => {
|
|
15
|
-
const label = checkbox.shadowRoot.querySelector('label');
|
|
16
|
-
const input = checkbox.shadowRoot.querySelector('input');
|
|
17
|
-
await userEvent.click(label);
|
|
18
|
-
expect(checkbox.checked).toBe(true);
|
|
19
|
-
fireEvent.blur(input);
|
|
20
|
-
checkbox.checkValidity();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
it('should check the box when click method is called', async () => {
|
|
24
|
-
render(templates.default, document.body);
|
|
25
|
-
const checkbox = document.querySelector('kemet-checkbox');
|
|
26
|
-
checkbox.click();
|
|
27
|
-
expect(checkbox.checked).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
it('should check the box when click method is called', async () => {
|
|
30
|
-
render(templates.error, document.body);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/components/kemet-checkbox/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,SAAS,GAAG;QAChB,OAAO,EAAE,IAAI,CAAA,iDAAiD;QAC9D,KAAK,EAAE,IAAI,CAAA,gGAAgG;KAC5G,CAAC;IAEF,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAE1D,MAAM,OAAO,CAAC,KAAK,IAAI,EAAE;YACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACzD,MAAM,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAC1D,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, render } from 'lit';\nimport { expect } from '@wdio/globals';\nimport userEvent from '@testing-library/user-event';\nimport { fireEvent, waitFor } from '@testing-library/dom';\n\nimport './kemet-checkbox';\n\ndescribe('Checkbox', () => {\n const templates = {\n default: html`<kemet-checkbox label=\"Label\"></kemet-checkbox>`,\n error: html`<kemet-checkbox label=\"Label\" status=\"error\" indeterminate message=\"Message\"></kemet-checkbox>`,\n };\n\n it('should check the box when clicked', async () => {\n render(templates.default, document.body);\n const checkbox = document.querySelector('kemet-checkbox');\n\n await waitFor(async () => {\n const label = checkbox.shadowRoot.querySelector('label');\n const input = checkbox.shadowRoot.querySelector('input');\n await userEvent.click(label);\n expect(checkbox.checked).toBe(true);\n fireEvent.blur(input);\n checkbox.checkValidity();\n });\n });\n\n it('should check the box when click method is called', async () => {\n render(templates.default, document.body);\n const checkbox = document.querySelector('kemet-checkbox');\n checkbox.click();\n expect(checkbox.checked).toBe(false);\n });\n\n it('should check the box when click method is called', async () => {\n render(templates.error, document.body);\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const stylesBase: import("lit").CSSResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/kemet-checkbox/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuF5B,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const stylesBase = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host {\n --kemet-checkbox-size: 18px;\n --kemet-checkbox-color: rgb(var(--kemet-color-foreground));\n --kemet-checkbox-border: 1px solid rgb(var(--kemet-color-foreground));\n --kemet-checkbox-border-radius: var(--kemet-border-radius-md);\n --kemet-checkbox-filled-background-color: rgb(var(--kemet-color-primary));\n --kemet-checkbox-filled-color: rgb(var(--kemet-color-white));\n\n display: inline-block;\n }\n\n :host([disabled]) {\n opacity: 0.5;\n }\n\n label {\n display: inline-flex;\n gap: 0.5rem;\n align-items: center;\n }\n\n input {\n cursor: pointer;\n margin: 0;\n padding: 0;\n width: var(--kemet-checkbox-size);\n height: var(--kemet-checkbox-size);\n position: absolute;\n opacity: 0;\n }\n\n button {\n margin: 0;\n border: none;\n background: none;\n }\n\n [part='checkbox'] {\n color: var(--kemet-checkbox-color);\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kemet-checkbox-size);\n height: var(--kemet-checkbox-size);\n border: var(--kemet-checkbox-border);\n }\n\n :host([rounded]) [part='checkbox'] {\n border-radius: var(--kemet-checkbox-border-radius);\n }\n\n :host([filled][checked]) [part='checkbox'],\n :host([filled][indeterminate]) [part='checkbox'] {\n border: none;\n background-color: var(--kemet-checkbox-filled-background-color);\n }\n\n [part='mark'] {\n display: flex;\n width: calc(var(--kemet-checkbox-size) - 4px);\n height: calc(var(--kemet-checkbox-size) - 4px);\n }\n\n :host([filled][checked]) [part='mark'],\n :host([filled][indeterminate]) [part='mark'] {\n color: var(--kemet-checkbox-filled-color);\n }\n\n [part='message'] {\n display: block;\n margin-top: 0.5rem;\n }\n\n :host([status='error']) [part='message'] {\n color: rgb(var(--kemet-color-error));\n }\n\n :host([status='warning']) [part='message'] {\n color: rgb(var(--kemet-color-error));\n }\n`;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type TypeStatus = 'standard' | 'error' | 'success' | 'warning';
|
|
2
|
-
export interface KemetCheckboxInterface extends HTMLElement {
|
|
3
|
-
label?: string;
|
|
4
|
-
checked?: boolean;
|
|
5
|
-
indeterminate?: boolean;
|
|
6
|
-
name?: string;
|
|
7
|
-
value?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
focused?: boolean;
|
|
11
|
-
rounded?: boolean;
|
|
12
|
-
filled?: boolean;
|
|
13
|
-
status?: string;
|
|
14
|
-
message?: string;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/kemet-checkbox/types.ts"],"names":[],"mappings":"","sourcesContent":["export type TypeStatus = 'standard' | 'error' | 'success' | 'warning';\n\nexport interface KemetCheckboxInterface extends HTMLElement {\n label?: string,\n checked?: boolean,\n indeterminate?: boolean,\n name?: string,\n value?: string,\n disabled?: boolean,\n required?: boolean,\n focused?: boolean,\n rounded?: boolean,\n filled?: boolean,\n status?: string,\n message?: string,\n}\n"]}
|