@tmorrow/cre8-wc 1.1.2 → 1.1.4
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/fonts.css +31 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.css +248 -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/blue/css/tokens_brand.css +492 -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/fonts.css +35 -0
- package/lib/design-tokens/brands/cre8/css/tokens_brand.css +494 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.css +767 -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/fonts.css +35 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_brand.css +494 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.css +248 -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/fonts.css +47 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_brand.css +464 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.css +0 -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/fonts.css +35 -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/fonts.css +26 -0
- package/lib/design-tokens/brands/legacy/css/tokens_brand.css +491 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.css +250 -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/fonts.css +31 -0
- package/lib/design-tokens/brands/marketing/css/tokens_brand.css +502 -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/fonts.css +26 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_brand.css +492 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.css +736 -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/figma-tokens.css +339 -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/fonts.css +26 -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/tmorrow/css/tokens_brand.css +104 -0
- package/lib/design-tokens/brands/tmorrow/css/tokens_tmorrow-frost.css +222 -0
- package/lib/design-tokens/brands/tmorrow/css/tokens_tmorrow-neon.css +218 -0
- package/lib/design-tokens/capitalone/fonts.css +26 -0
- package/lib/design-tokens/capitalone/overrides.css +33 -0
- package/lib/design-tokens/capitalone/tokens.module.css +532 -0
- package/lib/design-tokens/core/scss/abstracts/functions.css +0 -0
- package/lib/design-tokens/core/scss/theming/animation.css +1 -0
- package/lib/design-tokens/core/scss/theming/body.css +1 -0
- package/lib/design-tokens/core/scss/theming/breakpoints.css +0 -0
- package/lib/design-tokens/core/scss/theming/component.css +1 -0
- package/lib/design-tokens/core/scss/theming/display.css +1 -0
- package/lib/design-tokens/core/scss/theming/head.css +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/core/scss/theming/spacing.css +1 -0
- package/lib/design-tokens/core/scss/theming/typography-usage.css +0 -0
- package/lib/design-tokens/core/scss/theming/variables.css +1 -0
- package/lib/design-tokens/core/scss/theming/visibility.css +1 -0
- package/lib/design-tokens/core/scss/utilities/animation.css +1 -0
- package/lib/design-tokens/core/scss/utilities/colors.css +1 -0
- package/lib/design-tokens/core/scss/utilities/display.css +1 -0
- package/lib/design-tokens/femmecubator/equity.css +142 -0
- package/lib/design-tokens/femmecubator/fonts.css +35 -0
- package/lib/design-tokens/femmecubator/tokens_brand.css +146 -0
- package/lib/design-tokens/femmecubator/tokens_femmecubator.module.css +247 -0
- package/lib/design-tokens/figma-tokens.css +0 -0
- package/lib/design-tokens/mcdonalds/tokens.module.css +58 -0
- package/lib/design-tokens/target/fonts.css +26 -0
- package/lib/design-tokens/target/tokens.module.css +738 -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
- package/lib/design-tokens/brands copy/blue/_base.scss +0 -142
- package/lib/design-tokens/brands copy/blue/badge.scss +0 -5
- package/lib/design-tokens/brands copy/blue/bg.scss +0 -35
- package/lib/design-tokens/brands copy/blue/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/blue/border.scss +0 -21
- package/lib/design-tokens/brands copy/blue/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/blue/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/blue/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/blue/button.scss +0 -225
- package/lib/design-tokens/brands copy/blue/content.scss +0 -29
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.d.ts +0 -3
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.d.ts.map +0 -1
- package/lib/design-tokens/brands copy/blue/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/blue/fontFamilies.scss +0 -5
- package/lib/design-tokens/brands copy/blue/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/blue/fontWeights.scss +0 -7
- package/lib/design-tokens/brands copy/blue/footer.scss +0 -9
- package/lib/design-tokens/brands copy/blue/header.scss +0 -81
- package/lib/design-tokens/brands copy/blue/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/blue/letterSpacing.scss +0 -9
- package/lib/design-tokens/brands copy/blue/lineHeights.scss +0 -15
- package/lib/design-tokens/brands copy/blue/link.scss +0 -4
- package/lib/design-tokens/brands copy/blue/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/blue/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/blue/progress-meter.scss +0 -4
- package/lib/design-tokens/brands copy/blue/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/blue/spacing.scss +0 -21
- package/lib/design-tokens/brands copy/blue/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/blue/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/blue/tokens-all-blue.scss +0 -628
- package/lib/design-tokens/brands copy/blue/tokens-brand.scss +0 -31
- package/lib/design-tokens/brands copy/blue-v1/_base.scss +0 -76
- package/lib/design-tokens/brands copy/blue-v1/badge.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/bg.scss +0 -34
- package/lib/design-tokens/brands copy/blue-v1/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/border.scss +0 -21
- package/lib/design-tokens/brands copy/blue-v1/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/blue-v1/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/blue-v1/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/blue-v1/button.scss +0 -199
- package/lib/design-tokens/brands copy/blue-v1/content.scss +0 -29
- package/lib/design-tokens/brands copy/blue-v1/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/fontFamilies.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/blue-v1/fontWeights.scss +0 -9
- package/lib/design-tokens/brands copy/blue-v1/footer.scss +0 -9
- package/lib/design-tokens/brands copy/blue-v1/header.scss +0 -79
- package/lib/design-tokens/brands copy/blue-v1/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/blue-v1/letterSpacing.scss +0 -9
- package/lib/design-tokens/brands copy/blue-v1/lineHeights.scss +0 -15
- package/lib/design-tokens/brands copy/blue-v1/link.scss +0 -4
- package/lib/design-tokens/brands copy/blue-v1/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/blue-v1/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/blue-v1/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/blue-v1/spacing.scss +0 -21
- package/lib/design-tokens/brands copy/blue-v1/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/blue-v1/tokens-all-blue-v1.scss +0 -534
- package/lib/design-tokens/brands copy/blue-v1/tokens-brand.scss +0 -30
- package/lib/design-tokens/brands copy/cre8/_base.scss +0 -157
- package/lib/design-tokens/brands copy/cre8/badge.scss +0 -5
- package/lib/design-tokens/brands copy/cre8/bg.scss +0 -34
- package/lib/design-tokens/brands copy/cre8/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/cre8/border.scss +0 -18
- package/lib/design-tokens/brands copy/cre8/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/cre8/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/cre8/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/cre8/button.scss +0 -211
- package/lib/design-tokens/brands copy/cre8/content.scss +0 -29
- package/lib/design-tokens/brands copy/cre8/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/cre8/fontFamilies.scss +0 -4
- package/lib/design-tokens/brands copy/cre8/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/cre8/fontWeights.scss +0 -7
- package/lib/design-tokens/brands copy/cre8/footer.scss +0 -8
- package/lib/design-tokens/brands copy/cre8/header.scss +0 -81
- package/lib/design-tokens/brands copy/cre8/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/cre8/letterSpacing.scss +0 -10
- package/lib/design-tokens/brands copy/cre8/lineHeights.scss +0 -22
- package/lib/design-tokens/brands copy/cre8/link.scss +0 -4
- package/lib/design-tokens/brands copy/cre8/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/cre8/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/cre8/progress-meter.scss +0 -4
- package/lib/design-tokens/brands copy/cre8/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/cre8/spacing.scss +0 -21
- package/lib/design-tokens/brands copy/cre8/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/cre8/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/cre8/tokens-all-cre8.scss +0 -631
- package/lib/design-tokens/brands copy/cre8/tokens-brand.scss +0 -31
- package/lib/design-tokens/brands copy/femmecubator/base.scss +0 -64
- package/lib/design-tokens/brands copy/femmecubator/border.scss +0 -15
- package/lib/design-tokens/brands copy/femmecubator/color.scss +0 -56
- package/lib/design-tokens/brands copy/femmecubator/spacing.scss +0 -13
- package/lib/design-tokens/brands copy/femmecubator/tokens-all-femmecubator.scss +0 -139
- package/lib/design-tokens/brands copy/femmecubator/tokens-brand.scss +0 -8
- package/lib/design-tokens/brands copy/legacy/_base.scss +0 -103
- package/lib/design-tokens/brands copy/legacy/badge.scss +0 -5
- package/lib/design-tokens/brands copy/legacy/bg.scss +0 -34
- package/lib/design-tokens/brands copy/legacy/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/legacy/border.scss +0 -17
- package/lib/design-tokens/brands copy/legacy/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/legacy/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/legacy/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/legacy/button.scss +0 -225
- package/lib/design-tokens/brands copy/legacy/content.scss +0 -29
- package/lib/design-tokens/brands copy/legacy/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/legacy/fontFamilies.scss +0 -4
- package/lib/design-tokens/brands copy/legacy/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/legacy/fontWeights.scss +0 -10
- package/lib/design-tokens/brands copy/legacy/footer.scss +0 -9
- package/lib/design-tokens/brands copy/legacy/header.scss +0 -81
- package/lib/design-tokens/brands copy/legacy/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/legacy/letterSpacing.scss +0 -9
- package/lib/design-tokens/brands copy/legacy/lineHeights.scss +0 -19
- package/lib/design-tokens/brands copy/legacy/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/legacy/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/legacy/progress-meter.scss +0 -4
- package/lib/design-tokens/brands copy/legacy/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/legacy/spacing.scss +0 -20
- package/lib/design-tokens/brands copy/legacy/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/legacy/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/legacy/tokens-all-legacy.scss +0 -588
- package/lib/design-tokens/brands copy/legacy/tokens-brand.scss +0 -30
- package/lib/design-tokens/brands copy/marketing/_base.scss +0 -137
- package/lib/design-tokens/brands copy/marketing/asset.scss +0 -7
- package/lib/design-tokens/brands copy/marketing/badge.scss +0 -5
- package/lib/design-tokens/brands copy/marketing/bg.scss +0 -35
- package/lib/design-tokens/brands copy/marketing/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/marketing/border.scss +0 -21
- package/lib/design-tokens/brands copy/marketing/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/marketing/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/marketing/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/marketing/button.scss +0 -225
- package/lib/design-tokens/brands copy/marketing/content.scss +0 -29
- package/lib/design-tokens/brands copy/marketing/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/marketing/fontFamilies.scss +0 -4
- package/lib/design-tokens/brands copy/marketing/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/marketing/fontWeights.scss +0 -7
- package/lib/design-tokens/brands copy/marketing/footer.scss +0 -9
- package/lib/design-tokens/brands copy/marketing/header.scss +0 -81
- package/lib/design-tokens/brands copy/marketing/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/marketing/letterSpacing.scss +0 -9
- package/lib/design-tokens/brands copy/marketing/lineHeights.scss +0 -22
- package/lib/design-tokens/brands copy/marketing/link.scss +0 -4
- package/lib/design-tokens/brands copy/marketing/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/marketing/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/marketing/progress-meter.scss +0 -4
- package/lib/design-tokens/brands copy/marketing/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/marketing/spacing.scss +0 -21
- package/lib/design-tokens/brands copy/marketing/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/marketing/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/marketing/tokens-all-marketing.scss +0 -633
- package/lib/design-tokens/brands copy/marketing/tokens-brand.scss +0 -32
- package/lib/design-tokens/brands copy/minimalist/_base.scss +0 -81
- package/lib/design-tokens/brands copy/minimalist/asset.scss +0 -6
- package/lib/design-tokens/brands copy/minimalist/badge.scss +0 -5
- package/lib/design-tokens/brands copy/minimalist/bg.scss +0 -34
- package/lib/design-tokens/brands copy/minimalist/border-style.scss +0 -5
- package/lib/design-tokens/brands copy/minimalist/border.scss +0 -17
- package/lib/design-tokens/brands copy/minimalist/borderRadius.scss +0 -15
- package/lib/design-tokens/brands copy/minimalist/borderWidth.scss +0 -11
- package/lib/design-tokens/brands copy/minimalist/breakpoint.scss +0 -9
- package/lib/design-tokens/brands copy/minimalist/button.scss +0 -225
- package/lib/design-tokens/brands copy/minimalist/content.scss +0 -29
- package/lib/design-tokens/brands copy/minimalist/desktop-menu.scss +0 -5
- package/lib/design-tokens/brands copy/minimalist/fontFamilies.scss +0 -4
- package/lib/design-tokens/brands copy/minimalist/fontFamily.scss +0 -4
- package/lib/design-tokens/brands copy/minimalist/fontSize.scss +0 -17
- package/lib/design-tokens/brands copy/minimalist/fontWeights.scss +0 -6
- package/lib/design-tokens/brands copy/minimalist/footer.scss +0 -9
- package/lib/design-tokens/brands copy/minimalist/header.scss +0 -81
- package/lib/design-tokens/brands copy/minimalist/icon-size.scss +0 -6
- package/lib/design-tokens/brands copy/minimalist/letterSpacing.scss +0 -9
- package/lib/design-tokens/brands copy/minimalist/lineHeights.scss +0 -20
- package/lib/design-tokens/brands copy/minimalist/paragraphIndent.scss +0 -4
- package/lib/design-tokens/brands copy/minimalist/paragraphSpacing.scss +0 -4
- package/lib/design-tokens/brands copy/minimalist/progress-meter.scss +0 -4
- package/lib/design-tokens/brands copy/minimalist/shadow.scss +0 -8
- package/lib/design-tokens/brands copy/minimalist/spacing.scss +0 -20
- package/lib/design-tokens/brands copy/minimalist/textCase.scss +0 -5
- package/lib/design-tokens/brands copy/minimalist/textDecoration.scss +0 -5
- package/lib/design-tokens/brands copy/minimalist/tokens-all-minimalist.scss +0 -567
- package/lib/design-tokens/brands copy/minimalist/tokens-brand.scss +0 -32
|
@@ -1,103 +1,181 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../field-note/field-note.js";
|
|
7
|
-
import { Cre8FormElement as v } from "../cre8-form-element.js";
|
|
8
|
-
const _ = m`*,::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:inline-flex;flex-wrap:wrap}.cre8-c-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-select__body{position:relative}.cre8-c-select__input{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-select__input:hover:not(:disabled),.cre8-c-select__input:focus:not(:disabled),.cre8-c-select__input:active:not(:disabled),.cre8-c-select__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-select__input:hover:not(:disabled),.cre8-is-error .cre8-c-select__input:focus:not(:disabled),.cre8-is-error .cre8-c-select__input:active:not(:disabled),.cre8-is-error .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input:hover:not(:disabled),.cre8-is-success .cre8-c-select__input:focus:not(:disabled),.cre8-is-success .cre8-c-select__input:active:not(:disabled),.cre8-is-success .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-select__input: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-select__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-select__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-select__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input{border-color:var(--cre8-color-border-success)}.cre8-c-select__input{padding-inline-end:2.75rem;cursor:pointer}.cre8-c-select__icons{position:absolute;inset-block-start:50%;transform:translateY(-50%);inset-inline-end:0.5rem;display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;pointer-events:none}.cre8-c-select__icon-arrow{margin-right:0.375rem;width:0.75rem;height:0.75rem}.cre8-c-select__field-note,.cre8-c-select__field-note-success,.cre8-c-select__field-note-error{flex-basis:100%}`;
|
|
9
|
-
var g = Object.defineProperty, t = (p, r, s, c) => {
|
|
10
|
-
for (var a = void 0, l = p.length - 1, h; l >= 0; l--)
|
|
11
|
-
(h = p[l]) && (a = h(r, s, a) || a);
|
|
12
|
-
return a && g(r, s, a), a;
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
6
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
import svgCaretUp from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Up.svg?raw';
|
|
8
|
+
import { html, nothing, } from 'lit';
|
|
9
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
10
|
+
import { property, queryAll } from 'lit/decorators.js';
|
|
11
|
+
import { nanoid } from 'nanoid';
|
|
12
|
+
import '../field-note/field-note';
|
|
13
|
+
import styles from './select.styles.js';
|
|
14
|
+
import Cre8FormElement from '../cre8-form-element.js';
|
|
15
|
+
/**
|
|
16
|
+
* The Select control is designed and built to be used for selecting between choices in a form.
|
|
17
|
+
* It is not a Dropdown control which is generally used for displaying lists of choices
|
|
18
|
+
* that act as links or actions, like filter options.
|
|
19
|
+
*
|
|
20
|
+
* Consider the use of a Select control carefully.
|
|
21
|
+
* When you have less than 5 options for the user to choose from,
|
|
22
|
+
* Radio or Checkbox inputs may be a better choice to display all of the options at once.
|
|
23
|
+
* Users have to slow down to scan a list with more than 15 options,
|
|
24
|
+
* so using an option group to give the options hierarchy may help users find their choice faster.
|
|
25
|
+
* Alternately, a text input field might be a more appropriate control to use when there are too many options,
|
|
26
|
+
* especially when used with typeahead/auto-complete.
|
|
27
|
+
*
|
|
28
|
+
* ## How to use
|
|
29
|
+
* 1. The collapsed default state always shows a default placeholder value or a selected value.
|
|
30
|
+
* 2. Sort list items in a logical order, such as grouping highly related options together,
|
|
31
|
+
* placing most common options first, using alphabetical or numeric orders or dates in chronological order.
|
|
32
|
+
* 3. A list that includes 6+ items should show a scrollbar.
|
|
33
|
+
* 4. Users should be able to use a keystroke to quickly jump
|
|
34
|
+
* to selecting an option that begins with the entered letter.
|
|
35
|
+
* 5. Utilize appropriate native controls for when a user is on a mobile device rather than our custom Select.
|
|
36
|
+
* 6. Adhere to our common form field conventions and always include a Label,
|
|
37
|
+
* provide short and clear error messages in context, avoid using the Read-only
|
|
38
|
+
* and Disabled states as much as possible, and utilize the info/formatting tip
|
|
39
|
+
* or helpful link rather than placeholder text.
|
|
40
|
+
*
|
|
41
|
+
* @slot fieldNote - Container for optional field note content
|
|
42
|
+
*/
|
|
43
|
+
export class Cre8Select extends Cre8FormElement {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.type = 'select';
|
|
47
|
+
/**
|
|
48
|
+
* A mix of Cre8SelectOption and Cre8SelectOptionGroup definitions:
|
|
49
|
+
* - Cre8SelectOption
|
|
50
|
+
* - label: option label text - `string`
|
|
51
|
+
* - value: option value - `number | string`
|
|
52
|
+
* - Cre8SelectOptionGroup
|
|
53
|
+
* - optGroupLabel: optgroup label text - `string`
|
|
54
|
+
* - options: Array of multiple Cre8SelectOption items - `Cre8SelectOption[]`
|
|
55
|
+
*/
|
|
56
|
+
this.items = [];
|
|
57
|
+
/**
|
|
58
|
+
* The required label that appears above the select
|
|
59
|
+
* @attr {string}
|
|
60
|
+
*/
|
|
61
|
+
this.label = 'Label';
|
|
62
|
+
/**
|
|
63
|
+
* The required attribute on the select
|
|
64
|
+
* @attr {boolean}
|
|
65
|
+
*/
|
|
66
|
+
this.required = false;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Initialize aria attributes
|
|
70
|
+
*/
|
|
71
|
+
_initializeAria() {
|
|
72
|
+
this.fieldId = this.fieldId || nanoid();
|
|
73
|
+
if (this.fieldNote || this.slotNotEmpty('fieldNote')) {
|
|
74
|
+
this.ariaDescribedBy = this.ariaDescribedBy || nanoid();
|
|
75
|
+
}
|
|
76
|
+
if (this.successNote || this.errorNote) {
|
|
77
|
+
this.validationAriaDescribedBy = this.validationAriaDescribedBy || nanoid();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Aria describedby string based on field notes and error/success notes
|
|
82
|
+
* 1) If both validationAriaDescribedBy (error/success note) and field note exists,
|
|
83
|
+
* render both in the input's `aria-describedby` attribute
|
|
84
|
+
* 2) Otherwise, if only validationAriaDescribedBy exists, then render only that as
|
|
85
|
+
* the `aria-describedby` attribute (input without field note initially, but then error/success is added).
|
|
86
|
+
* 3) Otherwise, render only the `ariaDescribedBy` property (field note only)
|
|
87
|
+
*/
|
|
88
|
+
_fieldNoteAria() {
|
|
89
|
+
if (this.validationAriaDescribedBy && this.ariaDescribedBy) {
|
|
90
|
+
return `${this.ariaDescribedBy} ${this.validationAriaDescribedBy}`; /* 1 */
|
|
91
|
+
}
|
|
92
|
+
if (this.validationAriaDescribedBy && (!this.ariaDescribedBy)) {
|
|
93
|
+
return this.validationAriaDescribedBy; /* 2 */
|
|
94
|
+
}
|
|
95
|
+
return this.ariaDescribedBy; /* 3 */
|
|
96
|
+
}
|
|
97
|
+
connectedCallback() {
|
|
98
|
+
super.connectedCallback();
|
|
99
|
+
this.field.setAttribute('name', this.name ?? '');
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
super.disconnectedCallback();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* First updatedLifecycle
|
|
106
|
+
* 1) Get the option in the items array with selected set to true. Set that as the selected item
|
|
107
|
+
* 2) The default value is set to the `option` with the `selected` if one exists. Otherwise, use the
|
|
108
|
+
* select the first item value like the native select.
|
|
109
|
+
*/
|
|
110
|
+
firstUpdated() {
|
|
111
|
+
super.firstUpdated();
|
|
112
|
+
[...this._selectOptions].forEach((item) => {
|
|
113
|
+
if (item.selected === true) {
|
|
114
|
+
this.selectedItem = item.value; /* 1 */
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.defaultValue = this.selectedItem ? this.selectedItem : (this._selectOptions[0].value ?? 'Select An Option'); /* 2 */
|
|
118
|
+
this._setFormData();
|
|
119
|
+
this._initializeAria();
|
|
120
|
+
this.updateField();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Set form data
|
|
124
|
+
* 1) Set the element internals to the selected item value if it exists,
|
|
125
|
+
* otherwise the default selected item is the first one
|
|
20
126
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
57
|
-
_setFormData() {
|
|
58
|
-
return this.selectedItem ? this._internals?.setFormValue(this.selectedItem) : this._internals?.setFormValue(this.defaultValue.toString());
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Handle On Change
|
|
62
|
-
* 1. Set the value when the select is changed.
|
|
63
|
-
* 2. Fire the custom event with the current value.
|
|
64
|
-
*/
|
|
65
|
-
_handleOnChange(r) {
|
|
66
|
-
const s = r.target;
|
|
67
|
-
this.value = s.options[s.selectedIndex].value, this._internals.setFormValue(this.value);
|
|
68
|
-
const c = new CustomEvent("change", {
|
|
69
|
-
detail: {
|
|
70
|
-
name: this.name,
|
|
71
|
-
value: this.value
|
|
72
|
-
},
|
|
73
|
-
bubbles: !0,
|
|
74
|
-
composed: !0
|
|
75
|
-
});
|
|
76
|
-
this.dispatchEvent(c);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Render the select options
|
|
80
|
-
*/
|
|
81
|
-
_renderSelectOptions() {
|
|
82
|
-
return this.items.map((r) => {
|
|
83
|
-
if ("options" in r) {
|
|
84
|
-
const s = r.options.map((c) => o`
|
|
85
|
-
<option value="${c.value}">${c.label}</option>
|
|
127
|
+
_setFormData() {
|
|
128
|
+
if (this.selectedItem) {
|
|
129
|
+
return this._internals?.setFormValue(this.selectedItem);
|
|
130
|
+
}
|
|
131
|
+
return this._internals?.setFormValue(this.defaultValue.toString());
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Handle On Change
|
|
135
|
+
* 1. Set the value when the select is changed.
|
|
136
|
+
* 2. Fire the custom event with the current value.
|
|
137
|
+
*/
|
|
138
|
+
_handleOnChange(e) {
|
|
139
|
+
/* 1 */
|
|
140
|
+
const target = e.target;
|
|
141
|
+
this.value = target.options[target.selectedIndex].value;
|
|
142
|
+
this._internals.setFormValue(this.value);
|
|
143
|
+
/* 2 */
|
|
144
|
+
const customEvent = new CustomEvent('change', {
|
|
145
|
+
detail: {
|
|
146
|
+
name: this.name,
|
|
147
|
+
value: this.value,
|
|
148
|
+
},
|
|
149
|
+
bubbles: true,
|
|
150
|
+
composed: true,
|
|
151
|
+
});
|
|
152
|
+
this.dispatchEvent(customEvent);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Render the select options
|
|
156
|
+
*/
|
|
157
|
+
_renderSelectOptions() {
|
|
158
|
+
return this.items.map((item) => {
|
|
159
|
+
if ('options' in item) {
|
|
160
|
+
const selectedGroup = item.options.map((option) => html `
|
|
161
|
+
<option value="${option.value}">${option.label}</option>
|
|
86
162
|
`);
|
|
87
|
-
|
|
88
|
-
${
|
|
163
|
+
return html `<optgroup label="${item.optGroupLabel}">
|
|
164
|
+
${selectedGroup}
|
|
89
165
|
</optgroup>`;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
166
|
+
}
|
|
167
|
+
return html `<option value="${item.value}">${item.label}</option>`;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Render the success or error field notes
|
|
172
|
+
* 1. If there is a successNote, then return the field note with the success message and state.
|
|
173
|
+
* 2. If there is a errorNote, then return the field note with the error message and state.
|
|
174
|
+
*/
|
|
175
|
+
_renderSuccessErrorFieldNote() {
|
|
176
|
+
if (this.successNote) {
|
|
177
|
+
/* 1 */
|
|
178
|
+
return html `
|
|
101
179
|
<cre8-field-note
|
|
102
180
|
?isSuccess=${this.isSuccess}
|
|
103
181
|
id=${this.validationAriaDescribedBy}
|
|
@@ -105,7 +183,11 @@ const n = class n extends v {
|
|
|
105
183
|
iconName="success"
|
|
106
184
|
>
|
|
107
185
|
${this.successNote}
|
|
108
|
-
</cre8-field-note
|
|
186
|
+
</cre8-field-note>`;
|
|
187
|
+
}
|
|
188
|
+
if (this.errorNote) {
|
|
189
|
+
/* 2 */
|
|
190
|
+
return html `
|
|
109
191
|
<cre8-field-note
|
|
110
192
|
?isError=${this.isError}
|
|
111
193
|
id=${this.validationAriaDescribedBy}
|
|
@@ -113,84 +195,87 @@ const n = class n extends v {
|
|
|
113
195
|
iconName="error-alt"
|
|
114
196
|
>
|
|
115
197
|
${this.errorNote}
|
|
116
|
-
</cre8-field-note
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
198
|
+
</cre8-field-note>`;
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
const componentClassNames = this.componentClassNames('cre8-c-select', {
|
|
204
|
+
'cre8-is-error': this.isError,
|
|
205
|
+
'cre8-is-success': this.isSuccess,
|
|
206
|
+
});
|
|
207
|
+
return html `
|
|
208
|
+
<div class="${componentClassNames}">
|
|
125
209
|
<label class="cre8-c-select__label" for="${this.fieldId}">${this.label}</label>
|
|
126
210
|
<div class="cre8-c-select__body">
|
|
127
211
|
<select
|
|
128
212
|
class="cre8-c-select__input"
|
|
129
213
|
id=${this.fieldId}
|
|
130
|
-
name=${
|
|
214
|
+
name=${ifDefined(this.name)}
|
|
131
215
|
?required=${this.required}
|
|
132
216
|
?disabled=${this.disabled}
|
|
133
|
-
aria-describedby="${
|
|
217
|
+
aria-describedby="${ifDefined(this._fieldNoteAria())}"
|
|
134
218
|
@change=${this._handleOnChange}
|
|
135
219
|
>
|
|
136
220
|
${this._renderSelectOptions()}
|
|
137
221
|
</select>
|
|
138
222
|
<div class="cre8-c-select__icons">
|
|
139
|
-
<cre8-icon svg='${
|
|
223
|
+
<cre8-icon svg='${svgCaretUp}' rotate="180" class="cre8-c-select__icon-arrow" aria-hidden='true'>
|
|
140
224
|
</div>
|
|
141
225
|
</div>
|
|
142
226
|
</div>
|
|
143
|
-
${this.fieldNote || this.slotNotEmpty(
|
|
227
|
+
${this.fieldNote || this.slotNotEmpty('fieldNote')
|
|
228
|
+
? html `
|
|
144
229
|
<cre8-field-note
|
|
145
230
|
id=${this.ariaDescribedBy}
|
|
146
231
|
class="cre8-c-select__field-note"
|
|
147
|
-
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note>`
|
|
232
|
+
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note>`
|
|
233
|
+
: nothing}
|
|
148
234
|
${this._renderSuccessErrorFieldNote()}
|
|
149
235
|
`;
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
customElements.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
Cre8Select.styles = [styles];
|
|
239
|
+
__decorate([
|
|
240
|
+
property({ type: Array })
|
|
241
|
+
], Cre8Select.prototype, "items", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property()
|
|
244
|
+
], Cre8Select.prototype, "label", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
property()
|
|
247
|
+
], Cre8Select.prototype, "fieldId", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
property()
|
|
250
|
+
], Cre8Select.prototype, "fieldNote", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
property()
|
|
253
|
+
], Cre8Select.prototype, "ariaDescribedBy", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
property()
|
|
256
|
+
], Cre8Select.prototype, "validationAriaDescribedBy", void 0);
|
|
257
|
+
__decorate([
|
|
258
|
+
property({ type: Boolean, reflect: true })
|
|
259
|
+
], Cre8Select.prototype, "required", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
property({ type: Boolean, reflect: true })
|
|
262
|
+
], Cre8Select.prototype, "disabled", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
property({ type: Boolean, reflect: true })
|
|
265
|
+
], Cre8Select.prototype, "isError", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
property()
|
|
268
|
+
], Cre8Select.prototype, "errorNote", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
property({ type: Boolean, reflect: true })
|
|
271
|
+
], Cre8Select.prototype, "isSuccess", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
property()
|
|
274
|
+
], Cre8Select.prototype, "successNote", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
queryAll('option')
|
|
277
|
+
], Cre8Select.prototype, "_selectOptions", void 0);
|
|
278
|
+
if (customElements.get('cre8-select') === undefined) {
|
|
279
|
+
customElements.define('cre8-select', Cre8Select);
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../components/select/select.ts"],"names":[],"mappings":"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","sourcesContent":["import svgCaretUp from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Up.svg?raw';\nimport { html, nothing, } from 'lit';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { property, queryAll } from 'lit/decorators.js';\nimport { nanoid } from 'nanoid';\nimport '../field-note/field-note';\nimport styles from './select.styles.js';\nimport Cre8FormElement from '../cre8-form-element.js';\n\nexport interface Cre8SelectOption {\n label: string;\n value: number | string;\n}\n\nexport interface Cre8SelectOptionGroup {\n optGroupLabel: string;\n options: Cre8SelectOption[];\n}\n\n/**\n * The Select control is designed and built to be used for selecting between choices in a form.\n * It is not a Dropdown control which is generally used for displaying lists of choices\n * that act as links or actions, like filter options.\n *\n * Consider the use of a Select control carefully.\n * When you have less than 5 options for the user to choose from,\n * Radio or Checkbox inputs may be a better choice to display all of the options at once.\n * Users have to slow down to scan a list with more than 15 options,\n * so using an option group to give the options hierarchy may help users find their choice faster.\n * Alternately, a text input field might be a more appropriate control to use when there are too many options,\n * especially when used with typeahead/auto-complete.\n *\n * ## How to use\n * 1. The collapsed default state always shows a default placeholder value or a selected value.\n * 2. Sort list items in a logical order, such as grouping highly related options together,\n * placing most common options first, using alphabetical or numeric orders or dates in chronological order.\n * 3. A list that includes 6+ items should show a scrollbar.\n * 4. Users should be able to use a keystroke to quickly jump\n * to selecting an option that begins with the entered letter.\n * 5. Utilize appropriate native controls for when a user is on a mobile device rather than our custom Select.\n * 6. Adhere to our common form field conventions and always include a Label,\n * provide short and clear error messages in context, avoid using the Read-only\n * and Disabled states as much as possible, and utilize the info/formatting tip\n * or helpful link rather than placeholder text.\n *\n * @slot fieldNote - Container for optional field note content\n */\n\nexport class Cre8Select extends Cre8FormElement {\n\n readonly type = 'select';\n static styles = [styles];\n\n /**\n * A mix of Cre8SelectOption and Cre8SelectOptionGroup definitions:\n * - Cre8SelectOption\n * - label: option label text - `string`\n * - value: option value - `number | string`\n * - Cre8SelectOptionGroup\n * - optGroupLabel: optgroup label text - `string`\n * - options: Array of multiple Cre8SelectOption items - `Cre8SelectOption[]`\n */\n @property({ type: Array })\n items: Array<Cre8SelectOption | Cre8SelectOptionGroup> = [];\n\n /**\n * The required label that appears above the select\n * @attr {string}\n */\n @property()\n label: string = 'Label';\n\n\n /**\n * The unique id of the select\n * @attr {string}\n */\n @property()\n fieldId?: string;\n\n /**\n * Optional field note text can be added to provide additional field guidance.\n * @attr {string}\n */\n @property()\n fieldNote?: string;\n\n /**\n * Used to connect the field note in text field to the text menu for accessibility\n * @attr {string}\n */\n @property()\n ariaDescribedBy?: string;\n\n /**\n * Additional aria-describedby connection to id for additional success and error notes to be accessible\n * @attr {string}\n */\n @property()\n validationAriaDescribedBy?: string;\n\n /**\n * The required attribute on the select\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n required: boolean = false;\n\n /**\n * The disabled attribute on the select\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n\n /**\n * Changes the component's treatment to represent an error state\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * The error field note that appears below the default field note\n * @attr {string}\n */\n @property()\n errorNote?: string;\n\n /**\n * Changes the component's treatment to represent a success state\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * The success field note that appears below the default field note\n * @attr {string}\n */\n @property()\n successNote?: string;\n\n /**\n * Select input querySelector\n */\n\n\n\n /**\n * Get all select option elements\n */\n @queryAll('option')\n _selectOptions: HTMLOptionsCollection;\n\n\n /**\n * Selected item value\n */\n private selectedItem: string;\n\n /**\n * Initialize aria attributes\n */\n private _initializeAria() {\n this.fieldId = this.fieldId || nanoid();\n if (this.fieldNote || this.slotNotEmpty('fieldNote')) {\n this.ariaDescribedBy = this.ariaDescribedBy || nanoid();\n }\n if (this.successNote || this.errorNote) {\n this.validationAriaDescribedBy = this.validationAriaDescribedBy || nanoid();\n }\n }\n\n /**\n * Aria describedby string based on field notes and error/success notes\n * 1) If both validationAriaDescribedBy (error/success note) and field note exists,\n * render both in the input's `aria-describedby` attribute\n * 2) Otherwise, if only validationAriaDescribedBy exists, then render only that as\n * the `aria-describedby` attribute (input without field note initially, but then error/success is added).\n * 3) Otherwise, render only the `ariaDescribedBy` property (field note only)\n */\n private _fieldNoteAria() {\n if (this.validationAriaDescribedBy && this.ariaDescribedBy) {\n return `${this.ariaDescribedBy} ${this.validationAriaDescribedBy}`; /* 1 */\n }\n if (this.validationAriaDescribedBy && (!this.ariaDescribedBy)) {\n return this.validationAriaDescribedBy; /* 2 */\n }\n return this.ariaDescribedBy; /* 3 */\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.field.setAttribute('name', this.name ?? '')\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n /**\n * First updatedLifecycle\n * 1) Get the option in the items array with selected set to true. Set that as the selected item\n * 2) The default value is set to the `option` with the `selected` if one exists. Otherwise, use the\n * select the first item value like the native select.\n */\n firstUpdated() {\n super.firstUpdated();\n [...this._selectOptions].forEach((item: { selected: boolean; value: string; }) => { /* 1 */\n if (item.selected === true) {\n this.selectedItem = item.value; /* 1 */\n }\n });\n this.defaultValue = this.selectedItem ? this.selectedItem : (this._selectOptions[0].value ?? 'Select An Option'); /* 2 */\n this._setFormData();\n this._initializeAria();\n this.updateField();\n }\n\n /**\n * Set form data\n * 1) Set the element internals to the selected item value if it exists,\n * otherwise the default selected item is the first one\n */\n private _setFormData() {\n if (this.selectedItem) {\n return this._internals?.setFormValue(this.selectedItem);\n }\n return this._internals?.setFormValue(this.defaultValue.toString());\n }\n\n /**\n * Handle On Change\n * 1. Set the value when the select is changed.\n * 2. Fire the custom event with the current value.\n */\n private _handleOnChange(e: Event) {\n /* 1 */\n const target = e.target as HTMLSelectElement;\n this.value = target.options[target.selectedIndex].value;\n this._internals.setFormValue(this.value);\n\n\n /* 2 */\n const customEvent = new CustomEvent('change', {\n detail: {\n name: this.name,\n value: this.value,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(customEvent);\n }\n\n /**\n * Render the select options\n */\n private _renderSelectOptions() {\n return this.items.map((item: Cre8SelectOption | Cre8SelectOptionGroup) => {\n if ('options' in item) {\n const selectedGroup = item.options.map((option: Cre8SelectOption) => html`\n <option value=\"${option.value}\">${option.label}</option>\n `);\n return html`<optgroup label=\"${item.optGroupLabel}\">\n ${selectedGroup}\n </optgroup>`;\n }\n return html`<option value=\"${item.value}\">${item.label}</option>`;\n });\n }\n\n /**\n * Render the success or error field notes\n * 1. If there is a successNote, then return the field note with the success message and state.\n * 2. If there is a errorNote, then return the field note with the error message and state.\n */\n private _renderSuccessErrorFieldNote() {\n if (this.successNote) {\n /* 1 */\n return html`\n <cre8-field-note\n ?isSuccess=${this.isSuccess}\n id=${this.validationAriaDescribedBy}\n class=\"cre8-c-select__field-note-success\"\n iconName=\"success\"\n >\n ${this.successNote}\n </cre8-field-note>`;\n }\n if (this.errorNote) {\n /* 2 */\n return html`\n <cre8-field-note\n ?isError=${this.isError}\n id=${this.validationAriaDescribedBy}\n class=\"cre8-c-select__field-note-error\"\n iconName=\"error-alt\"\n >\n ${this.errorNote}\n </cre8-field-note>`;\n }\n return null;\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-select', {\n 'cre8-is-error': this.isError,\n 'cre8-is-success': this.isSuccess,\n });\n\n return html`\n <div class=\"${componentClassNames}\">\n <label class=\"cre8-c-select__label\" for=\"${this.fieldId}\">${this.label}</label>\n <div class=\"cre8-c-select__body\">\n <select\n class=\"cre8-c-select__input\"\n id=${this.fieldId}\n name=${ifDefined(this.name)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n aria-describedby=\"${ifDefined(this._fieldNoteAria())}\"\n @change=${this._handleOnChange}\n >\n ${this._renderSelectOptions()}\n </select>\n <div class=\"cre8-c-select__icons\">\n <cre8-icon svg='${svgCaretUp}' rotate=\"180\" class=\"cre8-c-select__icon-arrow\" aria-hidden='true'>\n </div>\n </div>\n </div>\n ${this.fieldNote || this.slotNotEmpty('fieldNote')\n ? html`\n <cre8-field-note\n id=${this.ariaDescribedBy}\n class=\"cre8-c-select__field-note\"\n ><slot name=\"fieldNote\">${this.fieldNote}</slot></cre8-field-note>`\n : nothing}\n ${this._renderSuccessErrorFieldNote()}\n `;\n }\n}\n\nif (customElements.get('cre8-select') === undefined) {\n customElements.define('cre8-select', Cre8Select);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-select': Cre8Select;\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const styles = css `*,::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:inline-flex;flex-wrap:wrap}.cre8-c-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-select__body{position:relative}.cre8-c-select__input{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-select__input:hover:not(:disabled),.cre8-c-select__input:focus:not(:disabled),.cre8-c-select__input:active:not(:disabled),.cre8-c-select__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-select__input:hover:not(:disabled),.cre8-is-error .cre8-c-select__input:focus:not(:disabled),.cre8-is-error .cre8-c-select__input:active:not(:disabled),.cre8-is-error .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input:hover:not(:disabled),.cre8-is-success .cre8-c-select__input:focus:not(:disabled),.cre8-is-success .cre8-c-select__input:active:not(:disabled),.cre8-is-success .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-select__input: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-select__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-select__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-select__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input{border-color:var(--cre8-color-border-success)}.cre8-c-select__input{padding-inline-end:2.75rem;cursor:pointer}.cre8-c-select__icons{position:absolute;inset-block-start:50%;transform:translateY(-50%);inset-inline-end:0.5rem;display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;pointer-events:none}.cre8-c-select__icon-arrow{margin-right:0.375rem;width:0.75rem;height:0.75rem}.cre8-c-select__field-note,.cre8-c-select__field-note-success,.cre8-c-select__field-note-error{flex-basis:100%}`;
|
|
3
|
+
export default styles;
|
|
4
|
+
//# sourceMappingURL=select.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.styles.js","sourceRoot":"","sources":["../../../components/select/select.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,4gKAA4gK,CAAC;AAC/hK,eAAe,MAAM,CAAC","sourcesContent":["import { css } from 'lit';\nconst styles = css`*,::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:inline-flex;flex-wrap:wrap}.cre8-c-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-select__body{position:relative}.cre8-c-select__input{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-select__input:hover:not(:disabled),.cre8-c-select__input:focus:not(:disabled),.cre8-c-select__input:active:not(:disabled),.cre8-c-select__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-select__input:hover:not(:disabled),.cre8-is-error .cre8-c-select__input:focus:not(:disabled),.cre8-is-error .cre8-c-select__input:active:not(:disabled),.cre8-is-error .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input:hover:not(:disabled),.cre8-is-success .cre8-c-select__input:focus:not(:disabled),.cre8-is-success .cre8-c-select__input:active:not(:disabled),.cre8-is-success .cre8-c-select__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-select__input: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-select__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-select__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-select__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-select__input{border-color:var(--cre8-color-border-success)}.cre8-c-select__input{padding-inline-end:2.75rem;cursor:pointer}.cre8-c-select__icons{position:absolute;inset-block-start:50%;transform:translateY(-50%);inset-inline-end:0.5rem;display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;pointer-events:none}.cre8-c-select__icon-arrow{margin-right:0.375rem;width:0.75rem;height:0.75rem}.cre8-c-select__field-note,.cre8-c-select__field-note-success,.cre8-c-select__field-note-error{flex-basis:100%}`;\nexport default styles;\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Controller handles the special checkbox logic.
|
|
3
|
+
* This should be a lot simpler than the radio version.
|
|
4
|
+
*
|
|
5
|
+
* See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role
|
|
6
|
+
*/
|
|
7
|
+
export class SelectTileCheckboxController {
|
|
8
|
+
constructor(host) {
|
|
9
|
+
/**
|
|
10
|
+
* Handle clicking on the radio button
|
|
11
|
+
* @see _checkAndFocus
|
|
12
|
+
*/
|
|
13
|
+
this._clickHandler = (e) => {
|
|
14
|
+
this._checkAndFocus();
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Set the element to `checked`
|
|
19
|
+
* 2) Set us to checked.
|
|
20
|
+
*/
|
|
21
|
+
this._checkAndFocus = () => {
|
|
22
|
+
this.host.checked = !this.host.checked;
|
|
23
|
+
this.host.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
24
|
+
this.host.dispatchEvent(new Event('change', { bubbles: true }));
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Handle keydown
|
|
28
|
+
*/
|
|
29
|
+
this._handleKeyDown = (e) => {
|
|
30
|
+
// Enter and Space
|
|
31
|
+
if (['Enter', ' '].includes(e.key)) {
|
|
32
|
+
this._handleEnterSpace(e);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Handle Enter and Space
|
|
37
|
+
* @see _checkAndFocus
|
|
38
|
+
*/
|
|
39
|
+
this._handleEnterSpace = (e) => {
|
|
40
|
+
this._checkAndFocus();
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
};
|
|
43
|
+
this.host = host;
|
|
44
|
+
host.addController(this);
|
|
45
|
+
}
|
|
46
|
+
hostConnected() {
|
|
47
|
+
this.host._internals.role = 'checkbox';
|
|
48
|
+
this.host.setAttribute('tabindex', '0');
|
|
49
|
+
this.host.addEventListener('click', this._clickHandler);
|
|
50
|
+
this.host.addEventListener('keydown', this._handleKeyDown);
|
|
51
|
+
}
|
|
52
|
+
hostDisconnected() {
|
|
53
|
+
this.host._internals.role = undefined;
|
|
54
|
+
this.host.removeAttribute('tabindex');
|
|
55
|
+
this.host.removeEventListener('click', this._clickHandler);
|
|
56
|
+
this.host.removeEventListener('keydown', this._handleKeyDown);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export default SelectTileCheckboxController;
|
|
60
|
+
//# sourceMappingURL=select-tile-checkbox-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-tile-checkbox-controller.js","sourceRoot":"","sources":["../../../components/select-tile/select-tile-checkbox-controller.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,OAAO,4BAA4B;IAGrC,YAAY,IAAiB;QAqB/B;;;WAGG;QACO,kBAAa,GAAG,CAAC,CAA6B,EAAE,EAAE;YACtD,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,CAAC,CAAC,cAAc,EAAE,CAAC;QACvB,CAAC,CAAC;QAEJ;;;WAGG;QACO,mBAAc,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC;QAEJ;;WAEG;QACO,mBAAc,GAAG,CAAC,CAAgB,EAAE,EAAE;YAC9C,kBAAkB;YACd,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC,CAAC;QAEJ;;;WAGG;QACO,sBAAiB,GAAG,CAAC,CAAgB,EAAE,EAAE;YAC7C,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,CAAC,CAAC,cAAc,EAAE,CAAC;QACvB,CAAC,CAAC;QAxDE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,aAAa;QACT,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAExC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/D,CAAC;IAED,gBAAgB;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAEtC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAClE,CAAC;CAuCJ;AAED,eAAe,4BAA4B,CAAC","sourcesContent":["import { ReactiveController } from 'lit';\nimport { Cre8FormElement } from '../cre8-form-element';\n\ntype FormElement = Cre8FormElement & { form: HTMLFormElement, name?: string, checked?: boolean };\n\n\n/**\n * This Controller handles the special checkbox logic.\n * This should be a lot simpler than the radio version.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role\n */\nexport class SelectTileCheckboxController implements ReactiveController {\n private host: FormElement;\n\n constructor(host: FormElement) {\n this.host = host;\n host.addController(this);\n }\n\n hostConnected(): void {\n this.host._internals.role = 'checkbox';\n this.host.setAttribute('tabindex', '0');\n\n this.host.addEventListener('click', this._clickHandler);\n this.host.addEventListener('keydown', this._handleKeyDown);\n }\n\n hostDisconnected(): void {\n this.host._internals.role = undefined;\n this.host.removeAttribute('tabindex');\n\n this.host.removeEventListener('click', this._clickHandler);\n this.host.removeEventListener('keydown', this._handleKeyDown);\n }\n\n /**\n * Handle clicking on the radio button\n * @see _checkAndFocus\n */\n private _clickHandler = (e: MouseEvent | KeyboardEvent) => {\n this._checkAndFocus();\n e.preventDefault();\n };\n\n /**\n * Set the element to `checked`\n * 2) Set us to checked.\n */\n private _checkAndFocus = () => {\n this.host.checked = !this.host.checked;\n this.host.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n this.host.dispatchEvent(new Event('change', { bubbles: true }));\n };\n\n /**\n * Handle keydown\n */\n private _handleKeyDown = (e: KeyboardEvent) => {\n // Enter and Space\n if (['Enter', ' '].includes(e.key)) {\n this._handleEnterSpace(e);\n }\n };\n\n /**\n * Handle Enter and Space\n * @see _checkAndFocus\n */\n private _handleEnterSpace = (e: KeyboardEvent) => {\n this._checkAndFocus();\n e.preventDefault();\n };\n}\n\nexport default SelectTileCheckboxController;\n"]}
|