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,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
-
import '../kemet-combo';
|
|
3
|
-
import '../../kemet-field/kemet-field';
|
|
4
|
-
import '../../kemet-input/kemet-input';
|
|
5
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
6
|
-
import '../../kemet-tabs/kemet-tab';
|
|
7
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
8
|
-
declare const meta: Meta;
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj;
|
|
11
|
-
export declare const Standard: Story;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../kemet-combo';
|
|
3
|
-
import '../../kemet-field/kemet-field';
|
|
4
|
-
import '../../kemet-input/kemet-input';
|
|
5
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
6
|
-
import '../../kemet-tabs/kemet-tab';
|
|
7
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Components / Combo',
|
|
10
|
-
component: 'kemet-combo',
|
|
11
|
-
args: {
|
|
12
|
-
options: [
|
|
13
|
-
'How do use Kemet UI?',
|
|
14
|
-
'What is a Blueprint System?',
|
|
15
|
-
'Are there going to be more components?',
|
|
16
|
-
'Is it good to use attribute for styles?',
|
|
17
|
-
'Does Kemet UI work with React?',
|
|
18
|
-
'Does Kemet UI work with Angular?',
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export default meta;
|
|
23
|
-
const Template = (args) => html `
|
|
24
|
-
<kemet-field slug="unique-identifier" label="Frequently asked questions." kemet-margin="xs">
|
|
25
|
-
<kemet-input slot="input" name="input" placeholder="Start typing to see the FAQs"></kemet-input>
|
|
26
|
-
<kemet-combo slot="component" .options=${args.options}></kemet-combo>
|
|
27
|
-
</kemet-field>
|
|
28
|
-
`;
|
|
29
|
-
export const Standard = {
|
|
30
|
-
render: (args) => Template(args),
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../../src/components/kemet-combo/docs/stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,gBAAgB,CAAC;AAExB,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,sBAAsB;YACtB,6BAA6B;YAC7B,wCAAwC;YACxC,yCAAyC;YACzC,gCAAgC;YAChC,kCAAkC;SACnC;KACF;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;;6CAGc,IAAI,CAAC,OAAO;;CAExD,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;CACjC,CAAC","sourcesContent":["import { html } from 'lit';\nimport type { Meta, StoryObj } from '@storybook/web-components';\n\nimport '../kemet-combo';\n\nimport '../../kemet-field/kemet-field';\nimport '../../kemet-input/kemet-input';\nimport '../../kemet-tabs/kemet-tabs';\nimport '../../kemet-tabs/kemet-tab';\nimport '../../kemet-tabs/kemet-tab-panel';\n\nconst meta: Meta = {\n title: 'Components / Combo',\n component: 'kemet-combo',\n args: {\n options: [\n 'How do use Kemet UI?',\n 'What is a Blueprint System?',\n 'Are there going to be more components?',\n 'Is it good to use attribute for styles?',\n 'Does Kemet UI work with React?',\n 'Does Kemet UI work with Angular?',\n ]\n }\n};\nexport default meta;\n\ntype Story = StoryObj;\n\nconst Template = (args) => html`\n <kemet-field slug=\"unique-identifier\" label=\"Frequently asked questions.\" kemet-margin=\"xs\">\n <kemet-input slot=\"input\" name=\"input\" placeholder=\"Start typing to see the FAQs\"></kemet-input>\n <kemet-combo slot=\"component\" .options=${args.options}></kemet-combo>\n </kemet-field>\n`;\n\nexport const Standard: Story = {\n render: (args) => Template(args),\n};\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import type KemetField from '../kemet-field/kemet-field';
|
|
3
|
-
/**
|
|
4
|
-
* @since 1.0.0
|
|
5
|
-
* @status stable
|
|
6
|
-
*
|
|
7
|
-
* @tagname kemet-combo
|
|
8
|
-
* @summary Allows the user to select a choice filtered through an Input. May only be used as a component of Field.
|
|
9
|
-
*
|
|
10
|
-
* @prop {string} slug - Uniquely identifies the component. Should match the slug used in a control.
|
|
11
|
-
* @prop {array} options - An array of items listed for the combo box
|
|
12
|
-
* @prop {boolean} show - Controls the display of the combo box
|
|
13
|
-
*
|
|
14
|
-
* @csspart combobox - The combo's container element.
|
|
15
|
-
* @csspart listbox - The list element in the combo.
|
|
16
|
-
*
|
|
17
|
-
* @cssproperty --kemet-combo-width - The width of the combo box.
|
|
18
|
-
* @cssproperty --kemet-combo-margin - The margins on the combo box.
|
|
19
|
-
* @cssproperty --kemet-combo-max-height - The max height of the combo box.
|
|
20
|
-
* @cssproperty --kemet-combo-border - The border of the combo box.
|
|
21
|
-
* @cssproperty --kemet-combo-border-radius - The border radius of the combo box.
|
|
22
|
-
* @cssproperty --kemet-combo-background-color - The background color of the combo box.
|
|
23
|
-
* @cssproperty --kemet-combo-shadow - The shadow of the combo box.
|
|
24
|
-
* @cssproperty --kemet-combo-hover-color - The hover item's text color.
|
|
25
|
-
* @cssproperty --kemet-combo-hover-background-color - The hover item's background color.
|
|
26
|
-
*
|
|
27
|
-
* @event kemet-combo-selection - Fires when a selection has been made
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export default class KemetCombo extends LitElement {
|
|
31
|
-
static styles: import("lit").CSSResult[];
|
|
32
|
-
slug: string;
|
|
33
|
-
options: string[];
|
|
34
|
-
show: boolean;
|
|
35
|
-
filteredOptions: string[];
|
|
36
|
-
field: KemetField;
|
|
37
|
-
input: HTMLInputElement;
|
|
38
|
-
firstUpdated(): void;
|
|
39
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
40
|
-
makeOptions(): import("lit-html").TemplateResult<1>[];
|
|
41
|
-
handleInput(event: CustomEvent): void;
|
|
42
|
-
handleFocus(): void;
|
|
43
|
-
handleSelection(event: KeyboardEvent): void;
|
|
44
|
-
handleOptionKeyDown(event: KeyboardEvent): void;
|
|
45
|
-
handleInputKeyDown(event: KeyboardEvent): void;
|
|
46
|
-
}
|
|
47
|
-
declare global {
|
|
48
|
-
interface HTMLElementTagNameMap {
|
|
49
|
-
'kemet-combo': KemetCombo;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
-
import { emitEvent } from '../../utilities/misc/events';
|
|
5
|
-
import { stylesBase } from './styles';
|
|
6
|
-
/**
|
|
7
|
-
* @since 1.0.0
|
|
8
|
-
* @status stable
|
|
9
|
-
*
|
|
10
|
-
* @tagname kemet-combo
|
|
11
|
-
* @summary Allows the user to select a choice filtered through an Input. May only be used as a component of Field.
|
|
12
|
-
*
|
|
13
|
-
* @prop {string} slug - Uniquely identifies the component. Should match the slug used in a control.
|
|
14
|
-
* @prop {array} options - An array of items listed for the combo box
|
|
15
|
-
* @prop {boolean} show - Controls the display of the combo box
|
|
16
|
-
*
|
|
17
|
-
* @csspart combobox - The combo's container element.
|
|
18
|
-
* @csspart listbox - The list element in the combo.
|
|
19
|
-
*
|
|
20
|
-
* @cssproperty --kemet-combo-width - The width of the combo box.
|
|
21
|
-
* @cssproperty --kemet-combo-margin - The margins on the combo box.
|
|
22
|
-
* @cssproperty --kemet-combo-max-height - The max height of the combo box.
|
|
23
|
-
* @cssproperty --kemet-combo-border - The border of the combo box.
|
|
24
|
-
* @cssproperty --kemet-combo-border-radius - The border radius of the combo box.
|
|
25
|
-
* @cssproperty --kemet-combo-background-color - The background color of the combo box.
|
|
26
|
-
* @cssproperty --kemet-combo-shadow - The shadow of the combo box.
|
|
27
|
-
* @cssproperty --kemet-combo-hover-color - The hover item's text color.
|
|
28
|
-
* @cssproperty --kemet-combo-hover-background-color - The hover item's background color.
|
|
29
|
-
*
|
|
30
|
-
* @event kemet-combo-selection - Fires when a selection has been made
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
let KemetCombo = class KemetCombo extends LitElement {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.options = [];
|
|
37
|
-
}
|
|
38
|
-
firstUpdated() {
|
|
39
|
-
// standard properties
|
|
40
|
-
this.field = this.closest('kemet-field');
|
|
41
|
-
this.input = this.field.querySelector('[slot="input"]');
|
|
42
|
-
// managed properties
|
|
43
|
-
this.slug = this.field.slug || 'slug';
|
|
44
|
-
// events listeners
|
|
45
|
-
this.input.addEventListener('kemet-input-input', this.handleInput.bind(this));
|
|
46
|
-
this.input.addEventListener('kemet-multi-input-focus', this.handleFocus.bind(this));
|
|
47
|
-
this.input.addEventListener('keydown', event => this.handleInputKeyDown(event));
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
var _a;
|
|
51
|
-
return html `
|
|
52
|
-
<div
|
|
53
|
-
role="combobox"
|
|
54
|
-
part="combobox"
|
|
55
|
-
aria-expanded=${this.show}
|
|
56
|
-
aria-controls="${this.slug}-listbox"
|
|
57
|
-
aria-haspopup="listbox"
|
|
58
|
-
id="${this.slug}-combobox"
|
|
59
|
-
aria-label="${(_a = this.field) === null || _a === void 0 ? void 0 : _a.label}"
|
|
60
|
-
>
|
|
61
|
-
<ul role="listbox" aria-labelledby="${this.slug}-label" id="${this.slug}-listbox" part="listbox">
|
|
62
|
-
${this.makeOptions()}
|
|
63
|
-
</ul>
|
|
64
|
-
</div>
|
|
65
|
-
`;
|
|
66
|
-
}
|
|
67
|
-
makeOptions() {
|
|
68
|
-
if (this.input) {
|
|
69
|
-
this.filteredOptions = this.options.filter(option => { var _a; return option.toLowerCase().indexOf((_a = this.input.value) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== -1; });
|
|
70
|
-
return this.filteredOptions.map((option, index) => html `<li
|
|
71
|
-
id="${this.slug}-option-${index}"
|
|
72
|
-
role="option"
|
|
73
|
-
tabindex="0"
|
|
74
|
-
aria-selected="false"
|
|
75
|
-
@click=${(event) => this.handleSelection(event)}
|
|
76
|
-
@keydown=${(event) => this.handleOptionKeyDown(event)}
|
|
77
|
-
>
|
|
78
|
-
${option}
|
|
79
|
-
</li>`);
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
handleInput(event) {
|
|
84
|
-
this.makeOptions();
|
|
85
|
-
this.show = event.detail.length > 0;
|
|
86
|
-
}
|
|
87
|
-
handleFocus() {
|
|
88
|
-
this.makeOptions();
|
|
89
|
-
this.show = true;
|
|
90
|
-
}
|
|
91
|
-
handleSelection(event) {
|
|
92
|
-
const target = event.target;
|
|
93
|
-
this.input.value = target.innerText;
|
|
94
|
-
this.show = false;
|
|
95
|
-
emitEvent(this, 'kemet-combo-selection', {
|
|
96
|
-
element: target,
|
|
97
|
-
text: target.innerText,
|
|
98
|
-
id: target.getAttribute('id'),
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
handleOptionKeyDown(event) {
|
|
102
|
-
event.preventDefault();
|
|
103
|
-
const target = event.target;
|
|
104
|
-
if (event.code === 'ArrowDown') {
|
|
105
|
-
const next = target.nextElementSibling;
|
|
106
|
-
if (next) {
|
|
107
|
-
next.focus();
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
this.shadowRoot.querySelector('li').focus();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (event.code === 'ArrowUp') {
|
|
114
|
-
const previous = target.previousElementSibling;
|
|
115
|
-
const lastChild = this.shadowRoot.querySelector('li:last-child');
|
|
116
|
-
if (previous) {
|
|
117
|
-
previous.focus();
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
lastChild.focus();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (event.code === 'Escape' || event.code === 'Tab') {
|
|
124
|
-
this.show = false;
|
|
125
|
-
this.input.focus();
|
|
126
|
-
}
|
|
127
|
-
if (event.code === 'Enter' || event.code === 'Space') {
|
|
128
|
-
this.handleSelection(event);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
handleInputKeyDown(event) {
|
|
132
|
-
if (event.code === 'ArrowDown') {
|
|
133
|
-
this.shadowRoot.querySelector('li').focus();
|
|
134
|
-
}
|
|
135
|
-
if (event.code === 'Escape') {
|
|
136
|
-
this.show = false;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
KemetCombo.styles = [stylesBase];
|
|
141
|
-
__decorate([
|
|
142
|
-
property({ type: String })
|
|
143
|
-
], KemetCombo.prototype, "slug", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
property({ type: Array })
|
|
146
|
-
], KemetCombo.prototype, "options", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
property({ type: Boolean, reflect: true })
|
|
149
|
-
], KemetCombo.prototype, "show", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
state()
|
|
152
|
-
], KemetCombo.prototype, "filteredOptions", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
state()
|
|
155
|
-
], KemetCombo.prototype, "field", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
state()
|
|
158
|
-
], KemetCombo.prototype, "input", void 0);
|
|
159
|
-
KemetCombo = __decorate([
|
|
160
|
-
customElement('kemet-combo')
|
|
161
|
-
], KemetCombo);
|
|
162
|
-
export default KemetCombo;
|
|
163
|
-
//# sourceMappingURL=kemet-combo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-combo.js","sourceRoot":"","sources":["../../../src/components/kemet-combo/kemet-combo.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,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGY,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAOb,YAAO,GAAa,EAAE,CAAC;IAuIzB,CAAC;IAzHC,YAAY;QACV,sBAAsB;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAExD,qBAAqB;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC;QAEtC,mBAAmB;QACnB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,yBAAyB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM;;QACJ,OAA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C;QACrB,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACrD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,kBAAkB,CAAC,KAAoB;QACrC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;QAC9C,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;;AA5IM,iBAAM,GAAG,CAAC,UAAU,CAAC,AAAf,CAAgB;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CACH;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC7B;AAGd;IADC,KAAK,EAAE;mDACkB;AAG1B;IADC,KAAK,EAAE;yCACU;AAGlB;IADC,KAAK,EAAE;yCACgB;AAnBL,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CA8I9B;eA9IoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { stylesBase } from './styles';\nimport type KemetField from '../kemet-field/kemet-field';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-combo\n * @summary Allows the user to select a choice filtered through an Input. May only be used as a component of Field.\n *\n * @prop {string} slug - Uniquely identifies the component. Should match the slug used in a control.\n * @prop {array} options - An array of items listed for the combo box\n * @prop {boolean} show - Controls the display of the combo box\n *\n * @csspart combobox - The combo's container element.\n * @csspart listbox - The list element in the combo.\n *\n * @cssproperty --kemet-combo-width - The width of the combo box.\n * @cssproperty --kemet-combo-margin - The margins on the combo box.\n * @cssproperty --kemet-combo-max-height - The max height of the combo box.\n * @cssproperty --kemet-combo-border - The border of the combo box.\n * @cssproperty --kemet-combo-border-radius - The border radius of the combo box.\n * @cssproperty --kemet-combo-background-color - The background color of the combo box.\n * @cssproperty --kemet-combo-shadow - The shadow of the combo box.\n * @cssproperty --kemet-combo-hover-color - The hover item's text color.\n * @cssproperty --kemet-combo-hover-background-color - The hover item's background color.\n *\n * @event kemet-combo-selection - Fires when a selection has been made\n *\n */\n\n@customElement('kemet-combo')\nexport default class KemetCombo extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: String })\n slug: string;\n\n @property({ type: Array })\n options: string[] = [];\n\n @property({ type: Boolean, reflect: true })\n show: boolean;\n\n @state()\n filteredOptions: string[];\n\n @state()\n field: KemetField;\n\n @state()\n input: HTMLInputElement;\n\n firstUpdated() {\n // standard properties\n this.field = this.closest('kemet-field');\n this.input = this.field.querySelector('[slot=\"input\"]');\n\n // managed properties\n this.slug = this.field.slug || 'slug';\n\n // events listeners\n this.input.addEventListener('kemet-input-input', this.handleInput.bind(this));\n this.input.addEventListener('kemet-multi-input-focus', this.handleFocus.bind(this));\n this.input.addEventListener('keydown', event => this.handleInputKeyDown(event));\n }\n\n render() {\n return html`\n <div\n role=\"combobox\"\n part=\"combobox\"\n aria-expanded=${this.show}\n aria-controls=\"${this.slug}-listbox\"\n aria-haspopup=\"listbox\"\n id=\"${this.slug}-combobox\"\n aria-label=\"${this.field?.label}\"\n >\n <ul role=\"listbox\" aria-labelledby=\"${this.slug}-label\" id=\"${this.slug}-listbox\" part=\"listbox\">\n ${this.makeOptions()}\n </ul>\n </div>\n `;\n }\n\n makeOptions() {\n if (this.input) {\n this.filteredOptions = this.options.filter(\n option => option.toLowerCase().indexOf(this.input.value?.toLowerCase()) !== -1,\n );\n\n return this.filteredOptions.map(\n (option, index) => html`<li\n id=\"${this.slug}-option-${index}\"\n role=\"option\"\n tabindex=\"0\"\n aria-selected=\"false\"\n @click=${(event: KeyboardEvent) => this.handleSelection(event)}\n @keydown=${(event: KeyboardEvent) => this.handleOptionKeyDown(event)}\n >\n ${option}\n </li>`,\n );\n }\n\n return null;\n }\n\n handleInput(event: CustomEvent) {\n this.makeOptions();\n this.show = event.detail.length > 0;\n }\n\n handleFocus() {\n this.makeOptions();\n this.show = true;\n }\n\n handleSelection(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n this.input.value = target.innerText;\n this.show = false;\n\n emitEvent(this, 'kemet-combo-selection', {\n element: target,\n text: target.innerText,\n id: target.getAttribute('id'),\n });\n }\n\n handleOptionKeyDown(event: KeyboardEvent) {\n event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (event.code === 'ArrowDown') {\n const next = target.nextElementSibling as HTMLElement;\n\n if (next) {\n next.focus();\n } else {\n this.shadowRoot.querySelector('li').focus();\n }\n }\n\n if (event.code === 'ArrowUp') {\n const previous = target.previousElementSibling as HTMLElement;\n const lastChild = this.shadowRoot.querySelector('li:last-child') as HTMLElement;\n\n if (previous) {\n previous.focus();\n } else {\n lastChild.focus();\n }\n }\n\n if (event.code === 'Escape' || event.code === 'Tab') {\n this.show = false;\n this.input.focus();\n }\n\n if (event.code === 'Enter' || event.code === 'Space') {\n this.handleSelection(event);\n }\n }\n\n handleInputKeyDown(event: KeyboardEvent) {\n if (event.code === 'ArrowDown') {\n this.shadowRoot.querySelector('li').focus();\n }\n\n if (event.code === 'Escape') {\n this.show = false;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-combo': KemetCombo\n }\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { html, render } from 'lit';
|
|
2
|
-
import { Key } from 'webdriverio';
|
|
3
|
-
import { expect } from '@wdio/globals';
|
|
4
|
-
import { waitFor } from '@testing-library/dom';
|
|
5
|
-
import './kemet-combo';
|
|
6
|
-
import '../kemet-field/kemet-field';
|
|
7
|
-
import '../kemet-input/kemet-input';
|
|
8
|
-
import userEvent from '@testing-library/user-event';
|
|
9
|
-
describe('Combo', () => {
|
|
10
|
-
const options = ['Item 1', 'Item 2', 'Item 3'];
|
|
11
|
-
const templates = {
|
|
12
|
-
default: html `
|
|
13
|
-
<kemet-field label="Combo">
|
|
14
|
-
<kemet-input slot="input" name="input"></kemet-input>
|
|
15
|
-
<kemet-combo slot="component" .options=${options}></kemet-combo>
|
|
16
|
-
</kemet-field>
|
|
17
|
-
`,
|
|
18
|
-
};
|
|
19
|
-
it('selects from combo list box', async () => {
|
|
20
|
-
render(templates.default, document.body);
|
|
21
|
-
await waitFor(async () => {
|
|
22
|
-
const combo = document.body.querySelector('kemet-combo');
|
|
23
|
-
const input = document.body.querySelector('kemet-input').shadowRoot.querySelector('input');
|
|
24
|
-
await userEvent.type(input, 'Item');
|
|
25
|
-
const listboxItem = combo.shadowRoot.querySelector('li');
|
|
26
|
-
await userEvent.click(listboxItem);
|
|
27
|
-
expect(input.value).toBe('Item 1');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
it('selects from combo list box using a keyboard', async () => {
|
|
31
|
-
render(templates.default, document.body);
|
|
32
|
-
await waitFor(async () => {
|
|
33
|
-
const combo = document.body.querySelector('kemet-combo');
|
|
34
|
-
const input = document.body.querySelector('kemet-input').shadowRoot.querySelector('input');
|
|
35
|
-
combo.show = true;
|
|
36
|
-
await browser.keys([Key.Tab]);
|
|
37
|
-
await userEvent.keyboard('{ArrowDown}');
|
|
38
|
-
await userEvent.keyboard('{ArrowDown}');
|
|
39
|
-
await userEvent.keyboard('{ArrowDown}');
|
|
40
|
-
await userEvent.keyboard('{ArrowUp}');
|
|
41
|
-
await userEvent.keyboard('{Enter}');
|
|
42
|
-
expect(input.value).toBe('Item 1');
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
//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YACnC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,OAAO,CAAC,KAAK,IAAI,EAAE;YACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;YACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC3F,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;YAClB,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9B,MAAM,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACxC,MAAM,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACxC,MAAM,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACxC,MAAM,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACtC,MAAM,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACpC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, render } from 'lit';\nimport { Key } from 'webdriverio';\nimport { expect } from '@wdio/globals';\nimport { waitFor } from '@testing-library/dom';\n\nimport './kemet-combo';\nimport '../kemet-field/kemet-field';\nimport '../kemet-input/kemet-input';\nimport userEvent from '@testing-library/user-event';\n\ndescribe('Combo', () => {\n const options = ['Item 1', 'Item 2', 'Item 3'];\n\n const templates = {\n default: html`\n <kemet-field label=\"Combo\">\n <kemet-input slot=\"input\" name=\"input\"></kemet-input>\n <kemet-combo slot=\"component\" .options=${options}></kemet-combo>\n </kemet-field>\n `,\n };\n\n it('selects from combo list box', async () => {\n render(templates.default, document.body);\n await waitFor(async () => {\n const combo = document.body.querySelector('kemet-combo');\n const input = document.body.querySelector('kemet-input').shadowRoot.querySelector('input');\n await userEvent.type(input, 'Item');\n const listboxItem = combo.shadowRoot.querySelector('li');\n await userEvent.click(listboxItem);\n expect(input.value).toBe('Item 1');\n });\n });\n\n it('selects from combo list box using a keyboard', async () => {\n render(templates.default, document.body);\n await waitFor(async () => {\n const combo = document.body.querySelector('kemet-combo');\n const input = document.body.querySelector('kemet-input').shadowRoot.querySelector('input');\n combo.show = true;\n await browser.keys([Key.Tab]);\n await userEvent.keyboard('{ArrowDown}');\n await userEvent.keyboard('{ArrowDown}');\n await userEvent.keyboard('{ArrowDown}');\n await userEvent.keyboard('{ArrowUp}');\n await userEvent.keyboard('{Enter}');\n expect(input.value).toBe('Item 1');\n });\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-combo/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD5B,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const stylesBase = css`\n :host {\n --kemet-combo-width: calc(100% - 2px);\n --kemet-combo-margin: 1rem auto;\n --kemet-combo-max-height: calc(5 * 3rem);\n --kemet-combo-border: 1px solid rgb(var(--kemet-color-foreground));\n --kemet-combo-border-radius: var(--kemet-border-radius-md);\n --kemet-combo-background-color: rgb(var(--kemet-color-white-to-black));\n --kemet-combo-shadow: var(--kemet-elevation-layer-5);\n --kemet-combo-hover-color: rgb(var(--kemet-color-white));\n --kemet-combo-hover-background-color: rgb(var(--kemet-color-primary));\n\n opacity: 0;\n width: var(--kemet-combo-width);\n margin: var(--kemet-combo-margin);\n pointer-events: none;\n display: block;\n position: relative;\n transition: opacity 0.3s ease-in-out;\n }\n\n :host([show]) {\n opacity: 1;\n pointer-events: auto;\n }\n\n ul {\n width: 100%;\n max-height: var(--kemet-combo-max-height);\n position: absolute;\n z-index: 1;\n list-style: none;\n margin: 0;\n padding: 0;\n overflow-y: scroll;\n border: var(--kemet-combo-border);\n border-radius: var(--kemet-combo-border-radius);\n background-color: var(--kemet-combo-background-color);\n box-shadow: var(--kemet-combo-shadow);\n }\n\n li {\n line-height: 3rem;\n padding: 0 1.5rem;\n cursor: pointer;\n }\n\n li:hover,\n li:focus {\n color: var(--kemet-combo-hover-color);\n outline: none;\n background-color: var(--kemet-combo-hover-background-color);\n }\n`;\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
-
import '../kemet-count';
|
|
3
|
-
import '../../kemet-input/kemet-input';
|
|
4
|
-
import '../../kemet-field/kemet-field';
|
|
5
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
6
|
-
import '../../kemet-tabs/kemet-tab';
|
|
7
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
8
|
-
declare const meta: Meta;
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj;
|
|
11
|
-
export declare const Standard: Story;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../kemet-count';
|
|
3
|
-
import '../../kemet-input/kemet-input';
|
|
4
|
-
import '../../kemet-field/kemet-field';
|
|
5
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
6
|
-
import '../../kemet-tabs/kemet-tab';
|
|
7
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Components / Count',
|
|
10
|
-
component: 'kemet-count',
|
|
11
|
-
args: {
|
|
12
|
-
label: 'Label',
|
|
13
|
-
message: 'Too many characters!',
|
|
14
|
-
status: 'standard',
|
|
15
|
-
remaining: 'characters remaining.',
|
|
16
|
-
validateImmediately: true,
|
|
17
|
-
limit: 8,
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
status: {
|
|
21
|
-
control: { type: 'radio' },
|
|
22
|
-
options: ['standard', 'error', 'warning'],
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export default meta;
|
|
27
|
-
const Template = (args) => html `
|
|
28
|
-
<kemet-field slug="unique-identifier" label="${args.label}" message="${args.message}" status="${args.status}">
|
|
29
|
-
<kemet-input slot="input" name="input-field" status="${args.status}" validate-on-blur></kemet-input>
|
|
30
|
-
<kemet-count slot="component" message="${args.remaining}" limit="${args.limit}" ?validate-immediately=${args.validateImmediately}></kemet-count>
|
|
31
|
-
</kemet-field>
|
|
32
|
-
`;
|
|
33
|
-
export const Standard = {
|
|
34
|
-
render: args => Template(args),
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../../src/components/kemet-count/docs/stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,gBAAgB,CAAC;AAExB,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,uBAAuB;QAClC,mBAAmB,EAAE,IAAI;QACzB,KAAK,EAAE,CAAC;KACT;IACD,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC1B,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC;SAC1C;KACF;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;iDACkB,IAAI,CAAC,KAAK,cAAc,IAAI,CAAC,OAAO,aAAa,IAAI,CAAC,MAAM;2DAClD,IAAI,CAAC,MAAM;6CACzB,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,KAAK,2BAA2B,IAAI,CAAC,mBAAmB;;CAEnI,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC/B,CAAC","sourcesContent":["import { html } from 'lit';\nimport type { Meta, StoryObj } from '@storybook/web-components';\n\nimport '../kemet-count';\n\nimport '../../kemet-input/kemet-input';\nimport '../../kemet-field/kemet-field';\nimport '../../kemet-tabs/kemet-tabs';\nimport '../../kemet-tabs/kemet-tab';\nimport '../../kemet-tabs/kemet-tab-panel';\n\nconst meta: Meta = {\n title: 'Components / Count',\n component: 'kemet-count',\n args: {\n label: 'Label',\n message: 'Too many characters!',\n status: 'standard',\n remaining: 'characters remaining.',\n validateImmediately: true,\n limit: 8,\n },\n argTypes: {\n status: {\n control: { type: 'radio' },\n options: ['standard', 'error', 'warning'],\n },\n }\n};\nexport default meta;\n\ntype Story = StoryObj;\n\nconst Template = (args) => html`\n <kemet-field slug=\"unique-identifier\" label=\"${args.label}\" message=\"${args.message}\" status=\"${args.status}\">\n <kemet-input slot=\"input\" name=\"input-field\" status=\"${args.status}\" validate-on-blur></kemet-input>\n <kemet-count slot=\"component\" message=\"${args.remaining}\" limit=\"${args.limit}\" ?validate-immediately=${args.validateImmediately}></kemet-count>\n </kemet-field>\n`;\n\nexport const Standard: Story = {\n render: args => Template(args),\n};\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { KemetFieldInterface } from '../kemet-field/types';
|
|
3
|
-
import { KemetInputInterface } from '../kemet-input/types';
|
|
4
|
-
import { KemetTextareaInterface } from '../kemet-textarea/types';
|
|
5
|
-
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
* @status stable
|
|
8
|
-
*
|
|
9
|
-
* @tagname kemet-count
|
|
10
|
-
* @summary Maintains a character count for an input field. Is to be used only in the component slot of a Field component.
|
|
11
|
-
*
|
|
12
|
-
* @prop {string} message - The text label shown to users
|
|
13
|
-
* @prop {number} remaining - The number of characters remaining
|
|
14
|
-
* @prop {number} limit - The maximum number of characters allowed
|
|
15
|
-
* @prop {boolean} validateImmediately - Set to true if the field should validate as soon as the character limit is reached
|
|
16
|
-
*
|
|
17
|
-
* @cssproperty --kemet-count-font-size - The font size. Default: 90%.
|
|
18
|
-
*
|
|
19
|
-
* @event kemet-count-status - Fires when there's a change in status.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export default class KemetCount extends LitElement {
|
|
23
|
-
static styles: import("lit").CSSResult[];
|
|
24
|
-
message: string;
|
|
25
|
-
remaining: number;
|
|
26
|
-
limit: number;
|
|
27
|
-
validateImmediately: boolean;
|
|
28
|
-
field: KemetFieldInterface;
|
|
29
|
-
inputSlot: KemetInputInterface | KemetTextareaInterface;
|
|
30
|
-
input: HTMLInputElement;
|
|
31
|
-
textarea: HTMLTextAreaElement;
|
|
32
|
-
firstUpdated(): void;
|
|
33
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
-
}
|
|
35
|
-
declare global {
|
|
36
|
-
interface HTMLElementTagNameMap {
|
|
37
|
-
'kemet-count': KemetCount;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
-
import { emitEvent } from '../../utilities/misc/events';
|
|
5
|
-
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
* @status stable
|
|
8
|
-
*
|
|
9
|
-
* @tagname kemet-count
|
|
10
|
-
* @summary Maintains a character count for an input field. Is to be used only in the component slot of a Field component.
|
|
11
|
-
*
|
|
12
|
-
* @prop {string} message - The text label shown to users
|
|
13
|
-
* @prop {number} remaining - The number of characters remaining
|
|
14
|
-
* @prop {number} limit - The maximum number of characters allowed
|
|
15
|
-
* @prop {boolean} validateImmediately - Set to true if the field should validate as soon as the character limit is reached
|
|
16
|
-
*
|
|
17
|
-
* @cssproperty --kemet-count-font-size - The font size. Default: 90%.
|
|
18
|
-
*
|
|
19
|
-
* @event kemet-count-status - Fires when there's a change in status.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
let KemetCount = class KemetCount extends LitElement {
|
|
23
|
-
firstUpdated() {
|
|
24
|
-
this.field = this.closest('kemet-field');
|
|
25
|
-
this.inputSlot = this.field.querySelector('[slot="input"]');
|
|
26
|
-
this.remaining = this.limit - this.field.length;
|
|
27
|
-
this.field.addEventListener('kemet-field-input', (event) => {
|
|
28
|
-
this.remaining = this.limit - event.detail;
|
|
29
|
-
const nativeElement = this.input || this.textarea;
|
|
30
|
-
if (nativeElement) {
|
|
31
|
-
if (this.remaining < 0) {
|
|
32
|
-
// nativeElement.validity.passedLimit = true;
|
|
33
|
-
if (this.validateImmediately) {
|
|
34
|
-
this.inputSlot.status = 'error';
|
|
35
|
-
this.inputSlot.invalid = true;
|
|
36
|
-
emitEvent(this, 'kemet-count-status', {
|
|
37
|
-
status: 'error',
|
|
38
|
-
validity: nativeElement.validity,
|
|
39
|
-
element: this.inputSlot,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
this.inputSlot.status = 'standard';
|
|
45
|
-
nativeElement.checkValidity();
|
|
46
|
-
emitEvent(this, 'kemet-count-status', {
|
|
47
|
-
status: 'standard',
|
|
48
|
-
validity: nativeElement.validity,
|
|
49
|
-
element: this.inputSlot,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
this.input = this.inputSlot.shadowRoot.querySelector('input');
|
|
55
|
-
this.textarea = this.inputSlot.shadowRoot.querySelector('textarea');
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
return html `${this.remaining} ${this.message}`;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
KemetCount.styles = [
|
|
62
|
-
css `
|
|
63
|
-
:host {
|
|
64
|
-
display: block;
|
|
65
|
-
font-size: var(--kemet-count-font-size, 90%);
|
|
66
|
-
margin-top: 0.8rem;
|
|
67
|
-
}
|
|
68
|
-
`,
|
|
69
|
-
];
|
|
70
|
-
__decorate([
|
|
71
|
-
property({ type: String })
|
|
72
|
-
], KemetCount.prototype, "message", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
property({ type: Number })
|
|
75
|
-
], KemetCount.prototype, "remaining", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
property({ type: Number })
|
|
78
|
-
], KemetCount.prototype, "limit", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
property({ type: Boolean, attribute: 'validate-immediately' })
|
|
81
|
-
], KemetCount.prototype, "validateImmediately", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
state()
|
|
84
|
-
], KemetCount.prototype, "field", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
state()
|
|
87
|
-
], KemetCount.prototype, "inputSlot", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
state()
|
|
90
|
-
], KemetCount.prototype, "input", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
state()
|
|
93
|
-
], KemetCount.prototype, "textarea", void 0);
|
|
94
|
-
KemetCount = __decorate([
|
|
95
|
-
customElement('kemet-count')
|
|
96
|
-
], KemetCount);
|
|
97
|
-
export default KemetCount;
|
|
98
|
-
//# sourceMappingURL=kemet-count.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-count.js","sourceRoot":"","sources":["../../../src/components/kemet-count/kemet-count.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAKxD;;;;;;;;;;;;;;;;GAgBG;AAGY,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAmChD,YAAY;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAE5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAEhD,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,KAAkB,EAAE,EAAE;YACtE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;YAE3C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC;YAElD,IAAI,aAAa,EAAE,CAAC;gBAClB,IAAI,IAAI,CAAC,SAAS,G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,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;uDAClC;AAG7B;IADC,KAAK,EAAE;yCACmB;AAG3B;IADC,KAAK,EAAE;6CACgD;AAGxD;IADC,KAAK,EAAE;yCACgB;AAGxB;IADC,KAAK,EAAE;4CACsB;AAjCX,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CAgF9B;eAhFoB,UAAU","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { KemetFieldInterface } from '../kemet-field/types';\nimport { KemetInputInterface } from '../kemet-input/types';\nimport { KemetTextareaInterface } from '../kemet-textarea/types';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-count\n * @summary Maintains a character count for an input field. Is to be used only in the component slot of a Field component.\n *\n * @prop {string} message - The text label shown to users\n * @prop {number} remaining - The number of characters remaining\n * @prop {number} limit - The maximum number of characters allowed\n * @prop {boolean} validateImmediately - Set to true if the field should validate as soon as the character limit is reached\n *\n * @cssproperty --kemet-count-font-size - The font size. Default: 90%.\n *\n * @event kemet-count-status - Fires when there's a change in status.\n *\n */\n\n@customElement('kemet-count')\nexport default class KemetCount extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n font-size: var(--kemet-count-font-size, 90%);\n margin-top: 0.8rem;\n }\n `,\n ];\n\n @property({ type: String })\n message: string;\n\n @property({ type: Number })\n remaining: number;\n\n @property({ type: Number })\n limit: number;\n\n @property({ type: Boolean, attribute: 'validate-immediately' })\n validateImmediately: boolean;\n\n @state()\n field: KemetFieldInterface;\n\n @state()\n inputSlot: KemetInputInterface | KemetTextareaInterface;\n\n @state()\n input: HTMLInputElement;\n\n @state()\n textarea: HTMLTextAreaElement;\n\n firstUpdated() {\n this.field = this.closest('kemet-field');\n this.inputSlot = this.field.querySelector('[slot=\"input\"]');\n\n this.remaining = this.limit - this.field.length;\n\n this.field.addEventListener('kemet-field-input', (event: CustomEvent) => {\n this.remaining = this.limit - event.detail;\n\n const nativeElement = this.input || this.textarea;\n\n if (nativeElement) {\n if (this.remaining < 0) {\n // nativeElement.validity.passedLimit = true;\n\n if (this.validateImmediately) {\n this.inputSlot.status = 'error';\n this.inputSlot.invalid = true;\n\n emitEvent(this, 'kemet-count-status', {\n status: 'error',\n validity: nativeElement.validity,\n element: this.inputSlot,\n });\n }\n } else {\n this.inputSlot.status = 'standard';\n nativeElement.checkValidity();\n\n emitEvent(this, 'kemet-count-status', {\n status: 'standard',\n validity: nativeElement.validity,\n element: this.inputSlot,\n });\n }\n }\n });\n\n this.input = this.inputSlot.shadowRoot.querySelector('input');\n this.textarea = this.inputSlot.shadowRoot.querySelector('textarea');\n }\n\n render() {\n return html`${this.remaining} ${this.message}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-count': KemetCount\n }\n}\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { html, render } from 'lit';
|
|
2
|
-
import { expect } from '@wdio/globals';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { waitFor } from '@testing-library/dom';
|
|
5
|
-
import '../kemet-input/kemet-input';
|
|
6
|
-
import '../kemet-textarea/kemet-textarea';
|
|
7
|
-
import '../kemet-field/kemet-field';
|
|
8
|
-
import './kemet-count';
|
|
9
|
-
describe('Field', () => {
|
|
10
|
-
const templates = {
|
|
11
|
-
default: html `
|
|
12
|
-
<kemet-field>
|
|
13
|
-
<kemet-input slot="input" name="input"></kemet-input>
|
|
14
|
-
<kemet-count slot="component" message="characters remaining." limit="6" validate-immediately></kemet-count>
|
|
15
|
-
</kemet-field>
|
|
16
|
-
`,
|
|
17
|
-
textarea: html `
|
|
18
|
-
<kemet-field>
|
|
19
|
-
<kemet-textarea slot="input" name="textarea"></kemet-textarea>
|
|
20
|
-
<kemet-count slot="component" message="characters remaining." limit="6" validate-immediately></kemet-count>
|
|
21
|
-
</kemet-field>
|
|
22
|
-
`,
|
|
23
|
-
};
|
|
24
|
-
it('should count characters remaining', async () => {
|
|
25
|
-
render(templates.default, document.body);
|
|
26
|
-
const kemetInput = document.querySelector('kemet-input');
|
|
27
|
-
const kemetCount = document.querySelector('kemet-count');
|
|
28
|
-
await waitFor(async () => {
|
|
29
|
-
const input = kemetInput.shadowRoot.querySelector('input');
|
|
30
|
-
await userEvent.type(input, 'abcdefgh');
|
|
31
|
-
expect(kemetCount.remaining).toBe(-2);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
it('should count characters remaining in a textarea', async () => {
|
|
35
|
-
render(templates.textarea, document.body);
|
|
36
|
-
const kemetTextarea = document.querySelector('kemet-textarea');
|
|
37
|
-
const kemetCount = document.querySelector('kemet-count');
|
|
38
|
-
await waitFor(async () => {
|
|
39
|
-
const textarea = kemetTextarea.shadowRoot.querySelector('textarea');
|
|
40
|
-
await userEvent.type(textarea, 'abcdefgh');
|
|
41
|
-
expect(kemetCount.remaining).toBe(-2);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/components/kemet-count/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,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AAEvB,QAAQ,CAAC,OAAO,EAAE,GAAG,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CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,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 { waitFor } from '@testing-library/dom';\n\nimport '../kemet-input/kemet-input';\nimport '../kemet-textarea/kemet-textarea';\nimport '../kemet-field/kemet-field';\nimport './kemet-count';\n\ndescribe('Field', () => {\n const templates = {\n default: html`\n <kemet-field>\n <kemet-input slot=\"input\" name=\"input\"></kemet-input>\n <kemet-count slot=\"component\" message=\"characters remaining.\" limit=\"6\" validate-immediately></kemet-count>\n </kemet-field>\n `,\n textarea: html`\n <kemet-field>\n <kemet-textarea slot=\"input\" name=\"textarea\"></kemet-textarea>\n <kemet-count slot=\"component\" message=\"characters remaining.\" limit=\"6\" validate-immediately></kemet-count>\n </kemet-field>\n `,\n };\n\n it('should count characters remaining', async () => {\n render(templates.default, document.body);\n const kemetInput = document.querySelector('kemet-input');\n const kemetCount = document.querySelector('kemet-count');\n\n await waitFor(async () => {\n const input = kemetInput.shadowRoot.querySelector('input');\n await userEvent.type(input, 'abcdefgh');\n expect(kemetCount.remaining).toBe(-2);\n });\n });\n\n it('should count characters remaining in a textarea', async () => {\n render(templates.textarea, document.body);\n const kemetTextarea = document.querySelector('kemet-textarea');\n const kemetCount = document.querySelector('kemet-count');\n\n await waitFor(async () => {\n const textarea = kemetTextarea.shadowRoot.querySelector('textarea');\n await userEvent.type(textarea, 'abcdefgh');\n expect(kemetCount.remaining).toBe(-2);\n });\n });\n});\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
-
import '../kemet-draggable';
|
|
3
|
-
import '../../kemet-tabs/kemet-tabs';
|
|
4
|
-
import '../../kemet-tabs/kemet-tab';
|
|
5
|
-
import '../../kemet-tabs/kemet-tab-panel';
|
|
6
|
-
import '../../kemet-button/kemet-button';
|
|
7
|
-
declare const meta: Meta;
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj;
|
|
10
|
-
export declare const Standard: Story;
|