@rei/cedar 11.0.0-alpha.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/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/cdr-fonts.css +21 -0
- package/dist/cedar-compiled.css +4788 -0
- package/dist/cedar.js +11677 -0
- package/dist/cedar.mjs +9944 -0
- package/dist/lib/assets/cedar-compiled-fccbce00.css +4714 -0
- package/dist/lib/node_modules/@rei/cdr-tokens/dist/js/cdr-tokens.esm.mjs +9 -0
- package/dist/lib/src/components/accordion/CdrAccordion.mjs +206 -0
- package/dist/lib/src/components/accordion/CdrAccordionGroup.mjs +124 -0
- package/dist/lib/src/components/accordion/styles/CdrAccordion.mjs +3 -0
- package/dist/lib/src/components/accordion/styles/CdrAccordionGroup.mjs +3 -0
- package/dist/lib/src/components/banner/CdrBanner.mjs +75 -0
- package/dist/lib/src/components/banner/styles/CdrBanner.mjs +3 -0
- package/dist/lib/src/components/breadcrumb/CdrBreadcrumb.mjs +170 -0
- package/dist/lib/src/components/breadcrumb/styles/CdrBreadcrumb.mjs +3 -0
- package/dist/lib/src/components/button/CdrButton.mjs +128 -0
- package/dist/lib/src/components/button/styles/CdrButton.mjs +3 -0
- package/dist/lib/src/components/caption/CdrCaption.mjs +38 -0
- package/dist/lib/src/components/caption/styles/CdrCaption.mjs +3 -0
- package/dist/lib/src/components/card/CdrCard.mjs +35 -0
- package/dist/lib/src/components/card/styles/CdrCard.mjs +3 -0
- package/dist/lib/src/components/checkbox/CdrCheckbox.mjs +182 -0
- package/dist/lib/src/components/checkbox/styles/CdrCheckbox.mjs +3 -0
- package/dist/lib/src/components/chip/CdrChip.mjs +36 -0
- package/dist/lib/src/components/chip/CdrChipGroup.mjs +108 -0
- package/dist/lib/src/components/chip/styles/CdrChip.mjs +3 -0
- package/dist/lib/src/components/chip/styles/CdrChipGroup.mjs +3 -0
- package/dist/lib/src/components/container/CdrContainer.mjs +51 -0
- package/dist/lib/src/components/container/styles/CdrContainer.mjs +3 -0
- package/dist/lib/src/components/flex-grid/CdrCol.mjs +189 -0
- package/dist/lib/src/components/flex-grid/CdrRow.mjs +231 -0
- package/dist/lib/src/components/flex-grid/styles/CdrCol.mjs +3 -0
- package/dist/lib/src/components/flex-grid/styles/CdrRow.mjs +3 -0
- package/dist/lib/src/components/formError/CdrFormError.mjs +31 -0
- package/dist/lib/src/components/formError/styles/CdrFormError.mjs +3 -0
- package/dist/lib/src/components/formGroup/CdrFormGroup.mjs +95 -0
- package/dist/lib/src/components/formGroup/styles/CdrFormGroup.mjs +3 -0
- package/dist/lib/src/components/grid/CdrGrid.mjs +59 -0
- package/dist/lib/src/components/grid/styles/CdrGrid.mjs +3 -0
- package/dist/lib/src/components/icon/CdrIcon.mjs +76 -0
- package/dist/lib/src/components/icon/comps/account-profile-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/account-profile.mjs +32 -0
- package/dist/lib/src/components/icon/comps/arrow-down.mjs +32 -0
- package/dist/lib/src/components/icon/comps/arrow-left.mjs +32 -0
- package/dist/lib/src/components/icon/comps/arrow-right.mjs +32 -0
- package/dist/lib/src/components/icon/comps/arrow-up.mjs +32 -0
- package/dist/lib/src/components/icon/comps/atv.mjs +32 -0
- package/dist/lib/src/components/icon/comps/bed-outline.mjs +32 -0
- package/dist/lib/src/components/icon/comps/bike-shop.mjs +32 -0
- package/dist/lib/src/components/icon/comps/binoculars.mjs +32 -0
- package/dist/lib/src/components/icon/comps/birding.mjs +32 -0
- package/dist/lib/src/components/icon/comps/boat.mjs +32 -0
- package/dist/lib/src/components/icon/comps/boating.mjs +32 -0
- package/dist/lib/src/components/icon/comps/bookmark-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/bookmark-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-abstract.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-code-sandbox.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-github.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-linkedin.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-rei-ice-axes.mjs +32 -0
- package/dist/lib/src/components/icon/comps/brand-sketch.mjs +32 -0
- package/dist/lib/src/components/icon/comps/buddies.mjs +32 -0
- package/dist/lib/src/components/icon/comps/bus.mjs +32 -0
- package/dist/lib/src/components/icon/comps/calendar.mjs +32 -0
- package/dist/lib/src/components/icon/comps/camera.mjs +32 -0
- package/dist/lib/src/components/icon/comps/canoe.mjs +32 -0
- package/dist/lib/src/components/icon/comps/car.mjs +32 -0
- package/dist/lib/src/components/icon/comps/caret-down.mjs +32 -0
- package/dist/lib/src/components/icon/comps/caret-left.mjs +32 -0
- package/dist/lib/src/components/icon/comps/caret-right.mjs +32 -0
- package/dist/lib/src/components/icon/comps/caret-up.mjs +32 -0
- package/dist/lib/src/components/icon/comps/cart-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/cart.mjs +32 -0
- package/dist/lib/src/components/icon/comps/chain-link.mjs +32 -0
- package/dist/lib/src/components/icon/comps/chat.mjs +32 -0
- package/dist/lib/src/components/icon/comps/check-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/check-lg.mjs +32 -0
- package/dist/lib/src/components/icon/comps/check-sm.mjs +32 -0
- package/dist/lib/src/components/icon/comps/check-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/climb.mjs +32 -0
- package/dist/lib/src/components/icon/comps/clipboard.mjs +32 -0
- package/dist/lib/src/components/icon/comps/clock.mjs +32 -0
- package/dist/lib/src/components/icon/comps/code-html.mjs +32 -0
- package/dist/lib/src/components/icon/comps/code-js.mjs +32 -0
- package/dist/lib/src/components/icon/comps/compass.mjs +32 -0
- package/dist/lib/src/components/icon/comps/copy.mjs +32 -0
- package/dist/lib/src/components/icon/comps/coupon-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/coupon-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/credit-card.mjs +32 -0
- package/dist/lib/src/components/icon/comps/curbside-pickup.mjs +32 -0
- package/dist/lib/src/components/icon/comps/day.mjs +32 -0
- package/dist/lib/src/components/icon/comps/diving.mjs +32 -0
- package/dist/lib/src/components/icon/comps/dog.mjs +32 -0
- package/dist/lib/src/components/icon/comps/download.mjs +32 -0
- package/dist/lib/src/components/icon/comps/edit.mjs +32 -0
- package/dist/lib/src/components/icon/comps/elevation.mjs +32 -0
- package/dist/lib/src/components/icon/comps/error-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/error-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/expand.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-backpacking.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-camping.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-climbing.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-clothing.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-cycling.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-family.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-fitness.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-hiking.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-outdoor-basics.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-paddling.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-rentals.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-snowsports.mjs +32 -0
- package/dist/lib/src/components/icon/comps/experiences-travel.mjs +32 -0
- package/dist/lib/src/components/icon/comps/external-link.mjs +32 -0
- package/dist/lib/src/components/icon/comps/eye-hide.mjs +32 -0
- package/dist/lib/src/components/icon/comps/eye-show.mjs +32 -0
- package/dist/lib/src/components/icon/comps/facebook.mjs +32 -0
- package/dist/lib/src/components/icon/comps/filter-alt.mjs +32 -0
- package/dist/lib/src/components/icon/comps/filter.mjs +32 -0
- package/dist/lib/src/components/icon/comps/find-location.mjs +32 -0
- package/dist/lib/src/components/icon/comps/fire.mjs +32 -0
- package/dist/lib/src/components/icon/comps/fishing.mjs +32 -0
- package/dist/lib/src/components/icon/comps/free-product.mjs +32 -0
- package/dist/lib/src/components/icon/comps/grid-view.mjs +32 -0
- package/dist/lib/src/components/icon/comps/heart-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/heart-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/hike.mjs +32 -0
- package/dist/lib/src/components/icon/comps/history.mjs +32 -0
- package/dist/lib/src/components/icon/comps/home.mjs +32 -0
- package/dist/lib/src/components/icon/comps/horse.mjs +32 -0
- package/dist/lib/src/components/icon/comps/horseshoe.mjs +32 -0
- package/dist/lib/src/components/icon/comps/image.mjs +32 -0
- package/dist/lib/src/components/icon/comps/information-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/information-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/instagram.mjs +32 -0
- package/dist/lib/src/components/icon/comps/kayak.mjs +32 -0
- package/dist/lib/src/components/icon/comps/list-ragged.mjs +32 -0
- package/dist/lib/src/components/icon/comps/list-view.mjs +32 -0
- package/dist/lib/src/components/icon/comps/location-pin-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/location-pin-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/lock-locked-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/lock-locked-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/lock-unlocked-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/mail.mjs +32 -0
- package/dist/lib/src/components/icon/comps/map.mjs +32 -0
- package/dist/lib/src/components/icon/comps/member-card.mjs +32 -0
- package/dist/lib/src/components/icon/comps/microphone.mjs +32 -0
- package/dist/lib/src/components/icon/comps/minus-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/minus-lg.mjs +32 -0
- package/dist/lib/src/components/icon/comps/minus-sm.mjs +32 -0
- package/dist/lib/src/components/icon/comps/minus-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/more-functions.mjs +32 -0
- package/dist/lib/src/components/icon/comps/my-location.mjs +32 -0
- package/dist/lib/src/components/icon/comps/navigation-menu.mjs +32 -0
- package/dist/lib/src/components/icon/comps/night.mjs +32 -0
- package/dist/lib/src/components/icon/comps/paddle.mjs +32 -0
- package/dist/lib/src/components/icon/comps/pause-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/pause-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/pause.mjs +32 -0
- package/dist/lib/src/components/icon/comps/photography.mjs +32 -0
- package/dist/lib/src/components/icon/comps/picnic.mjs +32 -0
- package/dist/lib/src/components/icon/comps/pinterest.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plane.mjs +32 -0
- package/dist/lib/src/components/icon/comps/play-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/play-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/play.mjs +32 -0
- package/dist/lib/src/components/icon/comps/playground.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plugin.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plus-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plus-lg.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plus-sm.mjs +32 -0
- package/dist/lib/src/components/icon/comps/plus-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/print.mjs +32 -0
- package/dist/lib/src/components/icon/comps/protection-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/protection-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/question-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/question-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/refresh.mjs +32 -0
- package/dist/lib/src/components/icon/comps/reload.mjs +32 -0
- package/dist/lib/src/components/icon/comps/returns.mjs +32 -0
- package/dist/lib/src/components/icon/comps/run.mjs +32 -0
- package/dist/lib/src/components/icon/comps/scan-barcode.mjs +32 -0
- package/dist/lib/src/components/icon/comps/search.mjs +32 -0
- package/dist/lib/src/components/icon/comps/service-shop.mjs +32 -0
- package/dist/lib/src/components/icon/comps/shipping.mjs +32 -0
- package/dist/lib/src/components/icon/comps/shopping-bag-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/shopping-bag.mjs +32 -0
- package/dist/lib/src/components/icon/comps/shrink.mjs +32 -0
- package/dist/lib/src/components/icon/comps/size-chart.mjs +32 -0
- package/dist/lib/src/components/icon/comps/ski-boot.mjs +32 -0
- package/dist/lib/src/components/icon/comps/ski.mjs +32 -0
- package/dist/lib/src/components/icon/comps/snow-shop.mjs +32 -0
- package/dist/lib/src/components/icon/comps/snow.mjs +32 -0
- package/dist/lib/src/components/icon/comps/sort.mjs +32 -0
- package/dist/lib/src/components/icon/comps/star-100.mjs +32 -0
- package/dist/lib/src/components/icon/comps/star-25.mjs +32 -0
- package/dist/lib/src/components/icon/comps/star-50.mjs +32 -0
- package/dist/lib/src/components/icon/comps/star-75.mjs +32 -0
- package/dist/lib/src/components/icon/comps/star-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/storefront.mjs +32 -0
- package/dist/lib/src/components/icon/comps/swim.mjs +32 -0
- package/dist/lib/src/components/icon/comps/telephone.mjs +32 -0
- package/dist/lib/src/components/icon/comps/tent.mjs +32 -0
- package/dist/lib/src/components/icon/comps/trash.mjs +32 -0
- package/dist/lib/src/components/icon/comps/twitter.mjs +32 -0
- package/dist/lib/src/components/icon/comps/upload.mjs +32 -0
- package/dist/lib/src/components/icon/comps/verified-purchaser.mjs +32 -0
- package/dist/lib/src/components/icon/comps/virtual-outfitting.mjs +32 -0
- package/dist/lib/src/components/icon/comps/warning-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/warning-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/water.mjs +32 -0
- package/dist/lib/src/components/icon/comps/wilderness.mjs +32 -0
- package/dist/lib/src/components/icon/comps/x-fill.mjs +32 -0
- package/dist/lib/src/components/icon/comps/x-lg.mjs +32 -0
- package/dist/lib/src/components/icon/comps/x-sm.mjs +32 -0
- package/dist/lib/src/components/icon/comps/x-stroke.mjs +32 -0
- package/dist/lib/src/components/icon/comps/youtube.mjs +32 -0
- package/dist/lib/src/components/icon/comps/zoom-in.mjs +32 -0
- package/dist/lib/src/components/icon/comps/zoom-out.mjs +32 -0
- package/dist/lib/src/components/icon/styles/CdrIcon.mjs +3 -0
- package/dist/lib/src/components/image/CdrImg.mjs +151 -0
- package/dist/lib/src/components/image/styles/CdrImg.mjs +3 -0
- package/dist/lib/src/components/input/CdrInput.mjs +296 -0
- package/dist/lib/src/components/input/styles/CdrInput.mjs +3 -0
- package/dist/lib/src/components/labelStandalone/CdrLabelStandalone.mjs +85 -0
- package/dist/lib/src/components/labelStandalone/styles/CdrLabelStandalone.mjs +3 -0
- package/dist/lib/src/components/labelWrapper/CdrLabelWrapper.mjs +56 -0
- package/dist/lib/src/components/labelWrapper/styles/CdrLabelWrapper.mjs +3 -0
- package/dist/lib/src/components/link/CdrLink.mjs +77 -0
- package/dist/lib/src/components/link/styles/CdrLink.mjs +3 -0
- package/dist/lib/src/components/list/CdrList.mjs +44 -0
- package/dist/lib/src/components/list/styles/CdrList.mjs +3 -0
- package/dist/lib/src/components/modal/CdrModal.mjs +375 -0
- package/dist/lib/src/components/modal/onTransitionEnd.mjs +42 -0
- package/dist/lib/src/components/modal/styles/CdrModal.mjs +3 -0
- package/dist/lib/src/components/pagination/CdrPagination.mjs +479 -0
- package/dist/lib/src/components/pagination/styles/CdrPagination.mjs +3 -0
- package/dist/lib/src/components/popover/CdrPopover.mjs +158 -0
- package/dist/lib/src/components/popover/styles/CdrPopover.mjs +3 -0
- package/dist/lib/src/components/popup/CdrPopup.mjs +284 -0
- package/dist/lib/src/components/popup/styles/CdrPopup.mjs +3 -0
- package/dist/lib/src/components/quote/CdrQuote.mjs +68 -0
- package/dist/lib/src/components/quote/styles/CdrQuote.mjs +3 -0
- package/dist/lib/src/components/radio/CdrRadio.mjs +154 -0
- package/dist/lib/src/components/radio/styles/CdrRadio.mjs +3 -0
- package/dist/lib/src/components/rating/CdrRating.mjs +200 -0
- package/dist/lib/src/components/rating/styles/CdrRating.mjs +3 -0
- package/dist/lib/src/components/select/CdrSelect.mjs +285 -0
- package/dist/lib/src/components/select/styles/CdrSelect.mjs +3 -0
- package/dist/lib/src/components/table/CdrTable.mjs +79 -0
- package/dist/lib/src/components/table/styles/CdrTable.mjs +3 -0
- package/dist/lib/src/components/tabs/CdrTabPanel.mjs +107 -0
- package/dist/lib/src/components/tabs/CdrTabs.mjs +385 -0
- package/dist/lib/src/components/tabs/styles/CdrTabPanel.mjs +3 -0
- package/dist/lib/src/components/tabs/styles/CdrTabs.mjs +3 -0
- package/dist/lib/src/components/text/CdrText.mjs +44 -0
- package/dist/lib/src/components/text/styles/CdrText.mjs +3 -0
- package/dist/lib/src/components/toast/CdrToast.mjs +129 -0
- package/dist/lib/src/components/toast/styles/CdrToast.mjs +3 -0
- package/dist/lib/src/components/tooltip/CdrTooltip.mjs +126 -0
- package/dist/lib/src/components/tooltip/styles/CdrTooltip.mjs +3 -0
- package/dist/lib/src/index.mjs +211 -0
- package/dist/lib/src/mixins/breakpoints.mjs +26 -0
- package/dist/lib/src/mixins/buildClass.mjs +97 -0
- package/dist/lib/src/mixins/fullWidth.mjs +47 -0
- package/dist/lib/src/mixins/modifier.mjs +22 -0
- package/dist/lib/src/mixins/size.mjs +39 -0
- package/dist/lib/src/utils/propValidator.mjs +27 -0
- package/dist/style/cdr-accordion-group.css +1 -0
- package/dist/style/cdr-accordion.css +1 -0
- package/dist/style/cdr-banner-vars.css +0 -0
- package/dist/style/cdr-banner.css +1 -0
- package/dist/style/cdr-breadcrumb.css +1 -0
- package/dist/style/cdr-button.css +1 -0
- package/dist/style/cdr-caption.css +1 -0
- package/dist/style/cdr-card.css +1 -0
- package/dist/style/cdr-checkbox.css +1 -0
- package/dist/style/cdr-chip-group.css +1 -0
- package/dist/style/cdr-chip.css +1 -0
- package/dist/style/cdr-col.css +1 -0
- package/dist/style/cdr-container.css +1 -0
- package/dist/style/cdr-form-error.css +1 -0
- package/dist/style/cdr-form-group.css +1 -0
- package/dist/style/cdr-grid.css +1 -0
- package/dist/style/cdr-icon.css +1 -0
- package/dist/style/cdr-img.css +1 -0
- package/dist/style/cdr-input.css +1 -0
- package/dist/style/cdr-label-standalone.css +1 -0
- package/dist/style/cdr-label-wrapper.css +1 -0
- package/dist/style/cdr-link.css +1 -0
- package/dist/style/cdr-list.css +1 -0
- package/dist/style/cdr-modal.css +1 -0
- package/dist/style/cdr-pagination.css +1 -0
- package/dist/style/cdr-popover.css +1 -0
- package/dist/style/cdr-popup.css +1 -0
- package/dist/style/cdr-quote.css +1 -0
- package/dist/style/cdr-radio.css +1 -0
- package/dist/style/cdr-rating.css +1 -0
- package/dist/style/cdr-row.css +1 -0
- package/dist/style/cdr-select.css +1 -0
- package/dist/style/cdr-tab-panel.css +1 -0
- package/dist/style/cdr-table.css +1 -0
- package/dist/style/cdr-tabs.css +1 -0
- package/dist/style/cdr-text.css +1 -0
- package/dist/style/cdr-toast.css +1 -0
- package/dist/style/cdr-tooltip.css +1 -0
- package/dist/style/cedar-full.css +39 -0
- package/dist/style/reset.css +1 -0
- package/dist/svg/icon-error.svg +5 -0
- package/dist/svg/star-0.svg +6 -0
- package/dist/svg/star-100.svg +6 -0
- package/dist/svg/star-25.svg +7 -0
- package/dist/svg/star-50.svg +7 -0
- package/dist/svg/star-75.svg +7 -0
- package/dist/svg/star-null.svg +6 -0
- package/package.json +162 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const CdrColorBackgroundPrimary = "#ffffff";
|
|
2
|
+
const CdrSpaceHalfX = "8";
|
|
3
|
+
const CdrSpaceOneX = "16";
|
|
4
|
+
const CdrSpaceTwoX = "32";
|
|
5
|
+
const CdrBreakpointSm = "768";
|
|
6
|
+
const CdrBreakpointMd = "992";
|
|
7
|
+
const CdrBreakpointLg = "1232";
|
|
8
|
+
|
|
9
|
+
export { CdrBreakpointLg, CdrBreakpointMd, CdrBreakpointSm, CdrColorBackgroundPrimary, CdrSpaceHalfX, CdrSpaceOneX, CdrSpaceTwoX };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
2
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
3
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
4
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import IconCaretDown from '../icon/comps/caret-down.mjs';
|
|
7
|
+
import modifier from '../../mixins/modifier.mjs';
|
|
8
|
+
import modules_b5678f63 from './styles/CdrAccordion.mjs';
|
|
9
|
+
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
+
var CdrAccordion = {
|
|
14
|
+
name: 'CdrAccordion',
|
|
15
|
+
components: {
|
|
16
|
+
IconCaretDown
|
|
17
|
+
},
|
|
18
|
+
mixins: [modifier],
|
|
19
|
+
inject: {
|
|
20
|
+
unwrap: {
|
|
21
|
+
default: {
|
|
22
|
+
value: false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
/**
|
|
28
|
+
* The unique id of an accordion.
|
|
29
|
+
*/
|
|
30
|
+
id: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Toggle this value to open/close the accordion.
|
|
37
|
+
*/
|
|
38
|
+
opened: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Sets a compact style.
|
|
45
|
+
*/
|
|
46
|
+
compact: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Sets a border-aligned style.
|
|
53
|
+
*/
|
|
54
|
+
borderAligned: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
// Sets the heading level
|
|
59
|
+
level: {
|
|
60
|
+
type: [String, Number],
|
|
61
|
+
required: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
data() {
|
|
66
|
+
return {
|
|
67
|
+
focused: false,
|
|
68
|
+
maxHeight: this.opened ? 'none' : 0,
|
|
69
|
+
// set maxHeight to none if initialized as open
|
|
70
|
+
style: modules_b5678f63
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
computed: {
|
|
75
|
+
baseClass() {
|
|
76
|
+
return 'cdr-accordion';
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
styleClass() {
|
|
80
|
+
var styles = [];
|
|
81
|
+
|
|
82
|
+
if (this.compact) {
|
|
83
|
+
styles.push(this.modifyClassName(this.baseClass, 'compact'));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (this.borderAligned) {
|
|
87
|
+
styles.push(this.modifyClassName(this.baseClass, 'border-aligned'));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return styles.join(' ');
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
unwrapClass() {
|
|
94
|
+
return this.unwrap.value ? this.modifyClassName(this.baseClass, 'unwrap') : null;
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
focusedClass() {
|
|
98
|
+
return this.focused ? this.modifyClassName(this.baseClass, 'focused') : null;
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
isOpenClass() {
|
|
102
|
+
return this.opened || this.unwrap.value ? 'open' : 'closed';
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
listeners() {
|
|
106
|
+
return this.unwrap.value ? {} : {
|
|
107
|
+
click: this.onClick,
|
|
108
|
+
focus: this.onFocus,
|
|
109
|
+
blur: this.onBlur
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
},
|
|
114
|
+
watch: {
|
|
115
|
+
opened() {
|
|
116
|
+
var _this = this;
|
|
117
|
+
|
|
118
|
+
// reset maxHeight before animating
|
|
119
|
+
this.maxHeight = !this.opened ? "".concat(this.$refs['accordion-content'].clientHeight, "px") : 0; // nextTick is not sufficient here, must wait for CSS to re-paint
|
|
120
|
+
|
|
121
|
+
setTimeout(function () {
|
|
122
|
+
// on next frame, set maxHeight to new value
|
|
123
|
+
_this.maxHeight = _this.opened ? "".concat(_this.$refs['accordion-content'].clientHeight, "px") : 0;
|
|
124
|
+
setTimeout(function () {
|
|
125
|
+
// after animation is complete, remove max-height so content can reflow
|
|
126
|
+
_this.maxHeight = _this.opened ? 'none' : 0;
|
|
127
|
+
}, 350); // cdr-duration-3x + 50ms
|
|
128
|
+
}, 50);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
mounted() {
|
|
134
|
+
/*
|
|
135
|
+
The intent here is to give maxHeight an actual pixel value when the accordion
|
|
136
|
+
is initialized as open. This guarantees that the open-to-close animation is
|
|
137
|
+
nice and smooth the first time they click it.
|
|
138
|
+
*/
|
|
139
|
+
if (this.opened && this.$refs['accordion-content']) {
|
|
140
|
+
this.maxHeight = 'none';
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
methods: {
|
|
145
|
+
onClick(event) {
|
|
146
|
+
this.$emit('accordion-toggle', event);
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
onFocus() {
|
|
150
|
+
this.focused = true;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
onBlur() {
|
|
154
|
+
this.focused = false;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
render() {
|
|
160
|
+
var h = arguments[0];
|
|
161
|
+
var Heading = "h".concat(this.level);
|
|
162
|
+
var HeadingContent = this.unwrap.value ? 'div' : 'button';
|
|
163
|
+
return h("div", {
|
|
164
|
+
"class": !this.unwrap.value && clsx(this.style[this.baseClass], this.modifierClass, this.styleClass, this.focusedClass),
|
|
165
|
+
"attrs": {
|
|
166
|
+
"id": "".concat(this.id, "-accordion")
|
|
167
|
+
},
|
|
168
|
+
"ref": "accordion-container"
|
|
169
|
+
}, [h(Heading, {
|
|
170
|
+
"class": this.unwrap.value ? this.style['cdr-accordion__header--unwrapped'] : this.style['cdr-accordion__header']
|
|
171
|
+
}, [h(HeadingContent, {
|
|
172
|
+
"class": [!this.unwrap.value && this.style['cdr-accordion__button'], 'js-cdr-accordion-button'],
|
|
173
|
+
"attrs": {
|
|
174
|
+
"id": this.id,
|
|
175
|
+
"aria-expanded": !this.unwrap.value && "".concat(this.opened),
|
|
176
|
+
"aria-controls": !this.unwrap.value && "".concat(this.id, "-collapsible")
|
|
177
|
+
},
|
|
178
|
+
"on": _objectSpread({}, this.listeners)
|
|
179
|
+
}, [h("span", {
|
|
180
|
+
"class": this.style['cdr-accordion__label'],
|
|
181
|
+
"attrs": {
|
|
182
|
+
"id": "".concat(this.id, "-label")
|
|
183
|
+
}
|
|
184
|
+
}, [this.$slots.label]), !this.unwrap.value && h("icon-caret-down", {
|
|
185
|
+
"class": clsx(this.style['cdr-accordion__icon'], this.isOpenClass),
|
|
186
|
+
"attrs": {
|
|
187
|
+
"size": this.compact ? 'small' : null
|
|
188
|
+
}
|
|
189
|
+
})])]), h("div", {
|
|
190
|
+
"class": clsx(this.style['cdr-accordion__content-container'], this.isOpenClass),
|
|
191
|
+
"style": {
|
|
192
|
+
maxHeight: this.unwrap.value ? 'none' : this.maxHeight
|
|
193
|
+
}
|
|
194
|
+
}, [h("div", {
|
|
195
|
+
"class": clsx(this.style['cdr-accordion__content'], this.isOpenClass, this.unwrapClass),
|
|
196
|
+
"attrs": {
|
|
197
|
+
"aria-hidden": !this.unwrap.value && "".concat(!this.opened),
|
|
198
|
+
"id": "".concat(this.id, "-collapsible")
|
|
199
|
+
},
|
|
200
|
+
"ref": "accordion-content"
|
|
201
|
+
}, [this.$slots.default])])]);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export default CdrAccordion;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
2
|
+
import debounce from 'lodash-es/debounce';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import validateProp from '../../utils/propValidator.mjs';
|
|
5
|
+
import breakpoints from '../../mixins/breakpoints.mjs';
|
|
6
|
+
import modules_6e2f679e from './styles/CdrAccordionGroup.mjs';
|
|
7
|
+
|
|
8
|
+
var CdrAccordionGroup = {
|
|
9
|
+
name: 'CdrAccordionGroup',
|
|
10
|
+
mixins: [breakpoints],
|
|
11
|
+
|
|
12
|
+
provide() {
|
|
13
|
+
return {
|
|
14
|
+
unwrap: this.isUnwrapped
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
props: {
|
|
19
|
+
unwrap: {
|
|
20
|
+
type: [String, Boolean],
|
|
21
|
+
default: false,
|
|
22
|
+
validator: function validator(value) {
|
|
23
|
+
if (typeof value === 'string') {
|
|
24
|
+
return validateProp(value, ['@xs', '@sm', '@md', '@lg'], false);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return typeof value === 'boolean';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
style: modules_6e2f679e,
|
|
35
|
+
accordionButtons: [],
|
|
36
|
+
currentIdx: 0,
|
|
37
|
+
isUnwrapped: {
|
|
38
|
+
value: this.unwrap
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
computed: {
|
|
44
|
+
nextIdx() {
|
|
45
|
+
var idx = this.currentIdx + 1;
|
|
46
|
+
return idx >= this.accordionButtons.length ? 0 : idx; // if at the last, go to first
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
prevIdx() {
|
|
50
|
+
var idx = this.currentIdx - 1;
|
|
51
|
+
return idx <= -1 ? this.accordionButtons.length - 1 : idx; // if at first, go to last
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
mounted() {
|
|
57
|
+
var _this = this;
|
|
58
|
+
|
|
59
|
+
// get all of the buttons in the group
|
|
60
|
+
this.accordionButtons = this.$el.querySelectorAll('.js-cdr-accordion-button');
|
|
61
|
+
|
|
62
|
+
if (typeof this.unwrap === 'string') {
|
|
63
|
+
this.isUnwrapped.value = this.unwrap.indexOf(this.getCurrentBreakpoint()) !== -1;
|
|
64
|
+
window.addEventListener('resize', debounce(function () {
|
|
65
|
+
_this.isUnwrapped.value = _this.unwrap.indexOf(_this.getCurrentBreakpoint()) !== -1;
|
|
66
|
+
}, 300));
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
methods: {
|
|
71
|
+
handleKeyDown(e) {
|
|
72
|
+
// something besides the button is focused
|
|
73
|
+
if (this.currentIdx === -1) return;
|
|
74
|
+
var key = e.key;
|
|
75
|
+
|
|
76
|
+
switch (key) {
|
|
77
|
+
case 'Home':
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
this.accordionButtons[0].focus();
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case 'End':
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
this.accordionButtons[this.accordionButtons.length - 1].focus();
|
|
85
|
+
break;
|
|
86
|
+
|
|
87
|
+
case 'ArrowDown':
|
|
88
|
+
case 'Down':
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
this.accordionButtons[this.nextIdx].focus();
|
|
91
|
+
break;
|
|
92
|
+
|
|
93
|
+
case 'ArrowUp':
|
|
94
|
+
case 'Up':
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
this.accordionButtons[this.prevIdx].focus();
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
focusin(e) {
|
|
102
|
+
// find out which, if any, button is focused
|
|
103
|
+
this.currentIdx = Array.prototype.indexOf.call(this.accordionButtons, e.target);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
render(h) {
|
|
109
|
+
var _context;
|
|
110
|
+
|
|
111
|
+
return h("ul", {
|
|
112
|
+
"class": clsx(this.style['cdr-accordion-group']),
|
|
113
|
+
"on": {
|
|
114
|
+
"focusin": this.focusin,
|
|
115
|
+
"keydown": this.handleKeyDown
|
|
116
|
+
}
|
|
117
|
+
}, [_mapInstanceProperty(_context = this.$slots.default).call(_context, function (vNode) {
|
|
118
|
+
return vNode.tag !== undefined ? h('li', vNode, [vNode]) : '';
|
|
119
|
+
})]);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default CdrAccordionGroup;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var modules_b5678f63 = {"cdr-accordion":"cdr-accordion_11-0-0-alpha-0","cdr-accordion__button":"cdr-accordion__button_11-0-0-alpha-0","cdr-accordion__label":"cdr-accordion__label_11-0-0-alpha-0","cdr-accordion__header":"cdr-accordion__header_11-0-0-alpha-0","cdr-accordion__header--unwrapped":"cdr-accordion__header--unwrapped_11-0-0-alpha-0","cdr-accordion__icon":"cdr-accordion__icon_11-0-0-alpha-0","cdr-accordion__content-container":"cdr-accordion__content-container_11-0-0-alpha-0","cdr-accordion__content":"cdr-accordion__content_11-0-0-alpha-0","cdr-accordion--unwrap":"cdr-accordion--unwrap_11-0-0-alpha-0","cdr-accordion--border-aligned":"cdr-accordion--border-aligned_11-0-0-alpha-0","cdr-accordion--compact":"cdr-accordion--compact_11-0-0-alpha-0","cdr-accordion--focused":"cdr-accordion--focused_11-0-0-alpha-0"};
|
|
2
|
+
|
|
3
|
+
export default modules_b5678f63;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import validateProp from '../../utils/propValidator.mjs';
|
|
3
|
+
import BuildClass from '../../mixins/buildClass.mjs';
|
|
4
|
+
import modules_0306f71a from './styles/CdrBanner.mjs';
|
|
5
|
+
|
|
6
|
+
var CdrBanner = {
|
|
7
|
+
name: 'CdrBanner',
|
|
8
|
+
mixins: [BuildClass],
|
|
9
|
+
props: {
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
validator: function validator(value) {
|
|
13
|
+
return validateProp(value, ['info', 'warning', 'success', 'error', 'default']);
|
|
14
|
+
},
|
|
15
|
+
default: 'default'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
style: modules_0306f71a
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
computed: {
|
|
26
|
+
baseClass() {
|
|
27
|
+
return 'cdr-banner';
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
borderClass() {
|
|
31
|
+
return this.modifyClassName(this.baseClass, this.type);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
iconClass() {
|
|
35
|
+
return this.modifyClassName("".concat(this.baseClass, "__icon-left"), this.type);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
themeClass() {
|
|
39
|
+
return this.modifyClassName("".concat(this.baseClass, "__main"), this.type);
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
prominenceClass() {
|
|
43
|
+
return this.$slots['message-body'] ? this.modifyClassName("".concat(this.baseClass, "__wrapper"), 'prominence') : undefined;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
noMsgBodyClass() {
|
|
47
|
+
return !this.$slots['message-body'] ? this.modifyClassName("".concat(this.baseClass, "__main"), 'no-msg') : undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
render() {
|
|
53
|
+
var h = arguments[0];
|
|
54
|
+
return h("div", {
|
|
55
|
+
"class": clsx(this.style[this.baseClass], this.borderClass)
|
|
56
|
+
}, [h("div", {
|
|
57
|
+
"class": clsx(this.style['cdr-banner__wrapper'], this.prominenceClass)
|
|
58
|
+
}, [h("div", {
|
|
59
|
+
"class": clsx(this.style['cdr-banner__main'], this.themeClass, this.noMsgBodyClass)
|
|
60
|
+
}, [this.$slots['icon-left'] && h("div", {
|
|
61
|
+
"class": clsx(this.style['cdr-banner__icon-left'], this.iconClass)
|
|
62
|
+
}, [this.$slots['icon-left']]), h("span", {
|
|
63
|
+
"class": this.style['cdr-banner__message']
|
|
64
|
+
}, [this.$slots.default]), this.$slots['icon-right'] && h("div", {
|
|
65
|
+
"class": this.style['cdr-banner__icon-right']
|
|
66
|
+
}, [this.$slots['icon-right']])]), this.$slots['message-body'] && h("div", {
|
|
67
|
+
"class": this.style['cdr-banner__message-body']
|
|
68
|
+
}, [this.$slots['message-body']])]), this.$slots['info-action'] && h("div", {
|
|
69
|
+
"class": this.style['cdr-banner__info-action']
|
|
70
|
+
}, [this.$slots['info-action']])]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default CdrBanner;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var modules_0306f71a = {"cdr-banner":"cdr-banner_11-0-0-alpha-0","cdr-banner__wrapper":"cdr-banner__wrapper_11-0-0-alpha-0","cdr-banner__wrapper--prominence":"cdr-banner__wrapper--prominence_11-0-0-alpha-0","cdr-banner__main":"cdr-banner__main_11-0-0-alpha-0","cdr-banner__main--info":"cdr-banner__main--info_11-0-0-alpha-0","cdr-banner__main--warning":"cdr-banner__main--warning_11-0-0-alpha-0","cdr-banner__main--success":"cdr-banner__main--success_11-0-0-alpha-0","cdr-banner__main--error":"cdr-banner__main--error_11-0-0-alpha-0","cdr-banner__main--default":"cdr-banner__main--default_11-0-0-alpha-0","cdr-banner__main--no-msg":"cdr-banner__main--no-msg_11-0-0-alpha-0","cdr-banner__icon-left":"cdr-banner__icon-left_11-0-0-alpha-0","cdr-banner__icon-left--info":"cdr-banner__icon-left--info_11-0-0-alpha-0","cdr-banner__icon-left--warning":"cdr-banner__icon-left--warning_11-0-0-alpha-0","cdr-banner__icon-left--success":"cdr-banner__icon-left--success_11-0-0-alpha-0","cdr-banner__icon-left--error":"cdr-banner__icon-left--error_11-0-0-alpha-0","cdr-banner__icon-left--default":"cdr-banner__icon-left--default_11-0-0-alpha-0","cdr-banner__message":"cdr-banner__message_11-0-0-alpha-0","cdr-banner__message-body":"cdr-banner__message-body_11-0-0-alpha-0","cdr-banner__icon-right":"cdr-banner__icon-right_11-0-0-alpha-0","cdr-banner__info-action":"cdr-banner__info-action_11-0-0-alpha-0","cdr-banner--default":"cdr-banner--default_11-0-0-alpha-0","cdr-banner--info":"cdr-banner--info_11-0-0-alpha-0","cdr-banner--warning":"cdr-banner--warning_11-0-0-alpha-0","cdr-banner--success":"cdr-banner--success_11-0-0-alpha-0","cdr-banner--error":"cdr-banner--error_11-0-0-alpha-0"};
|
|
2
|
+
|
|
3
|
+
export default modules_0306f71a;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
2
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import modules_4b26c135 from './styles/CdrBreadcrumb.mjs';
|
|
5
|
+
|
|
6
|
+
var CdrBreadcrumb = {
|
|
7
|
+
name: 'CdrBreadcrumb',
|
|
8
|
+
props: {
|
|
9
|
+
/**
|
|
10
|
+
* Required. List of source breadcrumb property objects
|
|
11
|
+
*
|
|
12
|
+
* {
|
|
13
|
+
* displayText: Breadcrumb Display Text
|
|
14
|
+
* url: location breadcrumb should navigate on click
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
items: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: function _default() {
|
|
20
|
+
return [];
|
|
21
|
+
},
|
|
22
|
+
validator: function validator(value) {
|
|
23
|
+
if (value.length && value.length > 0) {
|
|
24
|
+
for (var i = 0; i < value.length; i += 1) {
|
|
25
|
+
if (!(typeof value[i].item === 'object')) {
|
|
26
|
+
console.error('Breadcrumb items array missing item key at index ', i); // eslint-disable-line no-console
|
|
27
|
+
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!Object.hasOwnProperty.call(value[i].item, 'name')) {
|
|
32
|
+
console.error('Breadcrumb items array is missing item.name value at index ', i); // eslint-disable-line no-console
|
|
33
|
+
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Flag to track container width threshold exceeded
|
|
45
|
+
*/
|
|
46
|
+
truncationEnabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
truncate: this.truncationEnabled && this.items.length > 2,
|
|
55
|
+
style: modules_4b26c135,
|
|
56
|
+
componentID: Math.random().toString(36).substr(2, 9)
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
computed: {
|
|
61
|
+
baseClass() {
|
|
62
|
+
return 'cdr-breadcrumb';
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
ellipsis() {
|
|
66
|
+
var _context;
|
|
67
|
+
|
|
68
|
+
var h = this.$createElement;
|
|
69
|
+
return this.truncate ? h("li", {
|
|
70
|
+
"class": this.style['cdr-breadcrumb__item']
|
|
71
|
+
}, [h("button", {
|
|
72
|
+
"on": {
|
|
73
|
+
"click": this.handleEllipsisClick
|
|
74
|
+
},
|
|
75
|
+
"ref": "ellipse",
|
|
76
|
+
"attrs": {
|
|
77
|
+
"aria-expanded": "false",
|
|
78
|
+
"aria-controls": "".concat(this.componentID, "List"),
|
|
79
|
+
"aria-label": _concatInstanceProperty(_context = "show ".concat(this.items.length - 2, " more navigation level")).call(_context, this.items.length - 2 > 1 ? 's' : '')
|
|
80
|
+
},
|
|
81
|
+
"class": this.style['cdr-breadcrumb__ellipses']
|
|
82
|
+
}, [h("span", {
|
|
83
|
+
"class": this.style['cdr-breadcrumb__ellipses-icon'],
|
|
84
|
+
"attrs": {
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}
|
|
87
|
+
}, [". . ."])]), h("span", {
|
|
88
|
+
"class": this.style['cdr-breadcrumb__delimiter'],
|
|
89
|
+
"attrs": {
|
|
90
|
+
"aria-hidden": "true"
|
|
91
|
+
}
|
|
92
|
+
}, ["/"])]) : '';
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
listItems() {
|
|
96
|
+
var _context2,
|
|
97
|
+
_this = this;
|
|
98
|
+
|
|
99
|
+
var h = this.$createElement;
|
|
100
|
+
return _mapInstanceProperty(_context2 = this.items).call(_context2, function (breadcrumb, index) {
|
|
101
|
+
var delimiter = index < _this.items.length - 1 ? h("span", {
|
|
102
|
+
"class": _this.style['cdr-breadcrumb__delimiter'],
|
|
103
|
+
"attrs": {
|
|
104
|
+
"aria-hidden": "true"
|
|
105
|
+
}
|
|
106
|
+
}, ["/"]) : '';
|
|
107
|
+
return h("li", {
|
|
108
|
+
"class": clsx(_this.style['cdr-breadcrumb__item']),
|
|
109
|
+
"key": breadcrumb.item.id || breadcrumb.item.name.replace(/ /g, '-').toLowerCase(),
|
|
110
|
+
"directives": [{
|
|
111
|
+
name: "show",
|
|
112
|
+
value: !_this.truncate || index >= _this.items.length - 2
|
|
113
|
+
}]
|
|
114
|
+
}, [_this.$scopedSlots.link ? _this.$scopedSlots.link({
|
|
115
|
+
class: _this.style['cdr-breadcrumb__link'],
|
|
116
|
+
href: breadcrumb.item.url,
|
|
117
|
+
content: breadcrumb.item.name
|
|
118
|
+
}) : h("a", {
|
|
119
|
+
"class": _this.style['cdr-breadcrumb__link'],
|
|
120
|
+
"attrs": {
|
|
121
|
+
"href": breadcrumb.item.url
|
|
122
|
+
},
|
|
123
|
+
"on": {
|
|
124
|
+
"click": function click(e) {
|
|
125
|
+
return _this.$emit('navigate', breadcrumb, e);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, [breadcrumb.item.name]), delimiter]);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
},
|
|
133
|
+
watch: {
|
|
134
|
+
items() {
|
|
135
|
+
this.truncate = this.truncationEnabled && this.items.length > 2;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
},
|
|
139
|
+
methods: {
|
|
140
|
+
handleEllipsisClick() {
|
|
141
|
+
var _this2 = this;
|
|
142
|
+
|
|
143
|
+
this.truncate = false;
|
|
144
|
+
setTimeout(function () {
|
|
145
|
+
_this2.$el.querySelector('li *').focus();
|
|
146
|
+
}, 1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
render() {
|
|
152
|
+
var h = arguments[0];
|
|
153
|
+
return h("nav", {
|
|
154
|
+
"ref": "container",
|
|
155
|
+
"class": clsx(this.style[this.baseClass], this.modifierClass),
|
|
156
|
+
"attrs": {
|
|
157
|
+
"aria-label": "breadcrumbs"
|
|
158
|
+
}
|
|
159
|
+
}, [h("ol", {
|
|
160
|
+
"attrs": {
|
|
161
|
+
"id": "".concat(this.componentID, "List")
|
|
162
|
+
},
|
|
163
|
+
"ref": "cdrBreadcrumbList",
|
|
164
|
+
"class": this.style['cdr-breadcrumb__list']
|
|
165
|
+
}, [this.ellipsis, this.listItems])]);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default CdrBreadcrumb;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var modules_4b26c135 = {"cdr-breadcrumb":"cdr-breadcrumb_11-0-0-alpha-0","cdr-breadcrumb__list":"cdr-breadcrumb__list_11-0-0-alpha-0","cdr-breadcrumb__item":"cdr-breadcrumb__item_11-0-0-alpha-0","cdr-breadcrumb__link":"cdr-breadcrumb__link_11-0-0-alpha-0","cdr-breadcrumb__delimiter":"cdr-breadcrumb__delimiter_11-0-0-alpha-0","cdr-breadcrumb__ellipses":"cdr-breadcrumb__ellipses_11-0-0-alpha-0","cdr-breadcrumb__ellipses-icon":"cdr-breadcrumb__ellipses-icon_11-0-0-alpha-0"};
|
|
2
|
+
|
|
3
|
+
export default modules_4b26c135;
|