@tmorrow/cre8-wc 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cre8-wc.esm.js +1 -1
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1 -1
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.js +129 -0
- package/lib/cdn-entry.js.map +1 -0
- package/lib/components/accordion/accordion.js +58 -40
- package/lib/components/accordion/accordion.js.map +1 -0
- package/lib/components/accordion/accordion.styles.js +4 -0
- package/lib/components/accordion/accordion.styles.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.js +187 -98
- package/lib/components/accordion-item/accordion-item.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.styles.js +4 -0
- package/lib/components/accordion-item/accordion-item.styles.js.map +1 -0
- package/lib/components/alert/alert.js +146 -107
- package/lib/components/alert/alert.js.map +1 -0
- package/lib/components/alert/alert.styles.js +4 -0
- package/lib/components/alert/alert.styles.js.map +1 -0
- package/lib/components/badge/badge.js +73 -50
- package/lib/components/badge/badge.js.map +1 -0
- package/lib/components/badge/badge.styles.js +4 -0
- package/lib/components/badge/badge.styles.js.map +1 -0
- package/lib/components/band/band.js +34 -31
- package/lib/components/band/band.js.map +1 -0
- package/lib/components/band/band.styles.js +4 -0
- package/lib/components/band/band.styles.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +52 -28
- package/lib/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js +4 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +28 -27
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js +4 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js.map +1 -0
- package/lib/components/button/button.js +297 -1040
- package/lib/components/button/button.js.map +1 -0
- package/lib/components/button/button.styles.js +885 -0
- package/lib/components/button/button.styles.js.map +1 -0
- package/lib/components/button-group/button-group.js +30 -27
- package/lib/components/button-group/button-group.js.map +1 -0
- package/lib/components/button-group/button-group.styles.js +4 -0
- package/lib/components/button-group/button-group.styles.js.map +1 -0
- package/lib/components/card/card.js +57 -35
- package/lib/components/card/card.js.map +1 -0
- package/lib/components/card/card.styles.js +4 -0
- package/lib/components/card/card.styles.js.map +1 -0
- package/lib/components/chart/chart.js +528 -354
- package/lib/components/chart/chart.js.map +1 -0
- package/lib/components/chart/chart.styles.js +4 -0
- package/lib/components/chart/chart.styles.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.js +66 -53
- package/lib/components/checkbox-field/checkbox-field.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js +4 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.js +252 -183
- package/lib/components/checkbox-field-item/checkbox-field-item.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js +4 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js.map +1 -0
- package/lib/components/contexts/form-internals-context.js +9 -0
- package/lib/components/contexts/form-internals-context.js.map +1 -0
- package/lib/components/cre8-element.js +57 -56
- package/lib/components/cre8-element.js.map +1 -0
- package/lib/components/cre8-form-element.js +212 -244
- package/lib/components/cre8-form-element.js.map +1 -0
- package/lib/components/danger-button/danger-button.js +274 -147
- package/lib/components/danger-button/danger-button.js.map +1 -0
- package/lib/components/danger-button/danger-button.styles.js +4 -0
- package/lib/components/danger-button/danger-button.styles.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.js +465 -0
- package/lib/components/date-picker/calendar/calendar.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.styles.js +4 -0
- package/lib/components/date-picker/calendar/calendar.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js +76 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js +110 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js +4 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js +116 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js.map +1 -0
- package/lib/components/date-picker/date-picker.js +91 -784
- package/lib/components/date-picker/date-picker.js.map +1 -0
- package/lib/components/date-picker/date-picker.styles.js +4 -0
- package/lib/components/date-picker/date-picker.styles.js.map +1 -0
- package/lib/components/divider/divider.js +45 -35
- package/lib/components/divider/divider.js.map +1 -0
- package/lib/components/divider/divider.styles.js +4 -0
- package/lib/components/divider/divider.styles.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +97 -63
- package/lib/components/dropdown/dropdown.js.map +1 -0
- package/lib/components/dropdown/dropdown.styles.js +4 -0
- package/lib/components/dropdown/dropdown.styles.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.js +38 -31
- package/lib/components/dropdown-item/dropdown-item.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js +4 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js.map +1 -0
- package/lib/components/feature/feature.js +40 -35
- package/lib/components/feature/feature.js.map +1 -0
- package/lib/components/feature/feature.styles.js +4 -0
- package/lib/components/feature/feature.styles.js.map +1 -0
- package/lib/components/field/field.js +218 -153
- package/lib/components/field/field.js.map +1 -0
- package/lib/components/field/field.styles.js +4 -0
- package/lib/components/field/field.styles.js.map +1 -0
- package/lib/components/field-note/field-note.js +58 -45
- package/lib/components/field-note/field-note.js.map +1 -0
- package/lib/components/field-note/field-note.styles.js +4 -0
- package/lib/components/field-note/field-note.styles.js.map +1 -0
- package/lib/components/footer/footer.js +25 -18
- package/lib/components/footer/footer.js.map +1 -0
- package/lib/components/footer/footer.styles.js +4 -0
- package/lib/components/footer/footer.styles.js.map +1 -0
- package/lib/components/global-nav/global-nav.js +44 -37
- package/lib/components/global-nav/global-nav.js.map +1 -0
- package/lib/components/global-nav/global-nav.styles.js +4 -0
- package/lib/components/global-nav/global-nav.styles.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.js +149 -112
- package/lib/components/global-nav-item/global-nav-item.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js +4 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js.map +1 -0
- package/lib/components/grid/grid.js +48 -45
- package/lib/components/grid/grid.js.map +1 -0
- package/lib/components/grid/grid.styles.js +4 -0
- package/lib/components/grid/grid.styles.js.map +1 -0
- package/lib/components/grid-item/grid-item.js +19 -16
- package/lib/components/grid-item/grid-item.js.map +1 -0
- package/lib/components/grid-item/grid-item.styles.js +4 -0
- package/lib/components/grid-item/grid-item.styles.js.map +1 -0
- package/lib/components/header/header.js +34 -29
- package/lib/components/header/header.js.map +1 -0
- package/lib/components/header/header.styles.js +4 -0
- package/lib/components/header/header.styles.js.map +1 -0
- package/lib/components/heading/heading.js +113 -76
- package/lib/components/heading/heading.js.map +1 -0
- package/lib/components/heading/heading.styles.js +4 -0
- package/lib/components/heading/heading.styles.js.map +1 -0
- package/lib/components/hero/hero.js +43 -40
- package/lib/components/hero/hero.js.map +1 -0
- package/lib/components/hero/hero.styles.js +4 -0
- package/lib/components/hero/hero.styles.js.map +1 -0
- package/lib/components/icon/icon.js +232 -9
- package/lib/components/icon/icon.js.map +1 -0
- package/lib/components/icon/icon.styles.js +4 -0
- package/lib/components/icon/icon.styles.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.js +114 -87
- package/lib/components/inline-alert/inline-alert.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.styles.js +4 -0
- package/lib/components/inline-alert/inline-alert.styles.js.map +1 -0
- package/lib/components/layout/layout.js +30 -27
- package/lib/components/layout/layout.js.map +1 -0
- package/lib/components/layout/layout.styles.js +4 -0
- package/lib/components/layout/layout.styles.js.map +1 -0
- package/lib/components/layout-container/layout-container.js +30 -27
- package/lib/components/layout-container/layout-container.js.map +1 -0
- package/lib/components/layout-container/layout-container.styles.js +4 -0
- package/lib/components/layout-container/layout-container.styles.js.map +1 -0
- package/lib/components/layout-section/layout-section.js +41 -33
- package/lib/components/layout-section/layout-section.js.map +1 -0
- package/lib/components/layout-section/layout-section.styles.js +4 -0
- package/lib/components/layout-section/layout-section.styles.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.js +19 -16
- package/lib/components/linelength-container/linelength-container.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.styles.js +4 -0
- package/lib/components/linelength-container/linelength-container.styles.js.map +1 -0
- package/lib/components/link/link.js +125 -87
- package/lib/components/link/link.js.map +1 -0
- package/lib/components/link/link.styles.js +4 -0
- package/lib/components/link/link.styles.js.map +1 -0
- package/lib/components/link-list/link-list.js +48 -45
- package/lib/components/link-list/link-list.js.map +1 -0
- package/lib/components/link-list/link-list.styles.js +4 -0
- package/lib/components/link-list/link-list.styles.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.js +40 -37
- package/lib/components/link-list-item/link-list-item.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.styles.js +4 -0
- package/lib/components/link-list-item/link-list-item.styles.js.map +1 -0
- package/lib/components/list/list.js +35 -32
- package/lib/components/list/list.js.map +1 -0
- package/lib/components/list/list.styles.js +4 -0
- package/lib/components/list/list.styles.js.map +1 -0
- package/lib/components/list-item/list-item.js +25 -21
- package/lib/components/list-item/list-item.js.map +1 -0
- package/lib/components/list-item/list-item.styles.js +4 -0
- package/lib/components/list-item/list-item.styles.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.js +126 -71
- package/lib/components/loading-spinner/loading-spinner.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js +4 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js.map +1 -0
- package/lib/components/logo/logo.js +28 -25
- package/lib/components/logo/logo.js.map +1 -0
- package/lib/components/logo/logo.styles.js +4 -0
- package/lib/components/logo/logo.styles.js.map +1 -0
- package/lib/components/main/main.js +29 -26
- package/lib/components/main/main.js.map +1 -0
- package/lib/components/main/main.styles.js +4 -0
- package/lib/components/main/main.styles.js.map +1 -0
- package/lib/components/modal/modal.js +174 -125
- package/lib/components/modal/modal.js.map +1 -0
- package/lib/components/modal/modal.styles.js +4 -0
- package/lib/components/modal/modal.styles.js.map +1 -0
- package/lib/components/multi-select/multi-select.js +300 -211
- package/lib/components/multi-select/multi-select.js.map +1 -0
- package/lib/components/multi-select/multi-select.styles.js +4 -0
- package/lib/components/multi-select/multi-select.styles.js.map +1 -0
- package/lib/components/nav-container/nav-container.js +19 -16
- package/lib/components/nav-container/nav-container.js.map +1 -0
- package/lib/components/nav-container/nav-container.styles.js +4 -0
- package/lib/components/nav-container/nav-container.styles.js.map +1 -0
- package/lib/components/page-header/page-header.js +36 -29
- package/lib/components/page-header/page-header.js.map +1 -0
- package/lib/components/page-header/page-header.styles.js +4 -0
- package/lib/components/page-header/page-header.styles.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.js +67 -0
- package/lib/components/pagination/page-counter/page-counter.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js +4 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js.map +1 -0
- package/lib/components/pagination/pagination.js +282 -237
- package/lib/components/pagination/pagination.js.map +1 -0
- package/lib/components/pagination/pagination.styles.js +4 -0
- package/lib/components/pagination/pagination.styles.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.js +56 -48
- package/lib/components/percent-bar/percent-bar.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.styles.js +4 -0
- package/lib/components/percent-bar/percent-bar.styles.js.map +1 -0
- package/lib/components/popover/popover.js +304 -179
- package/lib/components/popover/popover.js.map +1 -0
- package/lib/components/popover/popover.styles.js +4 -0
- package/lib/components/popover/popover.styles.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.js +44 -37
- package/lib/components/primary-nav/primary-nav.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.styles.js +4 -0
- package/lib/components/primary-nav/primary-nav.styles.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.js +151 -113
- package/lib/components/primary-nav-item/primary-nav-item.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js +4 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.js +74 -57
- package/lib/components/progress-meter/progress-meter.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.styles.js +4 -0
- package/lib/components/progress-meter/progress-meter.styles.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.js +19 -0
- package/lib/components/progress-steps/progress-steps.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.styles.js +4 -0
- package/lib/components/progress-steps/progress-steps.styles.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.js +52 -40
- package/lib/components/progress-steps-item/progress-steps-item.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js +4 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js.map +1 -0
- package/lib/components/radio-field/radio-field.js +59 -49
- package/lib/components/radio-field/radio-field.js.map +1 -0
- package/lib/components/radio-field/radio-field.styles.js +4 -0
- package/lib/components/radio-field/radio-field.styles.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.js +222 -179
- package/lib/components/radio-field-item/radio-field-item.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js +4 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.js +89 -60
- package/lib/components/remove-tag/remove-tag.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.styles.js +4 -0
- package/lib/components/remove-tag/remove-tag.styles.js.map +1 -0
- package/lib/components/section/section.js +46 -27
- package/lib/components/section/section.js.map +1 -0
- package/lib/components/section/section.styles.js +4 -0
- package/lib/components/section/section.styles.js.map +1 -0
- package/lib/components/select/select.js +243 -158
- package/lib/components/select/select.js.map +1 -0
- package/lib/components/select/select.styles.js +4 -0
- package/lib/components/select/select.styles.js.map +1 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js +60 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile-radio-controller.js +167 -0
- package/lib/components/select-tile/select-tile-radio-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile.js +228 -223
- package/lib/components/select-tile/select-tile.js.map +1 -0
- package/lib/components/select-tile/select-tile.styles.js +4 -0
- package/lib/components/select-tile/select-tile.styles.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.js +76 -62
- package/lib/components/select-tile-list/select-tile-list.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js +4 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.js +68 -39
- package/lib/components/skeleton-loader/skeleton-loader.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js +4 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js.map +1 -0
- package/lib/components/split-button/split-button.js +51 -46
- package/lib/components/split-button/split-button.js.map +1 -0
- package/lib/components/split-button/split-button.styles.js +4 -0
- package/lib/components/split-button/split-button.styles.js.map +1 -0
- package/lib/components/submenu/submenu.js +19 -16
- package/lib/components/submenu/submenu.js.map +1 -0
- package/lib/components/submenu/submenu.styles.js +4 -0
- package/lib/components/submenu/submenu.styles.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.js +32 -26
- package/lib/components/submenu-item/submenu-item.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.styles.js +4 -0
- package/lib/components/submenu-item/submenu-item.styles.js.map +1 -0
- package/lib/components/tab/tab.js +74 -63
- package/lib/components/tab/tab.js.map +1 -0
- package/lib/components/tab/tab.styles.js +4 -0
- package/lib/components/tab/tab.styles.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.js +49 -43
- package/lib/components/tab-panel/tab-panel.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.styles.js +4 -0
- package/lib/components/tab-panel/tab-panel.styles.js.map +1 -0
- package/lib/components/table/table.js +46 -41
- package/lib/components/table/table.js.map +1 -0
- package/lib/components/table/table.styles.js +4 -0
- package/lib/components/table/table.styles.js.map +1 -0
- package/lib/components/table-body/table-body.js +20 -17
- package/lib/components/table-body/table-body.js.map +1 -0
- package/lib/components/table-body/table-body.styles.js +4 -0
- package/lib/components/table-body/table-body.styles.js.map +1 -0
- package/lib/components/table-cell/table-cell.js +39 -36
- package/lib/components/table-cell/table-cell.js.map +1 -0
- package/lib/components/table-cell/table-cell.styles.js +4 -0
- package/lib/components/table-cell/table-cell.styles.js.map +1 -0
- package/lib/components/table-header/table-header.js +20 -17
- package/lib/components/table-header/table-header.js.map +1 -0
- package/lib/components/table-header/table-header.styles.js +4 -0
- package/lib/components/table-header/table-header.styles.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.js +35 -32
- package/lib/components/table-header-cell/table-header-cell.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js +4 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js.map +1 -0
- package/lib/components/table-object/table-object.js +21 -18
- package/lib/components/table-object/table-object.js.map +1 -0
- package/lib/components/table-object/table-object.styles.js +4 -0
- package/lib/components/table-object/table-object.styles.js.map +1 -0
- package/lib/components/table-row/table-row.js +76 -55
- package/lib/components/table-row/table-row.js.map +1 -0
- package/lib/components/table-row/table-row.styles.js +4 -0
- package/lib/components/table-row/table-row.styles.js.map +1 -0
- package/lib/components/tabs/tabs.js +452 -303
- package/lib/components/tabs/tabs.js.map +1 -0
- package/lib/components/tabs/tabs.styles.js +4 -0
- package/lib/components/tabs/tabs.styles.js.map +1 -0
- package/lib/components/tag/tag.js +236 -167
- package/lib/components/tag/tag.js.map +1 -0
- package/lib/components/tag/tag.styles.js +4 -0
- package/lib/components/tag/tag.styles.js.map +1 -0
- package/lib/components/tag-list/tag-list.js +40 -35
- package/lib/components/tag-list/tag-list.js.map +1 -0
- package/lib/components/tag-list/tag-list.styles.js +4 -0
- package/lib/components/tag-list/tag-list.styles.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.js +40 -33
- package/lib/components/tertiary-nav/tertiary-nav.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js +4 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +52 -43
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js +4 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js.map +1 -0
- package/lib/components/text-link/text-link.js +45 -41
- package/lib/components/text-link/text-link.js.map +1 -0
- package/lib/components/text-link/text-link.styles.js +4 -0
- package/lib/components/text-link/text-link.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.js +145 -0
- package/lib/components/text-passage/text-passage-light-dom.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js +4 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage.js +72 -44
- package/lib/components/text-passage/text-passage.js.map +1 -0
- package/lib/components/text-passage/text-passage.styles.js +4 -0
- package/lib/components/text-passage/text-passage.styles.js.map +1 -0
- package/lib/components/tooltip/tooltip.js +278 -173
- package/lib/components/tooltip/tooltip.js.map +1 -0
- package/lib/components/tooltip/tooltip.styles.js +4 -0
- package/lib/components/tooltip/tooltip.styles.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.js +40 -33
- package/lib/components/utility-nav/utility-nav.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.styles.js +4 -0
- package/lib/components/utility-nav/utility-nav.styles.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.js +70 -49
- package/lib/components/utility-nav-item/utility-nav-item.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js +4 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js.map +1 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js +737 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js +756 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js.map +1 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js +771 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js +772 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js +737 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js +983 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js.map +1 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js +737 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js +736 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js.map +1 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js +737 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js.map +1 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js +771 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js +552 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js +776 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js.map +1 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js +253 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/core/scss/theming/head.module.js +6 -0
- package/lib/design-tokens/core/scss/theming/head.module.js.map +1 -0
- package/lib/design-tokens/tokens_netflix.theme.js +806 -0
- package/lib/design-tokens/tokens_netflix.theme.js.map +1 -0
- package/lib/directives/if-truthy.js +24 -0
- package/lib/directives/if-truthy.js.map +1 -0
- package/lib/directives/spread.js +29 -0
- package/lib/directives/spread.js.map +1 -0
- package/lib/index.js +84 -168
- package/lib/index.js.map +1 -0
- package/lib/scripts/convert-scss-to-ts.js +25 -0
- package/lib/scripts/convert-scss-to-ts.js.map +1 -0
- package/lib/scripts/extract-tokens.js +120 -0
- package/lib/scripts/extract-tokens.js.map +1 -0
- package/lib/scripts/generate-react-wrappers.js +229 -0
- package/lib/scripts/generate-react-wrappers.js.map +1 -0
- package/lib/scripts/generateWesparkleThemes.js +52 -0
- package/lib/scripts/generateWesparkleThemes.js.map +1 -0
- package/lib/toBeAccessible.js +18 -0
- package/lib/toBeAccessible.js.map +1 -0
- package/lib/utilities/is-mobile.js +10 -0
- package/lib/utilities/is-mobile.js.map +1 -0
- package/lib/utilities/story-helpers.js +14 -0
- package/lib/utilities/story-helpers.js.map +1 -0
- package/lib/vite.config.cdn.js +85 -0
- package/lib/vite.config.cdn.js.map +1 -0
- package/lib/vite.config.js +156 -0
- package/lib/vite.config.js.map +1 -0
- package/package.json +8 -9
|
@@ -1,274 +1,424 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var g = Object.defineProperty, r = (l, e, t, i) => {
|
|
7
|
-
for (var s = void 0, n = l.length - 1, h; n >= 0; n--)
|
|
8
|
-
(h = l[n]) && (s = h(e, t, s) || s);
|
|
9
|
-
return s && g(e, t, s), s;
|
|
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;
|
|
10
6
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
* Updated Lifecycle Hook
|
|
54
|
-
* 1. remove selected state from previously selected tab
|
|
55
|
-
* 2. Checks to see if the old `activeIndex` property has been updated.
|
|
56
|
-
* If the new value doesn't equal the old value, activate the proper tab
|
|
57
|
-
*/
|
|
58
|
-
async updated(e) {
|
|
59
|
-
e.forEach(async (t, i) => {
|
|
60
|
-
i === "activeIndex" && this.activeIndex !== t && (await this.updateComplete, this.activeTab && this.removePreviousActiveTab(), this.activeTab = this._Cre8TabItems[this.activeIndex], this.setActiveTab());
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Handle Resize
|
|
65
|
-
* 1. On resize, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
66
|
-
* 2. On resize, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
67
|
-
* @fires resize
|
|
68
|
-
*/
|
|
69
|
-
handleResize() {
|
|
70
|
-
this.setIsStart(), this.setIsEnd();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Handle Scroll
|
|
74
|
-
* 1. On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
75
|
-
* 2. On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
76
|
-
* @fires scroll
|
|
77
|
-
*/
|
|
78
|
-
handleScroll() {
|
|
79
|
-
this.setIsStart(), this.setIsEnd();
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Set isStart State
|
|
83
|
-
* 1. If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
84
|
-
*/
|
|
85
|
-
setIsStart() {
|
|
86
|
-
this.isRTL ? this._Cre8TabsHeaderList.scrollLeft > 0 ? this.isStart = !0 : this.isStart = !1 : this._Cre8TabsHeaderList.scrollLeft > 0 ? this.isStart = !1 : this.isStart = !0;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Set isEnd State
|
|
90
|
-
* 1. If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
91
|
-
*/
|
|
92
|
-
setIsEnd() {
|
|
93
|
-
this.isInViewport() === !0 ? this.isEnd = !0 : this.isEnd = !1;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Check if last overflow list item is in the viewport
|
|
97
|
-
* 1. Get children of the overflow list inner container and get bounding client rectangle of last child
|
|
98
|
-
* 2. Return true if the left property is greater than or equal to 0 and if the right property is less
|
|
99
|
-
* than or equal to the window inner width or document client width
|
|
100
|
-
*/
|
|
101
|
-
isInViewport() {
|
|
102
|
-
const t = this._Cre8TabItems[this._Cre8TabItems.length - 1].shadowRoot?.querySelector(".cre8-c-tab");
|
|
103
|
-
if (!t)
|
|
104
|
-
return !1;
|
|
105
|
-
const i = t.getBoundingClientRect(), s = window.innerWidth || document.documentElement.clientWidth;
|
|
106
|
-
return i.left >= 0 && i.right <= s;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Set Tab Variant
|
|
110
|
-
* 1. Loop through all the cre8-tab Components and set the size to 'sm' if the parent has size 'sm'.
|
|
111
|
-
*/
|
|
112
|
-
setTabVariant() {
|
|
113
|
-
this.size === "sm" && this._Cre8TabItems.forEach((e) => {
|
|
114
|
-
e.size = "sm";
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Set the attributes on tab and tab panel
|
|
119
|
-
* 1. Sets the index value on the tab items.
|
|
120
|
-
* 2. Sets the `aria-labelledby` on the tab items.
|
|
121
|
-
* 3. Set the index and id on the tab-panel to match the tab.
|
|
122
|
-
*/
|
|
123
|
-
setTabAttributes() {
|
|
124
|
-
this._Cre8TabItems.forEach((e, t) => {
|
|
125
|
-
e.index = t;
|
|
126
|
-
const s = e.ariaLabelledBy || u();
|
|
127
|
-
e.ariaLabelledBy = s;
|
|
128
|
-
const n = this._Cre8TabPanels[t];
|
|
129
|
-
n.index = t;
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Set Active Tab
|
|
134
|
-
* 1. Sets the active state for the selected tab.
|
|
135
|
-
* 2. Sets the active state for the tab panel with the same index value as the selected tab.
|
|
136
|
-
*/
|
|
137
|
-
setActiveTab() {
|
|
138
|
-
this.activeTab.isActive = !0;
|
|
139
|
-
const e = this._Cre8TabPanels.find((t) => t.index === this.activeTab.index);
|
|
140
|
-
e && (e.isActive = !0);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Set Active Tab Focus
|
|
144
|
-
*/
|
|
145
|
-
setActiveTabFocus() {
|
|
146
|
-
this.activeTab.shadowRoot?.querySelector(".cre8-c-tab").focus();
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Handle Tab Selected
|
|
150
|
-
* 1. Only continue if event target is a tab
|
|
151
|
-
* 2. If tab is active, make the previous selected tab inactive.
|
|
152
|
-
* 3. Set the clicked tab active.
|
|
153
|
-
* 4. Emit the custom event.
|
|
154
|
-
* @fires tabSelected
|
|
155
|
-
*/
|
|
156
|
-
handleTabSelected(e) {
|
|
157
|
-
const { target: t } = e;
|
|
158
|
-
if (this._Cre8TabItems.includes(t)) {
|
|
159
|
-
this.activeTab && this.removePreviousActiveTab(), this.activeTab = t;
|
|
160
|
-
const i = this._Cre8TabItems.findIndex((s) => s === this.activeTab);
|
|
161
|
-
this.activeIndex = i, this.setActiveTab(), this.emitEvent();
|
|
7
|
+
import { html, } from 'lit';
|
|
8
|
+
import { property, query, queryAssignedElements, state, } from 'lit/decorators.js';
|
|
9
|
+
import { nanoid } from 'nanoid';
|
|
10
|
+
import { Cre8Element } from '../cre8-element';
|
|
11
|
+
import styles from './tabs.styles.js';
|
|
12
|
+
let tabId = 1;
|
|
13
|
+
/**
|
|
14
|
+
* Tabs are used to quickly navigate back and forth between views.
|
|
15
|
+
* The Tab design and interaction varies depending on the requirements for your organization and project.
|
|
16
|
+
* Standardizing on the best individual controls will improve usability and reduce development and QA time.
|
|
17
|
+
*
|
|
18
|
+
* Create a standard set of Tab controls:
|
|
19
|
+
* Primary Tabs (for system navigation), Secondary Tabs (for sub navigation within a screen).
|
|
20
|
+
*
|
|
21
|
+
* ## Usability Guidelines
|
|
22
|
+
* - The selected Tab should be visually differentiated from the other Tabs.
|
|
23
|
+
* The deselected Tabs should still look enabled.
|
|
24
|
+
* Dimming the other Tabs decreases the legibility of items that are actually active and clickable.
|
|
25
|
+
* - There must be a minimum of 2 Tabs.
|
|
26
|
+
* - Showing status in a Tab is non-standard (such as 0%, 10%).
|
|
27
|
+
* - Tab labels and content should be parallel, with the exception of a Summary or Overview Tab
|
|
28
|
+
* which can be a rollup of content across other Tabs.
|
|
29
|
+
* - Keep the font size of the Tabs the same.
|
|
30
|
+
* If the Tabs are a fixed width and one of the labels is too long,
|
|
31
|
+
* don't resize the text to fit and consider wrapping text to a second line.
|
|
32
|
+
* - If possible, don't truncate text because it makes it harder to understand what's in the Tab.
|
|
33
|
+
* - Try not to use more than six Tabs to keep the UI uncluttered.
|
|
34
|
+
* - Do not stack Tabs on top of each other, and do not nest Tabs within Tabs.
|
|
35
|
+
* Find alternate ways of navigating page hierarchy.
|
|
36
|
+
*
|
|
37
|
+
* @slot default - Default, unnamed slot container for each `cre8-tab` button
|
|
38
|
+
* @slot panel - Container for each `cre8-tab-panel` content item
|
|
39
|
+
*/
|
|
40
|
+
export class Cre8Tabs extends Cre8Element {
|
|
41
|
+
/**
|
|
42
|
+
* Query the document direction value
|
|
43
|
+
*
|
|
44
|
+
* _*This property is dynamically set_
|
|
45
|
+
*/
|
|
46
|
+
get isRTL() {
|
|
47
|
+
return document.dir === 'rtl';
|
|
162
48
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Initialize Functions
|
|
51
|
+
*/
|
|
52
|
+
constructor() {
|
|
53
|
+
super();
|
|
54
|
+
/**
|
|
55
|
+
* Sets the initial active tab (e.g. 0 sets the first tab, 1 sets the second tab, etc.)
|
|
56
|
+
* @attr {number}
|
|
57
|
+
*/
|
|
58
|
+
this.activeIndex = 0;
|
|
59
|
+
/**
|
|
60
|
+
* If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
61
|
+
*
|
|
62
|
+
* _*This property is dynamically set_
|
|
63
|
+
* @attr {boolean}
|
|
64
|
+
*/
|
|
65
|
+
this.isStart = true;
|
|
66
|
+
/**
|
|
67
|
+
* If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
68
|
+
*
|
|
69
|
+
* _*This property is dynamically set_
|
|
70
|
+
* @attr {boolean}
|
|
71
|
+
*/
|
|
72
|
+
this.isEnd = false;
|
|
73
|
+
this.handleScroll = this.handleScroll.bind(this);
|
|
74
|
+
this.handleResize = this.handleResize.bind(this);
|
|
75
|
+
this.setIsStart = this.setIsStart.bind(this);
|
|
76
|
+
this.setIsEnd = this.setIsEnd.bind(this);
|
|
77
|
+
this.emitEvent = this.emitEvent.bind(this);
|
|
78
|
+
/**
|
|
79
|
+
* Set the tab id.
|
|
80
|
+
*/
|
|
81
|
+
this.tabId = `cre8-tabpanel-${tabId}`;
|
|
82
|
+
tabId += 1;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Connected Callback Lifecycle
|
|
86
|
+
* 1. Fires each time a custom element is appended into a document-connected element.
|
|
87
|
+
*/
|
|
88
|
+
connectedCallback() {
|
|
89
|
+
super.connectedCallback();
|
|
90
|
+
window.addEventListener('resize', this.handleResize);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Disconnected Callback Lifecycle
|
|
94
|
+
* 1. Removes the event listeners to ensure that any memory allocated by your component
|
|
95
|
+
* will be cleaned up when your component is destroyed or disconnected from the page.
|
|
96
|
+
*/
|
|
97
|
+
disconnectedCallback() {
|
|
98
|
+
super.disconnectedCallback();
|
|
99
|
+
window.removeEventListener('resize', this.handleResize);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* First Updated Lifecycle Hook
|
|
103
|
+
* 1. Sets the `aria-labelledby` prop for accessible tabs if user doesn't define the `ariaLabelledBy` prop.
|
|
104
|
+
* 2. Sets the active tab if activeIndex is defined. Otherwise, set the first tab as active by default.
|
|
105
|
+
* 3. Initialize isStart and isEnd.
|
|
106
|
+
* 4. Set the varaint on the cre8-tab according to the cre8-tabs variant.
|
|
107
|
+
*/
|
|
108
|
+
async firstUpdated() {
|
|
109
|
+
/* 1 */
|
|
110
|
+
this.setTabAttributes();
|
|
111
|
+
await this.updateComplete;
|
|
178
112
|
/* 2 */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
break;
|
|
113
|
+
this.activeTab = this._Cre8TabItems[this.activeIndex] || this._Cre8TabItems[0];
|
|
114
|
+
this.setActiveTab();
|
|
182
115
|
/* 3 */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
break;
|
|
116
|
+
this.setIsStart();
|
|
117
|
+
this.setIsEnd();
|
|
186
118
|
/* 4 */
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
119
|
+
this.setTabVariant();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Updated Lifecycle Hook
|
|
123
|
+
* 1. remove selected state from previously selected tab
|
|
124
|
+
* 2. Checks to see if the old `activeIndex` property has been updated.
|
|
125
|
+
* If the new value doesn't equal the old value, activate the proper tab
|
|
126
|
+
*/
|
|
127
|
+
async updated(changedProperties) {
|
|
128
|
+
changedProperties.forEach(async (oldValue, propName) => {
|
|
129
|
+
if (propName === 'activeIndex' && this.activeIndex !== oldValue) {
|
|
130
|
+
await this.updateComplete;
|
|
131
|
+
if (this.activeTab) {
|
|
132
|
+
this.removePreviousActiveTab(); /* 1 */
|
|
133
|
+
}
|
|
134
|
+
this.activeTab = this._Cre8TabItems[this.activeIndex];
|
|
135
|
+
this.setActiveTab(); /* 2 */
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Handle Resize
|
|
141
|
+
* 1. On resize, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
142
|
+
* 2. On resize, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
143
|
+
* @fires resize
|
|
144
|
+
*/
|
|
145
|
+
handleResize() {
|
|
146
|
+
this.setIsStart(); /* 1 */
|
|
147
|
+
this.setIsEnd(); /* 2 */
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Handle Scroll
|
|
151
|
+
* 1. On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
152
|
+
* 2. On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
153
|
+
* @fires scroll
|
|
154
|
+
*/
|
|
155
|
+
handleScroll() {
|
|
156
|
+
this.setIsStart(); /* 1 */
|
|
157
|
+
this.setIsEnd(); /* 2 */
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Set isStart State
|
|
161
|
+
* 1. If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
162
|
+
*/
|
|
163
|
+
setIsStart() {
|
|
164
|
+
if (this.isRTL) {
|
|
165
|
+
if (this._Cre8TabsHeaderList.scrollLeft > 0) {
|
|
166
|
+
this.isStart = true;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.isStart = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (this._Cre8TabsHeaderList.scrollLeft > 0) {
|
|
173
|
+
this.isStart = false;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.isStart = true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Set isEnd State
|
|
181
|
+
* 1. If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
182
|
+
*/
|
|
183
|
+
setIsEnd() {
|
|
184
|
+
if (this.isInViewport() === true) {
|
|
185
|
+
this.isEnd = true;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.isEnd = false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Check if last overflow list item is in the viewport
|
|
193
|
+
* 1. Get children of the overflow list inner container and get bounding client rectangle of last child
|
|
194
|
+
* 2. Return true if the left property is greater than or equal to 0 and if the right property is less
|
|
195
|
+
* than or equal to the window inner width or document client width
|
|
196
|
+
*/
|
|
197
|
+
isInViewport() {
|
|
198
|
+
const lastChild = this._Cre8TabItems[this._Cre8TabItems.length - 1];
|
|
199
|
+
const tabElement = lastChild.shadowRoot?.querySelector('.cre8-c-tab');
|
|
200
|
+
if (!tabElement) {
|
|
201
|
+
return false; // Return false if the tab element is not found
|
|
202
|
+
}
|
|
203
|
+
const rect = tabElement.getBoundingClientRect(); /* 1 */
|
|
204
|
+
const windowWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
205
|
+
return rect.left >= 0 && rect.right <= windowWidth; /* 2 */
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Set Tab Variant
|
|
209
|
+
* 1. Loop through all the cre8-tab Components and set the size to 'sm' if the parent has size 'sm'.
|
|
210
|
+
*/
|
|
211
|
+
setTabVariant() {
|
|
212
|
+
if (this.size === 'sm') {
|
|
213
|
+
this._Cre8TabItems.forEach((tab) => {
|
|
214
|
+
tab.size = 'sm';
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Set the attributes on tab and tab panel
|
|
220
|
+
* 1. Sets the index value on the tab items.
|
|
221
|
+
* 2. Sets the `aria-labelledby` on the tab items.
|
|
222
|
+
* 3. Set the index and id on the tab-panel to match the tab.
|
|
223
|
+
*/
|
|
224
|
+
setTabAttributes() {
|
|
225
|
+
this._Cre8TabItems.forEach((tab, index) => {
|
|
226
|
+
/* 1 */
|
|
227
|
+
tab.index = index;
|
|
228
|
+
/* 2 */
|
|
229
|
+
const ariaLabelledBy = tab.ariaLabelledBy;
|
|
230
|
+
const id = ariaLabelledBy || nanoid();
|
|
231
|
+
tab.ariaLabelledBy = id;
|
|
232
|
+
/* 3 */
|
|
233
|
+
const tabPanel = this._Cre8TabPanels[index];
|
|
234
|
+
tabPanel.index = index;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Set Active Tab
|
|
239
|
+
* 1. Sets the active state for the selected tab.
|
|
240
|
+
* 2. Sets the active state for the tab panel with the same index value as the selected tab.
|
|
241
|
+
*/
|
|
242
|
+
setActiveTab() {
|
|
243
|
+
/* 1 */
|
|
244
|
+
this.activeTab.isActive = true;
|
|
245
|
+
/* 2 */
|
|
246
|
+
const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);
|
|
247
|
+
if (activeTabPanel) {
|
|
248
|
+
activeTabPanel.isActive = true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Set Active Tab Focus
|
|
253
|
+
*/
|
|
254
|
+
setActiveTabFocus() {
|
|
255
|
+
this.activeTab.shadowRoot?.querySelector('.cre8-c-tab').focus();
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Handle Tab Selected
|
|
259
|
+
* 1. Only continue if event target is a tab
|
|
260
|
+
* 2. If tab is active, make the previous selected tab inactive.
|
|
261
|
+
* 3. Set the clicked tab active.
|
|
262
|
+
* 4. Emit the custom event.
|
|
263
|
+
* @fires tabSelected
|
|
264
|
+
*/
|
|
265
|
+
handleTabSelected(event) {
|
|
266
|
+
const { target } = event;
|
|
267
|
+
/* 1 */
|
|
268
|
+
if (this._Cre8TabItems.includes(target)) {
|
|
269
|
+
/* 2 */
|
|
270
|
+
if (this.activeTab) {
|
|
271
|
+
this.removePreviousActiveTab();
|
|
272
|
+
}
|
|
273
|
+
/* 3 */
|
|
274
|
+
this.activeTab = target;
|
|
275
|
+
const activeIndex = this._Cre8TabItems.findIndex((tab) => tab === this.activeTab);
|
|
276
|
+
this.activeIndex = activeIndex;
|
|
277
|
+
this.setActiveTab();
|
|
278
|
+
/* 4 */
|
|
279
|
+
this.emitEvent();
|
|
280
|
+
}
|
|
217
281
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Handle Keydown
|
|
284
|
+
* 1. If the active tab is not focused then handle the keydown events.
|
|
285
|
+
* 2. On keydown of the right arrow, make the next tab active.
|
|
286
|
+
* 3. On keydown of the left arrow, make the previous tab active.
|
|
287
|
+
* 4. On keydown of the home key, make the first tab active.
|
|
288
|
+
* 5. On keydown of the end key, make the last tab active.
|
|
289
|
+
* 6. On keydown of the escape key, remove the focus.
|
|
290
|
+
* @fires keydown
|
|
291
|
+
*/
|
|
292
|
+
handleKeydown(event) {
|
|
293
|
+
/* 1 */
|
|
294
|
+
const { target } = event;
|
|
295
|
+
const focused = document.activeElement;
|
|
296
|
+
if (!focused.matches('cre8-tab')) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
switch (event.key) {
|
|
300
|
+
/* 2 */
|
|
301
|
+
case 'ArrowRight':
|
|
302
|
+
event.preventDefault();
|
|
303
|
+
this.setSelectedToNextTab(target);
|
|
304
|
+
break;
|
|
305
|
+
/* 3 */
|
|
306
|
+
case 'ArrowLeft':
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
this.setSelectedToPreviousTab(target);
|
|
309
|
+
break;
|
|
310
|
+
/* 4 */
|
|
311
|
+
case 'Home':
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
this.setSelectedToNextTab(this._Cre8TabItems[this._Cre8TabItems.length - 1]);
|
|
314
|
+
break;
|
|
315
|
+
/* 5 */
|
|
316
|
+
case 'End':
|
|
317
|
+
event.preventDefault();
|
|
318
|
+
this.setSelectedToPreviousTab(this._Cre8TabItems[0]);
|
|
319
|
+
break;
|
|
320
|
+
/* 6 */
|
|
321
|
+
case 'Escape':
|
|
322
|
+
this.activeTab.blur();
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
// no default
|
|
326
|
+
}
|
|
237
327
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
328
|
+
/**
|
|
329
|
+
* Set Selected To Previous Tab
|
|
330
|
+
* 1. Get current selected Tab index then deactivate previously selected tab.
|
|
331
|
+
* 2. If current activeIndex is in first position then move the tab focus to last tab.
|
|
332
|
+
* 3. Set the active tab and focus.
|
|
333
|
+
* 4. Emit custom event.
|
|
334
|
+
* @fires tabChange
|
|
335
|
+
*/
|
|
336
|
+
setSelectedToPreviousTab(currentTab) {
|
|
337
|
+
/* 1 */
|
|
338
|
+
const activeIndex = currentTab.index;
|
|
339
|
+
this.removePreviousActiveTab();
|
|
340
|
+
/* 2 */
|
|
341
|
+
const tabListLength = this._Cre8TabItems.length - 1;
|
|
342
|
+
if (activeIndex === 0) {
|
|
343
|
+
this.activeIndex = tabListLength;
|
|
344
|
+
this.activeTab = this._Cre8TabItems[tabListLength];
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
const previousIndex = activeIndex - 1;
|
|
348
|
+
this.activeIndex = previousIndex;
|
|
349
|
+
this.activeTab = this._Cre8TabItems[previousIndex];
|
|
350
|
+
}
|
|
351
|
+
/* 3 */
|
|
352
|
+
this.setActiveTab();
|
|
353
|
+
this.setActiveTabFocus();
|
|
354
|
+
/* 4 */
|
|
355
|
+
this.emitEvent();
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Set Selected To Next Tab
|
|
359
|
+
* 1. Get current selected Tab index then deactivate previously selected tab.
|
|
360
|
+
* 2. If current activeIndex is in last position then move the tab focus to first tab.
|
|
361
|
+
* 3. Set the active tab and focus.
|
|
362
|
+
* 4. Emit custom event.
|
|
363
|
+
* @fires tabChange
|
|
364
|
+
*/
|
|
365
|
+
setSelectedToNextTab(currentTab) {
|
|
366
|
+
/* 1 */
|
|
367
|
+
const activeIndex = currentTab.index;
|
|
368
|
+
this.removePreviousActiveTab();
|
|
369
|
+
/* 2 */
|
|
370
|
+
const tabListLength = this._Cre8TabItems.length - 1;
|
|
371
|
+
if (activeIndex === tabListLength) {
|
|
372
|
+
this.activeIndex = 0;
|
|
373
|
+
this.activeTab = this._Cre8TabItems[0];
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
const nextIndex = activeIndex + 1;
|
|
377
|
+
this.activeIndex = nextIndex;
|
|
378
|
+
this.activeTab = this._Cre8TabItems[nextIndex];
|
|
379
|
+
}
|
|
380
|
+
/* 3 */
|
|
381
|
+
this.setActiveTab();
|
|
382
|
+
this.setActiveTabFocus();
|
|
383
|
+
/* 4 */
|
|
384
|
+
this.emitEvent();
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Remove Active from Previous Tab
|
|
388
|
+
* 1. Get current selected Tab index then deactivate previously selected tab
|
|
389
|
+
* 2. If current activeIndex is in first position then move the tab focus to last tab
|
|
390
|
+
*/
|
|
391
|
+
removePreviousActiveTab() {
|
|
392
|
+
/* 1 */
|
|
393
|
+
this.activeTab.isActive = false;
|
|
394
|
+
/* 2 */
|
|
395
|
+
const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);
|
|
396
|
+
if (activeTabPanel) {
|
|
397
|
+
activeTabPanel.isActive = false;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Emit custom event
|
|
402
|
+
*/
|
|
403
|
+
emitEvent() {
|
|
404
|
+
const customEvent = new CustomEvent('tabChange', {
|
|
405
|
+
detail: {
|
|
406
|
+
value: this.activeTab,
|
|
407
|
+
activeTabIndex: this.activeIndex,
|
|
408
|
+
},
|
|
409
|
+
bubbles: true,
|
|
410
|
+
composed: true,
|
|
411
|
+
});
|
|
412
|
+
this.dispatchEvent(customEvent);
|
|
413
|
+
}
|
|
414
|
+
render() {
|
|
415
|
+
const componentClassNames = this.componentClassNames('cre8-c-tabs', {
|
|
416
|
+
'cre8-is-start': this.isStart === true,
|
|
417
|
+
'cre8-is-end': this.isEnd === true,
|
|
418
|
+
'cre8-c-tabs--full-width': this.fullWidth,
|
|
419
|
+
});
|
|
420
|
+
return html `
|
|
421
|
+
<div class="${componentClassNames}">
|
|
272
422
|
<div class="cre8-c-tabs__header">
|
|
273
423
|
<div
|
|
274
424
|
class="cre8-c-tabs__list"
|
|
@@ -286,42 +436,41 @@ const o = class o extends T {
|
|
|
286
436
|
</div>
|
|
287
437
|
</div>
|
|
288
438
|
`;
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
customElements.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
};
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
Cre8Tabs.styles = [styles];
|
|
442
|
+
__decorate([
|
|
443
|
+
property()
|
|
444
|
+
], Cre8Tabs.prototype, "size", void 0);
|
|
445
|
+
__decorate([
|
|
446
|
+
property({ type: Boolean, reflect: true })
|
|
447
|
+
], Cre8Tabs.prototype, "fullWidth", void 0);
|
|
448
|
+
__decorate([
|
|
449
|
+
property({ type: Number })
|
|
450
|
+
], Cre8Tabs.prototype, "activeIndex", void 0);
|
|
451
|
+
__decorate([
|
|
452
|
+
state()
|
|
453
|
+
], Cre8Tabs.prototype, "activeTab", void 0);
|
|
454
|
+
__decorate([
|
|
455
|
+
state()
|
|
456
|
+
], Cre8Tabs.prototype, "isStart", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
state()
|
|
459
|
+
], Cre8Tabs.prototype, "isEnd", void 0);
|
|
460
|
+
__decorate([
|
|
461
|
+
queryAssignedElements()
|
|
462
|
+
], Cre8Tabs.prototype, "_Cre8TabItems", void 0);
|
|
463
|
+
__decorate([
|
|
464
|
+
queryAssignedElements({ slot: 'panel' })
|
|
465
|
+
], Cre8Tabs.prototype, "_Cre8TabPanels", void 0);
|
|
466
|
+
__decorate([
|
|
467
|
+
query('.cre8-c-tabs__header')
|
|
468
|
+
], Cre8Tabs.prototype, "_Cre8TabsHeader", void 0);
|
|
469
|
+
__decorate([
|
|
470
|
+
query('.cre8-c-tabs__list')
|
|
471
|
+
], Cre8Tabs.prototype, "_Cre8TabsHeaderList", void 0);
|
|
472
|
+
if (customElements.get('cre8-tabs') === undefined) {
|
|
473
|
+
customElements.define('cre8-tabs', Cre8Tabs);
|
|
474
|
+
}
|
|
475
|
+
export default Cre8Tabs;
|
|
476
|
+
//# sourceMappingURL=tabs.js.map
|