@tmorrow/cre8-wc 1.1.2 → 1.1.3
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/cdn/cre8-wc.esm.js +1 -1
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1 -1
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.js +129 -0
- package/lib/cdn-entry.js.map +1 -0
- package/lib/components/accordion/accordion.js +58 -40
- package/lib/components/accordion/accordion.js.map +1 -0
- package/lib/components/accordion/accordion.styles.js +4 -0
- package/lib/components/accordion/accordion.styles.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.js +187 -98
- package/lib/components/accordion-item/accordion-item.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.styles.js +4 -0
- package/lib/components/accordion-item/accordion-item.styles.js.map +1 -0
- package/lib/components/alert/alert.js +146 -107
- package/lib/components/alert/alert.js.map +1 -0
- package/lib/components/alert/alert.styles.js +4 -0
- package/lib/components/alert/alert.styles.js.map +1 -0
- package/lib/components/badge/badge.js +73 -50
- package/lib/components/badge/badge.js.map +1 -0
- package/lib/components/badge/badge.styles.js +4 -0
- package/lib/components/badge/badge.styles.js.map +1 -0
- package/lib/components/band/band.js +34 -31
- package/lib/components/band/band.js.map +1 -0
- package/lib/components/band/band.styles.js +4 -0
- package/lib/components/band/band.styles.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +52 -28
- package/lib/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js +4 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +28 -27
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js +4 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js.map +1 -0
- package/lib/components/button/button.js +297 -1040
- package/lib/components/button/button.js.map +1 -0
- package/lib/components/button/button.styles.js +885 -0
- package/lib/components/button/button.styles.js.map +1 -0
- package/lib/components/button-group/button-group.js +30 -27
- package/lib/components/button-group/button-group.js.map +1 -0
- package/lib/components/button-group/button-group.styles.js +4 -0
- package/lib/components/button-group/button-group.styles.js.map +1 -0
- package/lib/components/card/card.js +57 -35
- package/lib/components/card/card.js.map +1 -0
- package/lib/components/card/card.styles.js +4 -0
- package/lib/components/card/card.styles.js.map +1 -0
- package/lib/components/chart/chart.js +528 -354
- package/lib/components/chart/chart.js.map +1 -0
- package/lib/components/chart/chart.styles.js +4 -0
- package/lib/components/chart/chart.styles.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.js +66 -53
- package/lib/components/checkbox-field/checkbox-field.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js +4 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.js +252 -183
- package/lib/components/checkbox-field-item/checkbox-field-item.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js +4 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js.map +1 -0
- package/lib/components/contexts/form-internals-context.js +9 -0
- package/lib/components/contexts/form-internals-context.js.map +1 -0
- package/lib/components/cre8-element.js +57 -56
- package/lib/components/cre8-element.js.map +1 -0
- package/lib/components/cre8-form-element.js +212 -244
- package/lib/components/cre8-form-element.js.map +1 -0
- package/lib/components/danger-button/danger-button.js +274 -147
- package/lib/components/danger-button/danger-button.js.map +1 -0
- package/lib/components/danger-button/danger-button.styles.js +4 -0
- package/lib/components/danger-button/danger-button.styles.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.js +465 -0
- package/lib/components/date-picker/calendar/calendar.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.styles.js +4 -0
- package/lib/components/date-picker/calendar/calendar.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js +76 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js +110 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js +4 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js +116 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js.map +1 -0
- package/lib/components/date-picker/date-picker.js +91 -784
- package/lib/components/date-picker/date-picker.js.map +1 -0
- package/lib/components/date-picker/date-picker.styles.js +4 -0
- package/lib/components/date-picker/date-picker.styles.js.map +1 -0
- package/lib/components/divider/divider.js +45 -35
- package/lib/components/divider/divider.js.map +1 -0
- package/lib/components/divider/divider.styles.js +4 -0
- package/lib/components/divider/divider.styles.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +97 -63
- package/lib/components/dropdown/dropdown.js.map +1 -0
- package/lib/components/dropdown/dropdown.styles.js +4 -0
- package/lib/components/dropdown/dropdown.styles.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.js +38 -31
- package/lib/components/dropdown-item/dropdown-item.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js +4 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js.map +1 -0
- package/lib/components/feature/feature.js +40 -35
- package/lib/components/feature/feature.js.map +1 -0
- package/lib/components/feature/feature.styles.js +4 -0
- package/lib/components/feature/feature.styles.js.map +1 -0
- package/lib/components/field/field.js +218 -153
- package/lib/components/field/field.js.map +1 -0
- package/lib/components/field/field.styles.js +4 -0
- package/lib/components/field/field.styles.js.map +1 -0
- package/lib/components/field-note/field-note.js +58 -45
- package/lib/components/field-note/field-note.js.map +1 -0
- package/lib/components/field-note/field-note.styles.js +4 -0
- package/lib/components/field-note/field-note.styles.js.map +1 -0
- package/lib/components/footer/footer.js +25 -18
- package/lib/components/footer/footer.js.map +1 -0
- package/lib/components/footer/footer.styles.js +4 -0
- package/lib/components/footer/footer.styles.js.map +1 -0
- package/lib/components/global-nav/global-nav.js +44 -37
- package/lib/components/global-nav/global-nav.js.map +1 -0
- package/lib/components/global-nav/global-nav.styles.js +4 -0
- package/lib/components/global-nav/global-nav.styles.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.js +149 -112
- package/lib/components/global-nav-item/global-nav-item.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js +4 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js.map +1 -0
- package/lib/components/grid/grid.js +48 -45
- package/lib/components/grid/grid.js.map +1 -0
- package/lib/components/grid/grid.styles.js +4 -0
- package/lib/components/grid/grid.styles.js.map +1 -0
- package/lib/components/grid-item/grid-item.js +19 -16
- package/lib/components/grid-item/grid-item.js.map +1 -0
- package/lib/components/grid-item/grid-item.styles.js +4 -0
- package/lib/components/grid-item/grid-item.styles.js.map +1 -0
- package/lib/components/header/header.js +34 -29
- package/lib/components/header/header.js.map +1 -0
- package/lib/components/header/header.styles.js +4 -0
- package/lib/components/header/header.styles.js.map +1 -0
- package/lib/components/heading/heading.js +113 -76
- package/lib/components/heading/heading.js.map +1 -0
- package/lib/components/heading/heading.styles.js +4 -0
- package/lib/components/heading/heading.styles.js.map +1 -0
- package/lib/components/hero/hero.js +43 -40
- package/lib/components/hero/hero.js.map +1 -0
- package/lib/components/hero/hero.styles.js +4 -0
- package/lib/components/hero/hero.styles.js.map +1 -0
- package/lib/components/icon/icon.js +232 -9
- package/lib/components/icon/icon.js.map +1 -0
- package/lib/components/icon/icon.styles.js +4 -0
- package/lib/components/icon/icon.styles.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.js +114 -87
- package/lib/components/inline-alert/inline-alert.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.styles.js +4 -0
- package/lib/components/inline-alert/inline-alert.styles.js.map +1 -0
- package/lib/components/layout/layout.js +30 -27
- package/lib/components/layout/layout.js.map +1 -0
- package/lib/components/layout/layout.styles.js +4 -0
- package/lib/components/layout/layout.styles.js.map +1 -0
- package/lib/components/layout-container/layout-container.js +30 -27
- package/lib/components/layout-container/layout-container.js.map +1 -0
- package/lib/components/layout-container/layout-container.styles.js +4 -0
- package/lib/components/layout-container/layout-container.styles.js.map +1 -0
- package/lib/components/layout-section/layout-section.js +41 -33
- package/lib/components/layout-section/layout-section.js.map +1 -0
- package/lib/components/layout-section/layout-section.styles.js +4 -0
- package/lib/components/layout-section/layout-section.styles.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.js +19 -16
- package/lib/components/linelength-container/linelength-container.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.styles.js +4 -0
- package/lib/components/linelength-container/linelength-container.styles.js.map +1 -0
- package/lib/components/link/link.js +125 -87
- package/lib/components/link/link.js.map +1 -0
- package/lib/components/link/link.styles.js +4 -0
- package/lib/components/link/link.styles.js.map +1 -0
- package/lib/components/link-list/link-list.js +48 -45
- package/lib/components/link-list/link-list.js.map +1 -0
- package/lib/components/link-list/link-list.styles.js +4 -0
- package/lib/components/link-list/link-list.styles.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.js +40 -37
- package/lib/components/link-list-item/link-list-item.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.styles.js +4 -0
- package/lib/components/link-list-item/link-list-item.styles.js.map +1 -0
- package/lib/components/list/list.js +35 -32
- package/lib/components/list/list.js.map +1 -0
- package/lib/components/list/list.styles.js +4 -0
- package/lib/components/list/list.styles.js.map +1 -0
- package/lib/components/list-item/list-item.js +25 -21
- package/lib/components/list-item/list-item.js.map +1 -0
- package/lib/components/list-item/list-item.styles.js +4 -0
- package/lib/components/list-item/list-item.styles.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.js +126 -71
- package/lib/components/loading-spinner/loading-spinner.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js +4 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js.map +1 -0
- package/lib/components/logo/logo.js +28 -25
- package/lib/components/logo/logo.js.map +1 -0
- package/lib/components/logo/logo.styles.js +4 -0
- package/lib/components/logo/logo.styles.js.map +1 -0
- package/lib/components/main/main.js +29 -26
- package/lib/components/main/main.js.map +1 -0
- package/lib/components/main/main.styles.js +4 -0
- package/lib/components/main/main.styles.js.map +1 -0
- package/lib/components/modal/modal.js +174 -125
- package/lib/components/modal/modal.js.map +1 -0
- package/lib/components/modal/modal.styles.js +4 -0
- package/lib/components/modal/modal.styles.js.map +1 -0
- package/lib/components/multi-select/multi-select.js +300 -211
- package/lib/components/multi-select/multi-select.js.map +1 -0
- package/lib/components/multi-select/multi-select.styles.js +4 -0
- package/lib/components/multi-select/multi-select.styles.js.map +1 -0
- package/lib/components/nav-container/nav-container.js +19 -16
- package/lib/components/nav-container/nav-container.js.map +1 -0
- package/lib/components/nav-container/nav-container.styles.js +4 -0
- package/lib/components/nav-container/nav-container.styles.js.map +1 -0
- package/lib/components/page-header/page-header.js +36 -29
- package/lib/components/page-header/page-header.js.map +1 -0
- package/lib/components/page-header/page-header.styles.js +4 -0
- package/lib/components/page-header/page-header.styles.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.js +67 -0
- package/lib/components/pagination/page-counter/page-counter.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js +4 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js.map +1 -0
- package/lib/components/pagination/pagination.js +282 -237
- package/lib/components/pagination/pagination.js.map +1 -0
- package/lib/components/pagination/pagination.styles.js +4 -0
- package/lib/components/pagination/pagination.styles.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.js +56 -48
- package/lib/components/percent-bar/percent-bar.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.styles.js +4 -0
- package/lib/components/percent-bar/percent-bar.styles.js.map +1 -0
- package/lib/components/popover/popover.js +304 -179
- package/lib/components/popover/popover.js.map +1 -0
- package/lib/components/popover/popover.styles.js +4 -0
- package/lib/components/popover/popover.styles.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.js +44 -37
- package/lib/components/primary-nav/primary-nav.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.styles.js +4 -0
- package/lib/components/primary-nav/primary-nav.styles.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.js +151 -113
- package/lib/components/primary-nav-item/primary-nav-item.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js +4 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.js +74 -57
- package/lib/components/progress-meter/progress-meter.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.styles.js +4 -0
- package/lib/components/progress-meter/progress-meter.styles.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.js +19 -0
- package/lib/components/progress-steps/progress-steps.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.styles.js +4 -0
- package/lib/components/progress-steps/progress-steps.styles.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.js +52 -40
- package/lib/components/progress-steps-item/progress-steps-item.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js +4 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js.map +1 -0
- package/lib/components/radio-field/radio-field.js +59 -49
- package/lib/components/radio-field/radio-field.js.map +1 -0
- package/lib/components/radio-field/radio-field.styles.js +4 -0
- package/lib/components/radio-field/radio-field.styles.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.js +222 -179
- package/lib/components/radio-field-item/radio-field-item.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js +4 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.js +89 -60
- package/lib/components/remove-tag/remove-tag.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.styles.js +4 -0
- package/lib/components/remove-tag/remove-tag.styles.js.map +1 -0
- package/lib/components/section/section.js +46 -27
- package/lib/components/section/section.js.map +1 -0
- package/lib/components/section/section.styles.js +4 -0
- package/lib/components/section/section.styles.js.map +1 -0
- package/lib/components/select/select.js +243 -158
- package/lib/components/select/select.js.map +1 -0
- package/lib/components/select/select.styles.js +4 -0
- package/lib/components/select/select.styles.js.map +1 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js +60 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile-radio-controller.js +167 -0
- package/lib/components/select-tile/select-tile-radio-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile.js +228 -223
- package/lib/components/select-tile/select-tile.js.map +1 -0
- package/lib/components/select-tile/select-tile.styles.js +4 -0
- package/lib/components/select-tile/select-tile.styles.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.js +76 -62
- package/lib/components/select-tile-list/select-tile-list.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js +4 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.js +68 -39
- package/lib/components/skeleton-loader/skeleton-loader.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js +4 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js.map +1 -0
- package/lib/components/split-button/split-button.js +51 -46
- package/lib/components/split-button/split-button.js.map +1 -0
- package/lib/components/split-button/split-button.styles.js +4 -0
- package/lib/components/split-button/split-button.styles.js.map +1 -0
- package/lib/components/submenu/submenu.js +19 -16
- package/lib/components/submenu/submenu.js.map +1 -0
- package/lib/components/submenu/submenu.styles.js +4 -0
- package/lib/components/submenu/submenu.styles.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.js +32 -26
- package/lib/components/submenu-item/submenu-item.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.styles.js +4 -0
- package/lib/components/submenu-item/submenu-item.styles.js.map +1 -0
- package/lib/components/tab/tab.js +74 -63
- package/lib/components/tab/tab.js.map +1 -0
- package/lib/components/tab/tab.styles.js +4 -0
- package/lib/components/tab/tab.styles.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.js +49 -43
- package/lib/components/tab-panel/tab-panel.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.styles.js +4 -0
- package/lib/components/tab-panel/tab-panel.styles.js.map +1 -0
- package/lib/components/table/table.js +46 -41
- package/lib/components/table/table.js.map +1 -0
- package/lib/components/table/table.styles.js +4 -0
- package/lib/components/table/table.styles.js.map +1 -0
- package/lib/components/table-body/table-body.js +20 -17
- package/lib/components/table-body/table-body.js.map +1 -0
- package/lib/components/table-body/table-body.styles.js +4 -0
- package/lib/components/table-body/table-body.styles.js.map +1 -0
- package/lib/components/table-cell/table-cell.js +39 -36
- package/lib/components/table-cell/table-cell.js.map +1 -0
- package/lib/components/table-cell/table-cell.styles.js +4 -0
- package/lib/components/table-cell/table-cell.styles.js.map +1 -0
- package/lib/components/table-header/table-header.js +20 -17
- package/lib/components/table-header/table-header.js.map +1 -0
- package/lib/components/table-header/table-header.styles.js +4 -0
- package/lib/components/table-header/table-header.styles.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.js +35 -32
- package/lib/components/table-header-cell/table-header-cell.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js +4 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js.map +1 -0
- package/lib/components/table-object/table-object.js +21 -18
- package/lib/components/table-object/table-object.js.map +1 -0
- package/lib/components/table-object/table-object.styles.js +4 -0
- package/lib/components/table-object/table-object.styles.js.map +1 -0
- package/lib/components/table-row/table-row.js +76 -55
- package/lib/components/table-row/table-row.js.map +1 -0
- package/lib/components/table-row/table-row.styles.js +4 -0
- package/lib/components/table-row/table-row.styles.js.map +1 -0
- package/lib/components/tabs/tabs.js +452 -303
- package/lib/components/tabs/tabs.js.map +1 -0
- package/lib/components/tabs/tabs.styles.js +4 -0
- package/lib/components/tabs/tabs.styles.js.map +1 -0
- package/lib/components/tag/tag.js +236 -167
- package/lib/components/tag/tag.js.map +1 -0
- package/lib/components/tag/tag.styles.js +4 -0
- package/lib/components/tag/tag.styles.js.map +1 -0
- package/lib/components/tag-list/tag-list.js +40 -35
- package/lib/components/tag-list/tag-list.js.map +1 -0
- package/lib/components/tag-list/tag-list.styles.js +4 -0
- package/lib/components/tag-list/tag-list.styles.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.js +40 -33
- package/lib/components/tertiary-nav/tertiary-nav.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js +4 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +52 -43
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js +4 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js.map +1 -0
- package/lib/components/text-link/text-link.js +45 -41
- package/lib/components/text-link/text-link.js.map +1 -0
- package/lib/components/text-link/text-link.styles.js +4 -0
- package/lib/components/text-link/text-link.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.js +145 -0
- package/lib/components/text-passage/text-passage-light-dom.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js +4 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage.js +72 -44
- package/lib/components/text-passage/text-passage.js.map +1 -0
- package/lib/components/text-passage/text-passage.styles.js +4 -0
- package/lib/components/text-passage/text-passage.styles.js.map +1 -0
- package/lib/components/tooltip/tooltip.js +278 -173
- package/lib/components/tooltip/tooltip.js.map +1 -0
- package/lib/components/tooltip/tooltip.styles.js +4 -0
- package/lib/components/tooltip/tooltip.styles.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.js +40 -33
- package/lib/components/utility-nav/utility-nav.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.styles.js +4 -0
- package/lib/components/utility-nav/utility-nav.styles.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.js +70 -49
- package/lib/components/utility-nav-item/utility-nav-item.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js +4 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js.map +1 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js +737 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js +756 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js.map +1 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js +771 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js +772 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js +737 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js +983 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js.map +1 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js +737 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js +736 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js.map +1 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js +737 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js.map +1 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js +771 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js +552 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js +776 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js.map +1 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js +253 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/core/scss/theming/head.module.js +6 -0
- package/lib/design-tokens/core/scss/theming/head.module.js.map +1 -0
- package/lib/design-tokens/tokens_netflix.theme.js +806 -0
- package/lib/design-tokens/tokens_netflix.theme.js.map +1 -0
- package/lib/directives/if-truthy.js +24 -0
- package/lib/directives/if-truthy.js.map +1 -0
- package/lib/directives/spread.js +29 -0
- package/lib/directives/spread.js.map +1 -0
- package/lib/index.js +84 -168
- package/lib/index.js.map +1 -0
- package/lib/scripts/convert-scss-to-ts.js +25 -0
- package/lib/scripts/convert-scss-to-ts.js.map +1 -0
- package/lib/scripts/extract-tokens.js +120 -0
- package/lib/scripts/extract-tokens.js.map +1 -0
- package/lib/scripts/generate-react-wrappers.js +229 -0
- package/lib/scripts/generate-react-wrappers.js.map +1 -0
- package/lib/scripts/generateWesparkleThemes.js +52 -0
- package/lib/scripts/generateWesparkleThemes.js.map +1 -0
- package/lib/toBeAccessible.js +18 -0
- package/lib/toBeAccessible.js.map +1 -0
- package/lib/utilities/is-mobile.js +10 -0
- package/lib/utilities/is-mobile.js.map +1 -0
- package/lib/utilities/story-helpers.js +14 -0
- package/lib/utilities/story-helpers.js.map +1 -0
- package/lib/vite.config.cdn.js +85 -0
- package/lib/vite.config.cdn.js.map +1 -0
- package/lib/vite.config.js +156 -0
- package/lib/vite.config.js.map +1 -0
- package/package.json +8 -9
|
@@ -1,183 +1,269 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const g = `<svg fill="currentColor" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
-
<path d="M15.7869 4.87827L8.51452 12.1506C8.44698 12.2182 8.36677 12.2719 8.27849 12.3085C8.1902 12.3451 8.09557 12.3639 8 12.3639C7.90443 12.3639 7.8098 12.3451 7.72151 12.3085C7.63323 12.2719 7.55302 12.2182 7.48548 12.1506L0.213121 4.87827C0.0766618 4.74181 0 4.55673 0 4.36375C0 4.17077 0.0766618 3.98569 0.213121 3.84923C0.34958 3.71277 0.534658 3.63611 0.72764 3.63611C0.920622 3.63611 1.1057 3.71277 1.24216 3.84923L8 10.608L14.7578 3.84923C14.8254 3.78166 14.9056 3.72806 14.9939 3.6915C15.0822 3.65493 15.1768 3.63611 15.2724 3.63611C15.3679 3.63611 15.4625 3.65493 15.5508 3.6915C15.6391 3.72806 15.7193 3.78166 15.7869 3.84923C15.8544 3.9168 15.908 3.99701 15.9446 4.08529C15.9812 4.17357 16 4.26819 16 4.36375C16 4.4593 15.9812 4.55392 15.9446 4.6422C15.908 4.73049 15.8544 4.8107 15.7869 4.87827Z"/>
|
|
12
|
-
</svg>
|
|
13
|
-
`, v = `<svg fill="currentColor" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
-
<path d="M10.8969 5.97385L8.87 8L10.8969 10.0262C10.9541 10.0833 10.9995 10.1512 11.0304 10.2259C11.0613 10.3006 11.0773 10.3807 11.0773 10.4615C11.0773 10.5424 11.0613 10.6225 11.0304 10.6972C10.9995 10.7719 10.9541 10.8397 10.8969 10.8969C10.8397 10.9541 10.7719 10.9994 10.6972 11.0304C10.6225 11.0613 10.5424 11.0773 10.4615 11.0773C10.3807 11.0773 10.3006 11.0613 10.2259 11.0304C10.1512 10.9994 10.0833 10.9541 10.0262 10.8969L8 8.87L5.97385 10.8969C5.91667 10.9541 5.8488 10.9994 5.77409 11.0304C5.69939 11.0613 5.61932 11.0773 5.53846 11.0773C5.45761 11.0773 5.37754 11.0613 5.30283 11.0304C5.22813 10.9994 5.16025 10.9541 5.10308 10.8969C5.0459 10.8397 5.00055 10.7719 4.96961 10.6972C4.93866 10.6225 4.92274 10.5424 4.92274 10.4615C4.92274 10.3807 4.93866 10.3006 4.96961 10.2259C5.00055 10.1512 5.0459 10.0833 5.10308 10.0262L7.13 8L5.10308 5.97385C4.98761 5.85837 4.92274 5.70176 4.92274 5.53846C4.92274 5.37516 4.98761 5.21855 5.10308 5.10308C5.21855 4.9876 5.37516 4.92273 5.53846 4.92273C5.70176 4.92273 5.85838 4.9876 5.97385 5.10308L8 7.13L10.0262 5.10308C10.0833 5.0459 10.1512 5.00055 10.2259 4.9696C10.3006 4.93866 10.3807 4.92273 10.4615 4.92273C10.5424 4.92273 10.6225 4.93866 10.6972 4.9696C10.7719 5.00055 10.8397 5.0459 10.8969 5.10308C10.9541 5.16025 10.9995 5.22813 11.0304 5.30283C11.0613 5.37753 11.0773 5.4576 11.0773 5.53846C11.0773 5.61932 11.0613 5.69939 11.0304 5.77409C10.9995 5.84879 10.9541 5.91667 10.8969 5.97385ZM16 8C16 9.58225 15.5308 11.129 14.6518 12.4446C13.7727 13.7602 12.5233 14.7855 11.0615 15.391C9.59966 15.9965 7.99113 16.155 6.43928 15.8463C4.88743 15.5376 3.46197 14.7757 2.34315 13.6569C1.22433 12.538 0.462403 11.1126 0.153721 9.56072C-0.15496 8.00887 0.00346628 6.40034 0.608967 4.93853C1.21447 3.47672 2.23985 2.22729 3.55544 1.34824C4.87103 0.469192 6.41775 0 8 0C10.121 0.00223986 12.1546 0.845814 13.6544 2.34562C15.1542 3.84542 15.9978 5.87895 16 8ZM14.7692 8C14.7692 6.66117 14.3722 5.35241 13.6284 4.23922C12.8846 3.12602 11.8274 2.25839 10.5905 1.74605C9.35356 1.2337 7.99249 1.09965 6.67939 1.36084C5.36629 1.62203 4.16013 2.26674 3.21343 3.21343C2.26674 4.16012 1.62203 5.36629 1.36084 6.67939C1.09965 7.99249 1.2337 9.35356 1.74605 10.5905C2.2584 11.8274 3.12603 12.8846 4.23922 13.6284C5.35241 14.3722 6.66117 14.7692 8 14.7692C9.79469 14.7672 11.5153 14.0534 12.7843 12.7843C14.0534 11.5153 14.7672 9.79468 14.7692 8Z"/>
|
|
15
|
-
</svg>
|
|
16
|
-
`, _ = f`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:block}.cre8-c-multi-select{position:relative}.cre8-c-multi-select__label{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform);display:block;margin-bottom:0.5rem}.cre8-c-multi-select__body{display:flex;align-items:center;justify-content:space-between;position:relative;font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);outline:var(--cre8-border-width-focus) solid rgba(0,0,0,0);outline-offset:0.125rem;-webkit-appearance:none;width:100%;border-width:var(--cre8-border-width-default);border-style:solid;border-color:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.75rem 0.5rem;color:var(--cre8-color-content-default);background-color:var(--cre8-color-bg-default);transition:outline-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),border-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),background-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),color var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-multi-select__body:hover:not(:disabled),.cre8-c-multi-select__body:focus:not(:disabled),.cre8-c-multi-select__body:active:not(:disabled),.cre8-c-multi-select__body:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-multi-select__body:hover:not(:disabled),.cre8-is-error .cre8-c-multi-select__body:focus:not(:disabled),.cre8-is-error .cre8-c-multi-select__body:active:not(:disabled),.cre8-is-error .cre8-c-multi-select__body:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-multi-select__body:hover:not(:disabled),.cre8-is-success .cre8-c-multi-select__body:focus:not(:disabled),.cre8-is-success .cre8-c-multi-select__body:active:not(:disabled),.cre8-is-success .cre8-c-multi-select__body:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-multi-select__body:disabled{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed}.cre8-c-multi-select__body:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-multi-select__body::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-multi-select__body{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-multi-select__body{border-color:var(--cre8-color-border-success)}.cre8-c-multi-select__body{padding:var(--cre8-spacing-8);padding-inline-end:2.75rem;min-width:240px;cursor:pointer;min-height:3rem;height:fit-content}.cre8-is-disabled .cre8-c-multi-select__body{box-shadow:none;background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);cursor:not-allowed;outline:none}.cre8-is-disabled .cre8-c-multi-select__body:hover,.cre8-is-disabled .cre8-c-multi-select__body:focus,.cre8-is-disabled .cre8-c-multi-select__body:active,.cre8-is-disabled .cre8-c-multi-select__body:focus-visible{outline:none;background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled)}.cre8-is-disabled .cre8-c-multi-select__body .cre8-c-multi-select__content{border-color:var(--cre8-color-border-disabled)}.cre8-c-multi-select__content{display:flex;min-height:30px;width:100%;border-right:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);padding-right:2.75rem}.cre8-c-multi-select__tag-wrapper{list-style-type:none;margin:0;padding:0;display:flex;flex-wrap:wrap;height:100%;gap:0.25rem}.cre8-c-multi-select__icons-wrapper{display:flex;justify-content:end;margin-right:-36px;margin-left:-48px;gap:1.5rem;min-width:96px}.cre8-c-multi-select__icons-wrapper button{background-color:inherit;border:none;padding:none}.cre8-is-disabled .cre8-c-multi-select__icons-wrapper button{cursor:not-allowed}.cre8-c-multi-select--no-clear-icon .cre8-c-multi-select__clear_icon{display:none}cre8-icon{display:flex;pointer-events:none;color:var(--cre8-color-button-tertiary-content)}.cre8-is-disabled cre8-icon{color:var(--cre8-color-border-disabled)}.cre8-c-multi-select__dropdown{background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);box-shadow:var(--cre8-shadow-default);border-radius:var(--cre8-border-radius-default);flex-direction:column;left:0;min-width:100%;position:absolute;top:100%;white-space:nowrap;margin-top:var(--cre8-spacing-4);margin-left:0;padding:var(--cre8-spacing-8)}.cre8-c-multi-select__dropdown ul{list-style-type:none;padding:0;margin:0}.cre8-c-multi-select__dropdown li{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-focus) var(--cre8-border-style-default) var(--cre8-color-border-transparent);border-radius:var(--cre8-border-radius-default);color:var(--cre8-color-content-default);width:100%;cursor:pointer;margin:var(--cre8-spacing-0);padding:var(--cre8-spacing-8) var(--cre8-spacing-8);text-align:left}.cre8-c-multi-select__dropdown li:active,.cre8-c-multi-select__dropdown li:hover,.cre8-c-multi-select__dropdown li:focus{background-color:var(--cre8-color-bg-brand-hover);color:var(--cre8-color-content-default);outline:var(--cre8-border-width-none);border:var(--cre8-border-width-focus) var(--cre8-border-style-default) var(--cre8-color-border-active-outline)}.cre8-c-multi-select__field-note,.cre8-c-multi-select__field-note-success,.cre8-c-multi-select__field-note-error{flex-basis:100%}`;
|
|
17
|
-
var w = Object.defineProperty, i = (u, e, t, s) => {
|
|
18
|
-
for (var c = void 0, a = u.length - 1, d; a >= 0; a--)
|
|
19
|
-
(d = u[a]) && (c = d(e, t, c) || c);
|
|
20
|
-
return c && w(e, t, c), c;
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
/* eslint-disable no-duplicate-imports */
|
|
3
|
+
/* eslint-disable lit/no-template-arrow */
|
|
4
|
+
/* eslint-disable indent */
|
|
5
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
10
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
11
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
12
|
+
import { html, nothing, } from 'lit';
|
|
13
|
+
import { property, state } from 'lit/decorators.js';
|
|
14
|
+
import { nanoid } from 'nanoid';
|
|
15
|
+
import svgCaretDown from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Down.svg?raw';
|
|
16
|
+
import svgClear from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Clear_X.svg?raw';
|
|
17
|
+
import styles from './multi-select.styles.js';
|
|
18
|
+
import { Cre8Element } from '../cre8-element';
|
|
19
|
+
import '../remove-tag/remove-tag';
|
|
20
|
+
import '../field-note/field-note';
|
|
21
|
+
import '../button/button';
|
|
22
|
+
import '../checkbox-field-item/checkbox-field-item';
|
|
23
|
+
/**
|
|
24
|
+
* Multiselect is used when multiple options can be chosen from a static dropdown
|
|
25
|
+
* This component has a list of items in the dropdown that can be added as "selected tags"
|
|
26
|
+
* The checkbox will always reflect the selected nature of the item and is not removed
|
|
27
|
+
* from the dropdown when clicked, the tags will be added and removed based on their state.
|
|
28
|
+
*
|
|
29
|
+
* Event `selectedItemsChange` emits whenever a tag is added or remove from the list and the
|
|
30
|
+
* current list after the change is given in the detail.
|
|
31
|
+
*/
|
|
32
|
+
export class Cre8MultiSelect extends Cre8Element {
|
|
33
|
+
/* Life Cycle Methods */
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
/**
|
|
37
|
+
* The list of string items the user can choose in the dropdown
|
|
38
|
+
*
|
|
39
|
+
* Note: For passing props containing arrays and complex types, you should pass the props using a
|
|
40
|
+
* period in from of the prop like so: `.items="[]"`
|
|
41
|
+
* (this is only needed for Web Components and not the React version)
|
|
42
|
+
* @attr {string[]}
|
|
43
|
+
*/
|
|
44
|
+
this.items = [];
|
|
45
|
+
this.selectedTagItems = [];
|
|
46
|
+
this.dropdownOpen = false;
|
|
47
|
+
this._handleOnClick = this._handleOnClick.bind(this);
|
|
48
|
+
}
|
|
49
|
+
firstUpdated() {
|
|
50
|
+
if (this.preselectedItems)
|
|
51
|
+
this.setPreselectedItemsinDropdown();
|
|
52
|
+
this.selectedTagItems = this.preselectedItems || [];
|
|
53
|
+
this._initializeAria();
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
window.addEventListener('click', this._handleOnClick, false);
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
super.disconnectedCallback();
|
|
61
|
+
window.removeEventListener('click', this._handleOnClick, false);
|
|
62
|
+
}
|
|
63
|
+
/* HTML Content functions */
|
|
64
|
+
_renderDropdownItems() {
|
|
65
|
+
return this.items.map(
|
|
66
|
+
// Note: Keyboard can already navigate to the checkbox
|
|
67
|
+
// eslint-disable-next-line lit-a11y/click-events-have-key-events
|
|
68
|
+
(item, index) => html `<li
|
|
69
|
+
@click="${(e) => this._handleListItemClick(e, index)}"
|
|
43
70
|
>
|
|
44
71
|
<cre8-checkbox-field-item
|
|
45
|
-
.checked="${!!this.selectedTagItems.includes(
|
|
46
|
-
label=${
|
|
47
|
-
id=${
|
|
48
|
-
@input="${(
|
|
72
|
+
.checked="${!!this.selectedTagItems.includes(item)}"
|
|
73
|
+
label=${item}
|
|
74
|
+
id=${index}
|
|
75
|
+
@input="${(e) => this._handleDropdownItemInput(item, e)}"
|
|
49
76
|
>
|
|
50
77
|
</cre8-checkbox-field-item>
|
|
51
|
-
</li>`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
78
|
+
</li>`);
|
|
79
|
+
}
|
|
80
|
+
_renderSelectedTags() {
|
|
81
|
+
if (!this.selectedTagItems.length) {
|
|
82
|
+
return nothing;
|
|
83
|
+
}
|
|
84
|
+
return this.selectedTagItems.map((item) => html `<li>
|
|
57
85
|
<cre8-remove-tag
|
|
58
|
-
text="${
|
|
86
|
+
text="${item}"
|
|
59
87
|
color="neutral"
|
|
60
88
|
shape="square"
|
|
61
89
|
?disabled="${this.disabled}"
|
|
62
|
-
@removeTagClicked="${() => this._handleRemoveTagClick(
|
|
90
|
+
@removeTagClicked="${() => this._handleRemoveTagClick(item)}"
|
|
63
91
|
></cre8-remove-tag>
|
|
64
|
-
</li>`
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
92
|
+
</li>`);
|
|
93
|
+
}
|
|
94
|
+
/* Helper Functions */
|
|
95
|
+
setPreselectedItemsinDropdown() {
|
|
96
|
+
this.preselectedItems.forEach((item) => {
|
|
97
|
+
this.selectedTagItems = this.selectedTagItems.concat(item);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
clearAllTags() {
|
|
101
|
+
if (!this.disabled) {
|
|
102
|
+
if (this.dropdownOpen) {
|
|
103
|
+
this.selectedTagItems.forEach((item) => {
|
|
104
|
+
this.shadowRoot
|
|
105
|
+
?.querySelector(`cre8-checkbox-field-item[label="${item}"]`)
|
|
106
|
+
.shadowRoot?.querySelector('input')
|
|
107
|
+
.click();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
this.selectedTagItems = [];
|
|
111
|
+
this.emitSelectedItems();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
emitSelectedItems() {
|
|
115
|
+
const customEvent = new CustomEvent('selectedItemsChange', {
|
|
116
|
+
detail: {
|
|
117
|
+
selectedItems: this.selectedTagItems,
|
|
118
|
+
},
|
|
119
|
+
bubbles: true,
|
|
120
|
+
composed: true,
|
|
121
|
+
});
|
|
122
|
+
this.dispatchEvent(customEvent);
|
|
123
|
+
}
|
|
124
|
+
toggleDropDown() {
|
|
125
|
+
this.dropdownOpen = !this.dropdownOpen;
|
|
126
|
+
}
|
|
127
|
+
/* Click Event Functions */
|
|
128
|
+
_handleOnClick(event) {
|
|
129
|
+
if (!this.shadowRoot?.host) {
|
|
130
|
+
throw Error('Could not determine navigation context during click handler');
|
|
131
|
+
}
|
|
132
|
+
const didClickInside = event.composedPath().includes(this.shadowRoot.host);
|
|
133
|
+
const label = this.renderRoot.querySelector('.cre8-c-multi-select__label');
|
|
134
|
+
const buttonsWrapper = this.renderRoot.querySelector('.cre8-c-multi-select__icons-wrapper');
|
|
135
|
+
const removeTagWrapper = this.shadowRoot?.querySelector('.cre8-c-multi-select__tag-wrapper');
|
|
136
|
+
const dropdownWrapper = this.shadowRoot?.querySelector('.cre8-c-multi-select__dropdown');
|
|
137
|
+
if (!didClickInside) {
|
|
138
|
+
this.dropdownOpen = false;
|
|
139
|
+
}
|
|
140
|
+
else if (!event.composedPath().includes(label)
|
|
141
|
+
&& !event.composedPath().includes(removeTagWrapper)
|
|
142
|
+
&& !event.composedPath().includes(buttonsWrapper)
|
|
143
|
+
&& !event.composedPath().includes(dropdownWrapper)
|
|
144
|
+
&& !this.disabled) {
|
|
145
|
+
this.toggleDropDown();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
_handleListItemClick(e, index) {
|
|
149
|
+
if (e.target
|
|
150
|
+
!== this.shadowRoot?.querySelector(`cre8-checkbox-field-item[id="${index}"]`)) {
|
|
151
|
+
this.shadowRoot
|
|
152
|
+
?.querySelector(`cre8-checkbox-field-item[id="${index}"]`)
|
|
153
|
+
.shadowRoot?.querySelector('input')
|
|
154
|
+
.click();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
_handleDropdownItemInput(item, e) {
|
|
158
|
+
const targetCheckbox = e.target;
|
|
159
|
+
if (targetCheckbox.checked) {
|
|
160
|
+
this.selectedTagItems = this.selectedTagItems.concat(item);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this.selectedTagItems = this.selectedTagItems.filter((i) => i !== item);
|
|
164
|
+
}
|
|
165
|
+
this.emitSelectedItems();
|
|
166
|
+
}
|
|
167
|
+
async _handleRemoveTagClick(item) {
|
|
168
|
+
if (!this.disabled) {
|
|
169
|
+
this.selectedTagItems = this.selectedTagItems.filter((i) => i !== item);
|
|
170
|
+
this.shadowRoot
|
|
171
|
+
?.querySelector(`cre8-checkbox-field-item[label="${item}"]`)
|
|
172
|
+
.shadowRoot?.querySelector('input')
|
|
173
|
+
.click();
|
|
174
|
+
await this.updateComplete;
|
|
175
|
+
this.emitSelectedItems();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
dropdownArrowClick() {
|
|
179
|
+
if (!this.disabled) {
|
|
180
|
+
this.toggleDropDown();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
_handleButtonToListKeydown(e) {
|
|
184
|
+
if (e.code === 'Escape') {
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
this.toggleDropDown();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
_handleListKeydown(e) {
|
|
190
|
+
if (e.code === 'Escape') {
|
|
191
|
+
e.preventDefault();
|
|
192
|
+
this.toggleDropDown();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
_initializeAria() {
|
|
196
|
+
this.fieldId = this.fieldId || nanoid();
|
|
197
|
+
if (this.fieldNote || this.slotNotEmpty('fieldNote')) {
|
|
198
|
+
this.ariaDescribedBy = this.ariaDescribedBy || nanoid();
|
|
199
|
+
}
|
|
200
|
+
if (this.successNote || this.errorNote) {
|
|
201
|
+
this.validationAriaDescribedBy = this.validationAriaDescribedBy || nanoid();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Aria describedby string based on field notes and error/success notes
|
|
206
|
+
* 1) If both validationAriaDescribedBy (error/success note) and field note exists,
|
|
207
|
+
* render both in the input's `aria-describedby` attribute
|
|
208
|
+
* 2) Otherwise, if only validationAriaDescribedBy exists, then render only that as
|
|
209
|
+
* the `aria-describedby` attribute (input without field note initially, but then error/success is added).
|
|
210
|
+
* 3) Otherwise, render only the `ariaDescribedBy` property (field note only)
|
|
211
|
+
*/
|
|
212
|
+
_fieldNoteAria() {
|
|
213
|
+
if (this.validationAriaDescribedBy && this.ariaDescribedBy) {
|
|
214
|
+
return `${this.ariaDescribedBy} ${this.validationAriaDescribedBy}`; /* 1 */
|
|
215
|
+
}
|
|
216
|
+
if (this.validationAriaDescribedBy && !this.ariaDescribedBy) {
|
|
217
|
+
return this.validationAriaDescribedBy; /* 2 */
|
|
218
|
+
}
|
|
219
|
+
return this.ariaDescribedBy; /* 3 */
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Render the success or error field notes
|
|
223
|
+
* 1. If there is a successNote, then return the field note with the success message and state.
|
|
224
|
+
* 2. If there is a errorNote, then return the field note with the error message and state.
|
|
225
|
+
*/
|
|
226
|
+
_renderSuccessErrorFieldNote() {
|
|
227
|
+
if (this.successNote) {
|
|
228
|
+
/* 1 */
|
|
229
|
+
return html ` <cre8-field-note
|
|
147
230
|
?isSuccess=${this.isSuccess}
|
|
148
231
|
id=${this.validationAriaDescribedBy}
|
|
149
232
|
class="cre8-c-multi-select__field-note-success"
|
|
150
233
|
iconName="success"
|
|
151
234
|
>
|
|
152
235
|
${this.successNote}
|
|
153
|
-
</cre8-field-note
|
|
236
|
+
</cre8-field-note>`;
|
|
237
|
+
}
|
|
238
|
+
if (this.errorNote) {
|
|
239
|
+
/* 2 */
|
|
240
|
+
return html ` <cre8-field-note
|
|
154
241
|
?isError=${this.isError}
|
|
155
242
|
id=${this.validationAriaDescribedBy}
|
|
156
243
|
class="cre8-c-multi-select__field-note-error"
|
|
157
244
|
iconName="error-alt"
|
|
158
245
|
>
|
|
159
246
|
${this.errorNote}
|
|
160
|
-
</cre8-field-note
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<div class="${e}">
|
|
247
|
+
</cre8-field-note>`;
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
render() {
|
|
252
|
+
const componentClassNames = this.componentClassNames('cre8-c-multi-select', {
|
|
253
|
+
'cre8-is-error': this.isError,
|
|
254
|
+
'cre8-is-success': this.isSuccess,
|
|
255
|
+
'cre8-is-disabled': this.disabled,
|
|
256
|
+
'cre8-c-multi-select--no-clear-icon': !this.selectedTagItems.length,
|
|
257
|
+
});
|
|
258
|
+
return html `
|
|
259
|
+
<div class="${componentClassNames}">
|
|
174
260
|
<label class="cre8-c-multi-select__label" id="${this.fieldId}"
|
|
175
261
|
>${this.label}</label
|
|
176
262
|
>
|
|
177
263
|
<div class="cre8-c-multi-select__body" ?disabled=${this.disabled}>
|
|
178
264
|
<div
|
|
179
265
|
class="cre8-c-multi-select__content"
|
|
180
|
-
aria-describedby="${
|
|
266
|
+
aria-describedby="${ifDefined(this._fieldNoteAria())}"
|
|
181
267
|
>
|
|
182
268
|
<ul
|
|
183
269
|
class="cre8-c-multi-select__tag-wrapper"
|
|
@@ -188,8 +274,8 @@ const p = class p extends y {
|
|
|
188
274
|
</div>
|
|
189
275
|
<div class="cre8-c-multi-select__icons-wrapper">
|
|
190
276
|
<cre8-button
|
|
191
|
-
?hideText=${
|
|
192
|
-
svg="${
|
|
277
|
+
?hideText=${true}
|
|
278
|
+
svg="${svgClear}"
|
|
193
279
|
text="Clear All"
|
|
194
280
|
variant="tertiary"
|
|
195
281
|
?disabled="${this.disabled}"
|
|
@@ -198,8 +284,8 @@ const p = class p extends y {
|
|
|
198
284
|
>
|
|
199
285
|
</cre8-button>
|
|
200
286
|
<cre8-button
|
|
201
|
-
?hideText=${
|
|
202
|
-
svg="${
|
|
287
|
+
?hideText=${true}
|
|
288
|
+
svg="${svgCaretDown}"
|
|
203
289
|
variant="tertiary"
|
|
204
290
|
?disabled="${this.disabled}"
|
|
205
291
|
class="cre8-c-multi-select__down_icon"
|
|
@@ -212,7 +298,8 @@ const p = class p extends y {
|
|
|
212
298
|
</cre8-button>
|
|
213
299
|
</div>
|
|
214
300
|
</div>
|
|
215
|
-
${this.dropdownOpen
|
|
301
|
+
${this.dropdownOpen
|
|
302
|
+
? html `
|
|
216
303
|
<fieldset class="cre8-c-multi-select__dropdown" aria-describedby="${this.fieldId}">
|
|
217
304
|
<ul
|
|
218
305
|
aria-label="available items"
|
|
@@ -220,64 +307,66 @@ const p = class p extends y {
|
|
|
220
307
|
>
|
|
221
308
|
${this._renderDropdownItems()}
|
|
222
309
|
</ul>
|
|
223
|
-
</fieldset>`
|
|
310
|
+
</fieldset>`
|
|
311
|
+
: nothing}
|
|
224
312
|
</div>
|
|
225
|
-
${this.fieldNote || this.slotNotEmpty(
|
|
313
|
+
${this.fieldNote || this.slotNotEmpty('fieldNote')
|
|
314
|
+
? html `<cre8-field-note
|
|
226
315
|
id=${this.ariaDescribedBy}
|
|
227
316
|
class="cre8-c-multi-select__field-note"
|
|
228
317
|
>
|
|
229
318
|
<slot name="fieldNote">${this.fieldNote}</slot>
|
|
230
|
-
</cre8-field-note>`
|
|
319
|
+
</cre8-field-note>`
|
|
320
|
+
: nothing}
|
|
231
321
|
${this._renderSuccessErrorFieldNote()}
|
|
232
322
|
`;
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
customElements.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
Cre8MultiSelect.styles = [styles];
|
|
326
|
+
__decorate([
|
|
327
|
+
property({ type: Array })
|
|
328
|
+
], Cre8MultiSelect.prototype, "items", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
state()
|
|
331
|
+
], Cre8MultiSelect.prototype, "selectedTagItems", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
property({ type: Array })
|
|
334
|
+
], Cre8MultiSelect.prototype, "preselectedItems", void 0);
|
|
335
|
+
__decorate([
|
|
336
|
+
state()
|
|
337
|
+
], Cre8MultiSelect.prototype, "dropdownOpen", void 0);
|
|
338
|
+
__decorate([
|
|
339
|
+
property()
|
|
340
|
+
], Cre8MultiSelect.prototype, "label", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
property()
|
|
343
|
+
], Cre8MultiSelect.prototype, "fieldId", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
property()
|
|
346
|
+
], Cre8MultiSelect.prototype, "fieldNote", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
property()
|
|
349
|
+
], Cre8MultiSelect.prototype, "ariaDescribedBy", void 0);
|
|
350
|
+
__decorate([
|
|
351
|
+
property()
|
|
352
|
+
], Cre8MultiSelect.prototype, "validationAriaDescribedBy", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
property({ type: Boolean, reflect: true })
|
|
355
|
+
], Cre8MultiSelect.prototype, "disabled", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
property({ type: Boolean, reflect: true })
|
|
358
|
+
], Cre8MultiSelect.prototype, "isError", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
property()
|
|
361
|
+
], Cre8MultiSelect.prototype, "errorNote", void 0);
|
|
362
|
+
__decorate([
|
|
363
|
+
property({ type: Boolean, reflect: true })
|
|
364
|
+
], Cre8MultiSelect.prototype, "isSuccess", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
property()
|
|
367
|
+
], Cre8MultiSelect.prototype, "successNote", void 0);
|
|
368
|
+
if (customElements.get('cre8-multi-select') === undefined) {
|
|
369
|
+
customElements.define('cre8-multi-select', Cre8MultiSelect);
|
|
370
|
+
}
|
|
371
|
+
export default Cre8MultiSelect;
|
|
372
|
+
//# sourceMappingURL=multi-select.js.map
|