@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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9B;IADC,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDACL;AAMpC;IADC,KAAK,CAAC,sBAAsB,CAAC;iDACD;AAM7B;IADC,KAAK,CAAC,oBAAoB,CAAC;qDACK;AAqarC,IAAI,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE,CAAC;IAChD,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAQD,eAAe,QAAQ,CAAC","sourcesContent":["import { html, } from 'lit';\nimport {\n property, query, queryAssignedElements, state,\n} from 'lit/decorators.js';\nimport { nanoid } from 'nanoid';\nimport { Cre8Element } from '../cre8-element';\nimport { Cre8TabPanel } from '../tab-panel/tab-panel';\nimport { Cre8Tab } from '../tab/tab';\nimport styles from './tabs.styles.js';\n\nlet tabId = 1;\n\n/**\n * Tabs are used to quickly navigate back and forth between views.\n * The Tab design and interaction varies depending on the requirements for your organization and project.\n * Standardizing on the best individual controls will improve usability and reduce development and QA time.\n *\n * Create a standard set of Tab controls:\n * Primary Tabs (for system navigation), Secondary Tabs (for sub navigation within a screen).\n *\n * ## Usability Guidelines\n * - The selected Tab should be visually differentiated from the other Tabs.\n * The deselected Tabs should still look enabled.\n * Dimming the other Tabs decreases the legibility of items that are actually active and clickable.\n * - There must be a minimum of 2 Tabs.\n * - Showing status in a Tab is non-standard (such as 0%, 10%).\n * - Tab labels and content should be parallel, with the exception of a Summary or Overview Tab\n * which can be a rollup of content across other Tabs.\n * - Keep the font size of the Tabs the same.\n * If the Tabs are a fixed width and one of the labels is too long,\n * don't resize the text to fit and consider wrapping text to a second line.\n * - If possible, don't truncate text because it makes it harder to understand what's in the Tab.\n * - Try not to use more than six Tabs to keep the UI uncluttered.\n * - Do not stack Tabs on top of each other, and do not nest Tabs within Tabs.\n * Find alternate ways of navigating page hierarchy.\n *\n * @slot default - Default, unnamed slot container for each `cre8-tab` button\n * @slot panel - Container for each `cre8-tab-panel` content item\n */\n\nexport class Cre8Tabs extends Cre8Element {\n static styles = [styles];\n\n /**\n * Tab sizes\n * - **default** displays the cre8-tab text with cre8-typography-label-default\n * - **sm** displays the cre8-tab text with cre8-typography-label-small\n * @type {\"sm\"}\n * @attr\n */\n @property()\n size?: 'sm';\n\n /**\n * Displays a set of tabs with a spanning the width of the element\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n fullWidth?: boolean;\n\n /**\n * Auto Increment id to sync tab and tab panel\n *\n * _*This property is dynamically set_\n */\n tabId: string;\n\n /**\n * Sets the initial active tab (e.g. 0 sets the first tab, 1 sets the second tab, etc.)\n * @attr {number}\n */\n @property({ type: Number })\n activeIndex?: number = 0;\n\n /**\n * The active tab\n *\n * _*This property is dynamically set_\n */\n @state()\n activeTab?: Cre8Tab;\n\n /**\n * If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.\n *\n * _*This property is dynamically set_\n * @attr {boolean}\n */\n @state()\n isStart?: boolean = true;\n\n /**\n * If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.\n *\n * _*This property is dynamically set_\n * @attr {boolean}\n */\n @state()\n isEnd?: boolean = false;\n\n /**\n * Query all the tab items\n */\n @queryAssignedElements()\n _Cre8TabItems: Array<Cre8Tab>;\n\n /**\n * Query all the tab panels\n */\n @queryAssignedElements({ slot: 'panel' })\n _Cre8TabPanels: Array<Cre8TabPanel>;\n\n /**\n * Query the tabs header element\n */\n @query('.cre8-c-tabs__header')\n _Cre8TabsHeader: HTMLElement;\n\n /**\n * Query the tabs header list element\n */\n @query('.cre8-c-tabs__list')\n _Cre8TabsHeaderList: HTMLElement;\n\n /**\n * Query the document direction value\n *\n * _*This property is dynamically set_\n */\n get isRTL() {\n return document.dir === 'rtl';\n }\n\n /**\n * Initialize Functions\n */\n constructor() {\n super();\n this.handleScroll = this.handleScroll.bind(this);\n this.handleResize = this.handleResize.bind(this);\n this.setIsStart = this.setIsStart.bind(this);\n this.setIsEnd = this.setIsEnd.bind(this);\n this.emitEvent = this.emitEvent.bind(this);\n\n /**\n * Set the tab id.\n */\n this.tabId = `cre8-tabpanel-${tabId}`;\n tabId += 1;\n }\n\n /**\n * Connected Callback Lifecycle\n * 1. Fires each time a custom element is appended into a document-connected element.\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.handleResize);\n }\n\n /**\n * Disconnected Callback Lifecycle\n * 1. Removes the event listeners to ensure that any memory allocated by your component\n * will be cleaned up when your component is destroyed or disconnected from the page.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.handleResize);\n }\n\n /**\n * First Updated Lifecycle Hook\n * 1. Sets the `aria-labelledby` prop for accessible tabs if user doesn't define the `ariaLabelledBy` prop.\n * 2. Sets the active tab if activeIndex is defined. Otherwise, set the first tab as active by default.\n * 3. Initialize isStart and isEnd.\n * 4. Set the varaint on the cre8-tab according to the cre8-tabs variant.\n */\n async firstUpdated() {\n /* 1 */\n this.setTabAttributes();\n await this.updateComplete;\n\n /* 2 */\n this.activeTab = this._Cre8TabItems[this.activeIndex] || this._Cre8TabItems[0];\n this.setActiveTab();\n\n /* 3 */\n this.setIsStart();\n this.setIsEnd();\n\n /* 4 */\n this.setTabVariant();\n }\n\n /**\n * Updated Lifecycle Hook\n * 1. remove selected state from previously selected tab\n * 2. Checks to see if the old `activeIndex` property has been updated.\n * If the new value doesn't equal the old value, activate the proper tab\n */\n async updated(changedProperties: Map<string, unknown>) {\n changedProperties.forEach(async (oldValue, propName) => {\n if (propName === 'activeIndex' && this.activeIndex !== oldValue) {\n await this.updateComplete;\n\n if (this.activeTab) {\n this.removePreviousActiveTab(); /* 1 */\n }\n\n this.activeTab = this._Cre8TabItems[this.activeIndex];\n this.setActiveTab(); /* 2 */\n }\n });\n }\n\n /**\n * Handle Resize\n * 1. On resize, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.\n * 2. On resize, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.\n * @fires resize\n */\n handleResize() {\n this.setIsStart(); /* 1 */\n this.setIsEnd(); /* 2 */\n }\n\n /**\n * Handle Scroll\n * 1. On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.\n * 2. On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.\n * @fires scroll\n */\n handleScroll() {\n this.setIsStart(); /* 1 */\n this.setIsEnd(); /* 2 */\n }\n\n /**\n * Set isStart State\n * 1. If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.\n */\n setIsStart() {\n if (this.isRTL) {\n if (this._Cre8TabsHeaderList.scrollLeft > 0) {\n this.isStart = true;\n } else {\n this.isStart = false;\n }\n } else if (this._Cre8TabsHeaderList.scrollLeft > 0) {\n this.isStart = false;\n } else {\n this.isStart = true;\n }\n }\n\n /**\n * Set isEnd State\n * 1. If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.\n */\n setIsEnd() {\n if (this.isInViewport() === true) {\n this.isEnd = true;\n } else {\n this.isEnd = false;\n }\n }\n\n /**\n * Check if last overflow list item is in the viewport\n * 1. Get children of the overflow list inner container and get bounding client rectangle of last child\n * 2. Return true if the left property is greater than or equal to 0 and if the right property is less\n * than or equal to the window inner width or document client width\n */\n isInViewport() {\n const lastChild = this._Cre8TabItems[this._Cre8TabItems.length - 1];\n const tabElement = lastChild.shadowRoot?.querySelector('.cre8-c-tab');\n if (!tabElement) {\n return false; // Return false if the tab element is not found\n }\n\n const rect = tabElement.getBoundingClientRect(); /* 1 */\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n return rect.left >= 0 && rect.right <= windowWidth; /* 2 */\n }\n\n /**\n * Set Tab Variant\n * 1. Loop through all the cre8-tab Components and set the size to 'sm' if the parent has size 'sm'.\n */\n setTabVariant() {\n if (this.size === 'sm') {\n this._Cre8TabItems.forEach((tab: Cre8Tab) => {\n tab.size = 'sm';\n });\n }\n }\n\n /**\n * Set the attributes on tab and tab panel\n * 1. Sets the index value on the tab items.\n * 2. Sets the `aria-labelledby` on the tab items.\n * 3. Set the index and id on the tab-panel to match the tab.\n */\n setTabAttributes() {\n this._Cre8TabItems.forEach((tab, index) => {\n /* 1 */\n tab.index = index;\n\n /* 2 */\n const ariaLabelledBy = tab.ariaLabelledBy;\n const id = ariaLabelledBy || nanoid();\n tab.ariaLabelledBy = id;\n\n\n /* 3 */\n const tabPanel = this._Cre8TabPanels[index];\n tabPanel.index = index;\n });\n }\n\n /**\n * Set Active Tab\n * 1. Sets the active state for the selected tab.\n * 2. Sets the active state for the tab panel with the same index value as the selected tab.\n */\n setActiveTab() {\n /* 1 */\n this.activeTab.isActive = true;\n\n /* 2 */\n const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);\n if (activeTabPanel) {\n activeTabPanel.isActive = true;\n }\n }\n\n /**\n * Set Active Tab Focus\n */\n setActiveTabFocus() {\n this.activeTab.shadowRoot?.querySelector<HTMLElement>('.cre8-c-tab').focus();\n }\n\n /**\n * Handle Tab Selected\n * 1. Only continue if event target is a tab\n * 2. If tab is active, make the previous selected tab inactive.\n * 3. Set the clicked tab active.\n * 4. Emit the custom event.\n * @fires tabSelected\n */\n handleTabSelected(event: MouseEvent) {\n const { target } = event;\n\n /* 1 */\n if (this._Cre8TabItems.includes(target as Cre8Tab)) {\n /* 2 */\n if (this.activeTab) {\n this.removePreviousActiveTab();\n }\n\n /* 3 */\n this.activeTab = target as Cre8Tab;\n const activeIndex = this._Cre8TabItems.findIndex((tab) => tab === this.activeTab);\n this.activeIndex = activeIndex;\n this.setActiveTab();\n\n /* 4 */\n this.emitEvent();\n }\n }\n\n /**\n * Handle Keydown\n * 1. If the active tab is not focused then handle the keydown events.\n * 2. On keydown of the right arrow, make the next tab active.\n * 3. On keydown of the left arrow, make the previous tab active.\n * 4. On keydown of the home key, make the first tab active.\n * 5. On keydown of the end key, make the last tab active.\n * 6. On keydown of the escape key, remove the focus.\n * @fires keydown\n */\n handleKeydown(event: KeyboardEvent) {\n /* 1 */\n const { target } = event;\n const focused = document.activeElement as Cre8Tab;\n if (!focused.matches('cre8-tab')) {\n return;\n }\n switch (event.key) {\n /* 2 */\n case 'ArrowRight':\n event.preventDefault();\n this.setSelectedToNextTab(target as Cre8Tab);\n break;\n /* 3 */\n case 'ArrowLeft':\n event.preventDefault();\n this.setSelectedToPreviousTab(target as Cre8Tab);\n break;\n /* 4 */\n case 'Home':\n event.preventDefault();\n this.setSelectedToNextTab(this._Cre8TabItems[this._Cre8TabItems.length - 1]);\n break;\n /* 5 */\n case 'End':\n event.preventDefault();\n this.setSelectedToPreviousTab(this._Cre8TabItems[0]);\n break;\n /* 6 */\n case 'Escape':\n this.activeTab.blur();\n break;\n default:\n // no default\n }\n }\n\n /**\n * Set Selected To Previous Tab\n * 1. Get current selected Tab index then deactivate previously selected tab.\n * 2. If current activeIndex is in first position then move the tab focus to last tab.\n * 3. Set the active tab and focus.\n * 4. Emit custom event.\n * @fires tabChange\n */\n setSelectedToPreviousTab(currentTab: Cre8Tab) {\n /* 1 */\n const activeIndex = currentTab.index;\n this.removePreviousActiveTab();\n\n /* 2 */\n const tabListLength = this._Cre8TabItems.length - 1;\n if (activeIndex === 0) {\n this.activeIndex = tabListLength;\n this.activeTab = this._Cre8TabItems[tabListLength];\n } else {\n const previousIndex = activeIndex - 1;\n this.activeIndex = previousIndex;\n this.activeTab = this._Cre8TabItems[previousIndex];\n }\n\n /* 3 */\n this.setActiveTab();\n this.setActiveTabFocus();\n\n /* 4 */\n this.emitEvent();\n }\n\n /**\n * Set Selected To Next Tab\n * 1. Get current selected Tab index then deactivate previously selected tab.\n * 2. If current activeIndex is in last position then move the tab focus to first tab.\n * 3. Set the active tab and focus.\n * 4. Emit custom event.\n * @fires tabChange\n */\n setSelectedToNextTab(currentTab: Cre8Tab) {\n /* 1 */\n const activeIndex = currentTab.index;\n this.removePreviousActiveTab();\n\n /* 2 */\n const tabListLength = this._Cre8TabItems.length - 1;\n if (activeIndex === tabListLength) {\n this.activeIndex = 0;\n this.activeTab = this._Cre8TabItems[0];\n } else {\n const nextIndex = activeIndex + 1;\n this.activeIndex = nextIndex;\n this.activeTab = this._Cre8TabItems[nextIndex];\n }\n\n /* 3 */\n this.setActiveTab();\n this.setActiveTabFocus();\n\n /* 4 */\n this.emitEvent();\n }\n\n /**\n * Remove Active from Previous Tab\n * 1. Get current selected Tab index then deactivate previously selected tab\n * 2. If current activeIndex is in first position then move the tab focus to last tab\n */\n removePreviousActiveTab() {\n /* 1 */\n this.activeTab.isActive = false;\n\n /* 2 */\n const activeTabPanel = this._Cre8TabPanels.find((tabPanel) => tabPanel.index === this.activeTab.index);\n if (activeTabPanel) {\n activeTabPanel.isActive = false;\n }\n }\n\n /**\n * Emit custom event\n */\n emitEvent() {\n const customEvent = new CustomEvent('tabChange', {\n detail: {\n value: this.activeTab,\n activeTabIndex: this.activeIndex,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(customEvent);\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-tabs', {\n 'cre8-is-start': this.isStart === true,\n 'cre8-is-end': this.isEnd === true,\n 'cre8-c-tabs--full-width': this.fullWidth,\n });\n\n return html`\n <div class=\"${componentClassNames}\">\n <div class=\"cre8-c-tabs__header\">\n <div\n class=\"cre8-c-tabs__list\"\n role=\"tablist\"\n tabindex=0\n @scroll=${this.handleScroll}\n @keydown=${this.handleKeydown}\n @click=${this.handleTabSelected}\n >\n <slot></slot>\n </div>\n </div>\n <div class=\"cre8-c-tabs__body\">\n <slot name=\"panel\"></slot>\n </div>\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-tabs') === undefined) {\n customElements.define('cre8-tabs', Cre8Tabs);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-tabs': Cre8Tabs;\n }\n}\n\nexport default Cre8Tabs;\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:block}.cre8-c-tabs__header{position:relative;display:flex;flex-direction:column;align-items:baseline;overflow:hidden}.cre8-c-tabs:not(.cre8-is-start) .cre8-c-tabs__header::before{content:"";display:block;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), var(--cre8-color-bg-default), rgba(255, 255, 255, 0.001) 30%);height:100%;inset-block-start:0;inset-inline-start:0;width:3rem;z-index:1}.cre8-c-tabs:not(.cre8-is-end) .cre8-c-tabs__header::after{content:"";display:block !important;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), rgba(255, 255, 255, 0.001) 30%, var(--cre8-color-bg-default));height:100%;inset-block-start:0;inset-inline-end:0;width:3rem;z-index:1}.cre8-c-tabs__list{display:flex;overflow:auto;width:100%;margin:0;position:relative;padding:var(--cre8-border-width-focus);scrollbar-width:none;-ms-overflow-style:none}.cre8-c-tabs__list::-webkit-scrollbar{display:none}.cre8-c-tabs__body{padding-block-start:1rem}.cre8-c-tabs--full-width .cre8-c-tabs__body{border-top:var(--cre8-border-width-tab-selected) var(--cre8-border-style-default) var(--cre8-color-border-default);margin-top:calc(var(--cre8-border-width-tab-selected)*-2)}`;
|
|
3
|
+
export default styles;
|
|
4
|
+
//# sourceMappingURL=tabs.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.styles.js","sourceRoot":"","sources":["../../../components/tabs/tabs.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,u/FAAu/F,CAAC;AAC1gG,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:block}.cre8-c-tabs__header{position:relative;display:flex;flex-direction:column;align-items:baseline;overflow:hidden}.cre8-c-tabs:not(.cre8-is-start) .cre8-c-tabs__header::before{content:\"\";display:block;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), var(--cre8-color-bg-default), rgba(255, 255, 255, 0.001) 30%);height:100%;inset-block-start:0;inset-inline-start:0;width:3rem;z-index:1}.cre8-c-tabs:not(.cre8-is-end) .cre8-c-tabs__header::after{content:\"\";display:block !important;position:absolute;pointer-events:none;background:linear-gradient(var(--rtlGradientToRight, 90deg), rgba(255, 255, 255, 0.001) 30%, var(--cre8-color-bg-default));height:100%;inset-block-start:0;inset-inline-end:0;width:3rem;z-index:1}.cre8-c-tabs__list{display:flex;overflow:auto;width:100%;margin:0;position:relative;padding:var(--cre8-border-width-focus);scrollbar-width:none;-ms-overflow-style:none}.cre8-c-tabs__list::-webkit-scrollbar{display:none}.cre8-c-tabs__body{padding-block-start:1rem}.cre8-c-tabs--full-width .cre8-c-tabs__body{border-top:var(--cre8-border-width-tab-selected) var(--cre8-border-style-default) var(--cre8-color-border-default);margin-top:calc(var(--cre8-border-width-tab-selected)*-2)}`;\nexport default styles;\n"]}
|
|
@@ -1,141 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Cre8FormElement as y } from "../cre8-form-element.js";
|
|
7
|
-
const v = u`*,::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}.cre8-c-tag{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:flex;align-items:center;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);color:var(--cre8-color-content-default);cursor:pointer;gap:var(--cre8-spacing-8);padding:var(--cre8-spacing-4) var(--cre8-spacing-16);transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);white-space:nowrap}.cre8-c-tag--square{border-radius:var(--cre8-border-radius-small)}.cre8-c-tag--round{border-radius:var(--cre8-border-radius-round)}.cre8-c-tag--neutral:hover,.cre8-c-tag--neutral:focus{background-color:var(--cre8-color-bg-default-hover);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tag--branded{background-color:var(--cre8-color-bg-brand);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent)}.cre8-c-tag--branded:hover,.cre8-c-tag--branded:focus{background-color:var(--cre8-color-bg-brand-hover)}.cre8-c-tag--neutral-hybrid{color:var(--cre8-color-content-brand)}.cre8-c-tag--neutral-hybrid:hover,.cre8-c-tag--neutral-hybrid:focus{background-color:var(--cre8-color-bg-default-hover)}.cre8-c-tag--neutral-selected,.cre8-c-tag--neutral-hybrid-selected{background-color:var(--cre8-color-bg-brand-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--neutral-selected:hover,.cre8-c-tag--neutral-selected:focus,.cre8-c-tag--neutral-hybrid-selected:hover,.cre8-c-tag--neutral-hybrid-selected:focus{background-color:var(--cre8-color-bg-brand-strong-hover)}.cre8-c-tag--branded-selected{background-color:var(--cre8-color-bg-brand-xstrong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--branded-selected:hover,.cre8-c-tag--branded-selected:focus{background-color:var(--cre8-color-bg-brand-xstrong-hover)}.cre8-c-tag:focus{outline:var(--cre8-border-width-focus) var(--cre8-border-style-default) var(--cre8-color-border-active-outline);outline-offset:var(--cre8-border-width-focus)}.cre8-c-tag.cre8-c-tag--disabled,.cre8-c-tag.cre8-c-tag--disabled:hover,.cre8-c-tag.cre8-c-tag--disabled:focus{background-color:var(--cre8-color-bg-disabled);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed;outline:none}.cre8-c-tag__input{font-family:var(--cre8-typography-body-small-font-family);font-size:var(--cre8-typography-body-small-font-size);font-weight:var(--cre8-typography-body-small-font-weight);line-height:var(--cre8-typography-body-small-line-height);text-decoration:var(--cre8-typography-body-small-text-decoration);text-transform:var(--cre8-typography-body-small-text-transform);display:none}.cre8-tag-text{cursor:pointer}.cre8-c-tag--disabled>.cre8-tag-text{cursor:not-allowed}cre8-icon{display:flex;align-items:center}`;
|
|
8
|
-
var m = Object.defineProperty, i = (n, e, r, t) => {
|
|
9
|
-
for (var c = void 0, s = n.length - 1, h; s >= 0; s--)
|
|
10
|
-
(h = n[s]) && (c = h(e, r, c) || c);
|
|
11
|
-
return c && m(e, r, c), c;
|
|
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;
|
|
12
6
|
};
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
7
|
+
import svgCheck from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Check.svg?raw';
|
|
8
|
+
import { html, } from 'lit';
|
|
9
|
+
import { property, query } from 'lit/decorators.js';
|
|
10
|
+
import { nanoid } from 'nanoid';
|
|
11
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
12
|
+
import { Cre8FormElement } from '../cre8-form-element';
|
|
13
|
+
import '../icon/icon';
|
|
14
|
+
import styles from './tag.styles.js';
|
|
15
|
+
/**
|
|
16
|
+
* The tag component allows you to make selections, filter content, or trigger actions. While buttons are
|
|
17
|
+
* expected to appear consistently and with familiar calls to actions, tags should appear dynamically
|
|
18
|
+
* as a group of multiple interactions elements. It is a flexible
|
|
19
|
+
* component that comes in the following types:
|
|
20
|
+
* - **radio** Clicking a Radio Button causes it to change color. These tags only allow
|
|
21
|
+
* one option to be chosen and can be used in place of radio button when they need to be listed
|
|
22
|
+
* horizontally
|
|
23
|
+
*
|
|
24
|
+
* - **checkbox** It allows for selecting options, It can be toggled on and off.
|
|
25
|
+
*/
|
|
26
|
+
export class Cre8Tag extends Cre8FormElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/**
|
|
30
|
+
* Color variant
|
|
31
|
+
* **neutral** renders the default, unselected tag
|
|
32
|
+
* **branded** renders a selected tag
|
|
33
|
+
* **neutral-hybrid** renders a tag when mouse is hovering tag
|
|
34
|
+
*/
|
|
35
|
+
this.variant = 'neutral';
|
|
36
|
+
/**
|
|
37
|
+
* shape of the tag, supports square and round, and default not mentioned its a square
|
|
38
|
+
*/
|
|
39
|
+
this.shape = 'square';
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback();
|
|
43
|
+
this.fieldId = this.fieldId || nanoid();
|
|
44
|
+
window.addEventListener('click', this._clickCheckHandler, false);
|
|
45
|
+
window.addEventListener('click', this._clickRadioHandler, false);
|
|
46
|
+
window.addEventListener('keydown', this._handleCheckKeyDown, false);
|
|
47
|
+
window.addEventListener('keydown', this.handleRadioKeyDown, false);
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
super.disconnectedCallback();
|
|
51
|
+
window.removeEventListener('click', this._clickCheckHandler, false);
|
|
52
|
+
window.removeEventListener('click', this._clickRadioHandler, false);
|
|
53
|
+
window.removeEventListener('keydown', this._handleCheckKeyDown, false);
|
|
54
|
+
window.removeEventListener('keydown', this.handleRadioKeyDown, false);
|
|
55
|
+
}
|
|
56
|
+
renderCheckboxIcon() {
|
|
57
|
+
if (this.type === 'checkbox' && this.isSelected) {
|
|
58
|
+
return html `
|
|
59
|
+
<cre8-icon svg="${svgCheck}" class="cre8-tag-icon" aria-hidden="true"></cre8-icon>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
_clickCheckHandler() {
|
|
65
|
+
if (!this.isDisabled) {
|
|
66
|
+
if (this.type === 'checkbox') {
|
|
67
|
+
this.isSelected = !this.isSelected;
|
|
68
|
+
}
|
|
69
|
+
this.dispatchEvent(new CustomEvent('change', { detail: { isSelected: this.isSelected, type: this.type } }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
_handleCheckKeyDown(event) {
|
|
73
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
this._clickCheckHandler();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Reset the radio tag field
|
|
80
|
+
*/
|
|
81
|
+
resetField() {
|
|
82
|
+
this._internals.setFormValue(null);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Reset the radio field tags tab indeces
|
|
86
|
+
*/
|
|
87
|
+
resetTabIndeces(tags) {
|
|
88
|
+
tags.forEach((element) => {
|
|
89
|
+
element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '0');
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Remove checked
|
|
94
|
+
* 1) Remove checked property from all tags and set tabindex to -1
|
|
95
|
+
* 2) Reset the form field to not checked
|
|
96
|
+
*/
|
|
97
|
+
_removeChecked() {
|
|
98
|
+
if (this.parentNode) {
|
|
99
|
+
/* 1 */
|
|
100
|
+
const tags = this.parentNode.querySelectorAll('cre8-tag');
|
|
101
|
+
tags.forEach((element) => {
|
|
102
|
+
element.isSelected = false;
|
|
103
|
+
element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '-1');
|
|
104
|
+
element.resetField();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Reset form callback
|
|
110
|
+
* 1) Remove the checked state from all radio tags
|
|
111
|
+
* 2) Set the checked state to the initial checked state
|
|
112
|
+
* 3) Set the radio field input checked attribute to the initial checked state
|
|
113
|
+
*/
|
|
114
|
+
formResetCallback() {
|
|
115
|
+
this._removeChecked();
|
|
116
|
+
this.isSelected = this.initialSelected;
|
|
117
|
+
this.field.checked = this.initialSelected;
|
|
118
|
+
}
|
|
119
|
+
_clickRadioHandler() {
|
|
120
|
+
this._removeChecked();
|
|
121
|
+
this.isSelected = !this.isSelected;
|
|
122
|
+
const tagInput = this.shadowRoot?.querySelector('.cre8-c-tag');
|
|
123
|
+
if (tagInput) {
|
|
124
|
+
tagInput.setAttribute('tabindex', '0');
|
|
125
|
+
}
|
|
126
|
+
if (this.isSelected) {
|
|
127
|
+
this._internals.setFormValue(this.value || 'on');
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this._internals.setFormValue(null);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_updateSibling(event, sibling, element) {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
this._removeChecked();
|
|
136
|
+
element.focus();
|
|
137
|
+
element.setAttribute('tabindex', '0');
|
|
138
|
+
sibling.setAttribute('isSelected', '');
|
|
139
|
+
}
|
|
140
|
+
_checkPreviousTag(event) {
|
|
141
|
+
let previous = this.previousElementSibling;
|
|
142
|
+
while (previous) {
|
|
143
|
+
const previousElement = previous?.shadowRoot?.querySelector('.cre8-c-tag:not([aria-disabled="true"])');
|
|
144
|
+
if (previousElement) {
|
|
145
|
+
this._updateSibling(event, previous, previousElement);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
previous = previous.previousElementSibling;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_checkNextTag(event) {
|
|
152
|
+
let next = this.nextElementSibling;
|
|
153
|
+
while (next) {
|
|
154
|
+
const nextElement = next?.shadowRoot?.querySelector('.cre8-c-tag:not([aria-disabled="true"])');
|
|
155
|
+
if (nextElement) {
|
|
156
|
+
this._updateSibling(event, next, nextElement);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
next = next.nextElementSibling;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
handleRadioKeyDown(event) {
|
|
163
|
+
if (event.code === 'ArrowLeft' || event.code === 'ArrowUp') {
|
|
164
|
+
this._checkPreviousTag(event);
|
|
165
|
+
}
|
|
166
|
+
else if (event.code === 'ArrowRight' || event.code === 'ArrowDown') {
|
|
167
|
+
this._checkNextTag(event);
|
|
168
|
+
}
|
|
169
|
+
else if (event.code === 'Tab' && !this.isSelected) {
|
|
170
|
+
const tags = this.parentNode.querySelectorAll('cre8-tag');
|
|
171
|
+
tags.forEach((element) => {
|
|
172
|
+
element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '-1');
|
|
173
|
+
});
|
|
174
|
+
// After making tabbing away from the fieldset,
|
|
175
|
+
// reset the items to be tabbable again so the user can come back to the fieldset
|
|
176
|
+
setTimeout(this.resetTabIndeces, 100, tags);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* access role when tag embedded in tag-list
|
|
181
|
+
*/
|
|
182
|
+
_getRole() {
|
|
183
|
+
const tagContainer = this.closest('cre8-tag-list');
|
|
184
|
+
if (tagContainer) {
|
|
185
|
+
return 'listitem';
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
render() {
|
|
190
|
+
const componentClassNames = this.componentClassNames('cre8-c-tag', {
|
|
191
|
+
[`cre8-c-tag--${this.type}`]: true,
|
|
192
|
+
[`cre8-c-tag--${this.shape}`]: true,
|
|
193
|
+
[`cre8-c-tag--${this.variant}`]: true,
|
|
194
|
+
[`cre8-c-tag--${this.variant}-selected`]: this.isSelected,
|
|
195
|
+
'cre8-c-tag--disabled': this.isDisabled,
|
|
196
|
+
});
|
|
197
|
+
const isSelected = this.isSelected === true || this.initialSelected === true;
|
|
198
|
+
return html `
|
|
199
|
+
<div role="${ifDefined(this._getRole())}">
|
|
200
|
+
<div role="${ifDefined(this.type)}" aria-checked="${isSelected}" class="${componentClassNames}"
|
|
201
|
+
aria-disabled="${ifDefined(this.isDisabled)}"
|
|
202
|
+
@click="${this.type === 'radio' ? this._clickRadioHandler : this._clickCheckHandler}"
|
|
203
|
+
@keydown="${this.type === 'radio' ? this.handleRadioKeyDown : this._handleCheckKeyDown}"
|
|
134
204
|
tabindex="0"
|
|
135
205
|
>
|
|
136
206
|
${this.renderCheckboxIcon()}
|
|
137
207
|
<label
|
|
138
|
-
@input="${this.type ===
|
|
208
|
+
@input="${this.type === 'radio' ? this._clickRadioHandler : this._clickCheckHandler}"
|
|
139
209
|
for="${this.fieldId}" class="cre8-tag-text">${this.text}
|
|
140
210
|
</label>
|
|
141
211
|
</div>
|
|
@@ -146,40 +216,39 @@ const d = class d extends y {
|
|
|
146
216
|
name=${this.text}
|
|
147
217
|
.value="${this.text}"
|
|
148
218
|
?disabled="${this.isDisabled}"
|
|
149
|
-
.checked = "${
|
|
219
|
+
.checked = "${isSelected}"
|
|
150
220
|
/>
|
|
151
221
|
</div>
|
|
152
222
|
`;
|
|
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
|
-
customElements.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
Cre8Tag.styles = [styles];
|
|
226
|
+
__decorate([
|
|
227
|
+
property()
|
|
228
|
+
], Cre8Tag.prototype, "text", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property()
|
|
231
|
+
], Cre8Tag.prototype, "type", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property()
|
|
234
|
+
], Cre8Tag.prototype, "variant", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
property()
|
|
237
|
+
], Cre8Tag.prototype, "shape", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
property({ type: Boolean })
|
|
240
|
+
], Cre8Tag.prototype, "isDisabled", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
property({ type: Boolean })
|
|
243
|
+
], Cre8Tag.prototype, "isSelected", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
query('input')
|
|
246
|
+
], Cre8Tag.prototype, "field", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
property()
|
|
249
|
+
], Cre8Tag.prototype, "fieldId", void 0);
|
|
250
|
+
if (customElements.get('cre8-tag') === undefined) {
|
|
251
|
+
customElements.define('cre8-tag', Cre8Tag);
|
|
252
|
+
}
|
|
253
|
+
export default Cre8Tag;
|
|
254
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../components/tag/tag.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAQ,MAAM,mGAAmG,CAAC;AACzH,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,cAAc,CAAC;AACtB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,OAAQ,SAAQ,eAAe;IAA5C;;QAeE;;;;;WAKG;QAGC,YAAO,GAA6C,SAAS,CAAC;QAElE;;WAEG;QAEC,UAAK,GAAuB,QAAQ,CAAC;IAgP3C,CAAC;IA9MC,iBAAiB;QACb,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,G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AAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB;2BAC5E,IAAI,CAAC,OAAO,2BAA2B,IAAI,CAAC,IAAI;;;;;wBAKnD,IAAI,CAAC,IAAI;sBACX,IAAI,CAAC,OAAO;uBACX,IAAI,CAAC,IAAI;0BACN,IAAI,CAAC,IAAI;6BACN,IAAI,CAAC,UAAU;8BACd,UAAU;;;GAGrC,CAAC;IACF,CAAC;;AA3QQ,cAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAGvB;IADH,QAAQ,EAAE;qCACM;AASb;IADH,QAAQ,EAAE;qCACmB;AAU1B;IADH,QAAQ,EAAE;wCACuD;AAM9D;IADH,QAAQ,EAAE;sCAC8B;AAOrC;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACH;AAOrB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACH;AAMrB;IADH,KAAK,CAAC,OAAO,CAAC;sCACc;AAOzB;IADH,QAAQ,EAAE;wCACU;AAuNvB,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE,CAAC;IAC/C,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAQD,eAAe,OAAO,CAAC","sourcesContent":["import svgCheck from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Check.svg?raw';\nimport { html, } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { nanoid } from 'nanoid';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { Cre8FormElement } from '../cre8-form-element';\nimport '../icon/icon';\nimport styles from './tag.styles.js';\n\n/**\n * The tag component allows you to make selections, filter content, or trigger actions. While buttons are\n * expected to appear consistently and with familiar calls to actions, tags should appear dynamically\n * as a group of multiple interactions elements. It is a flexible\n * component that comes in the following types:\n * - **radio** Clicking a Radio Button causes it to change color. These tags only allow\n * one option to be chosen and can be used in place of radio button when they need to be listed\n * horizontally\n *\n * - **checkbox** It allows for selecting options, It can be toggled on and off.\n */\n\nexport class Cre8Tag extends Cre8FormElement {\n static styles = [styles];\n\n @property()\n text: string;\n\n /**\n * Type of tag\n * **checkbox** renders a checkbox tag\n ***radio** renders a radio tag\n */\n\n @property()\n type: 'checkbox'| 'radio';\n\n /**\n * Color variant\n * **neutral** renders the default, unselected tag\n * **branded** renders a selected tag\n * **neutral-hybrid** renders a tag when mouse is hovering tag\n */\n\n @property()\n variant: 'neutral' | 'branded' | 'neutral-hybrid' = 'neutral';\n\n /**\n * shape of the tag, supports square and round, and default not mentioned its a square\n */\n @property()\n shape: 'square' | 'round' = 'square';\n\n /*\n * Disabled attribute\n * renders a greyed out tag that the user cannot interact with\n */\n @property({ type: Boolean })\n isDisabled?: boolean;\n\n /*\n * Selected attribute\n * renders a selected tag\n */\n @property({ type: Boolean })\n isSelected?: boolean;\n\n /**\n * Get the radio field item input\n */\n @query('input')\n field!: HTMLInputElement;\n\n /**\n * The fieldId attribute is assigned to the HTML input element of the radio button and the for attribute of the\n * corresponding label.\n */\n @property()\n fieldId?: string;\n\n /**\n * Initial checked for initial checked state\n */\n private initialSelected?: boolean;\n\n connectedCallback() {\n super.connectedCallback();\n this.fieldId = this.fieldId || nanoid();\n window.addEventListener('click', this._clickCheckHandler, false);\n window.addEventListener('click', this._clickRadioHandler, false);\n window.addEventListener('keydown', this._handleCheckKeyDown, false);\n window.addEventListener('keydown', this.handleRadioKeyDown, false);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('click', this._clickCheckHandler, false);\n window.removeEventListener('click', this._clickRadioHandler, false);\n window.removeEventListener('keydown', this._handleCheckKeyDown, false);\n window.removeEventListener('keydown', this.handleRadioKeyDown, false);\n }\n\n renderCheckboxIcon() {\n if (this.type === 'checkbox' && this.isSelected) {\n return html`\n <cre8-icon svg=\"${svgCheck}\" class=\"cre8-tag-icon\" aria-hidden=\"true\"></cre8-icon>\n `;\n }\n return null;\n }\n\n private _clickCheckHandler() {\n if (!this.isDisabled) {\n if (this.type === 'checkbox') {\n this.isSelected = !this.isSelected;\n }\n this.dispatchEvent(new CustomEvent('change', { detail: { isSelected: this.isSelected, type: this.type } }));\n }\n }\n\n private _handleCheckKeyDown(event: KeyboardEvent) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this._clickCheckHandler();\n }\n }\n\n/**\n* Reset the radio tag field\n*/\n public resetField() {\n this._internals.setFormValue(null);\n }\n\n/**\n* Reset the radio field tags tab indeces\n*/\n resetTabIndeces(tags: Cre8Tag[]) {\n tags.forEach((element: HTMLElement) => {\n element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '0');\n });\n }\n\n/**\n* Remove checked\n* 1) Remove checked property from all tags and set tabindex to -1\n* 2) Reset the form field to not checked\n*/\n private _removeChecked() {\n if (this.parentNode) {\n /* 1 */\n const tags = this.parentNode.querySelectorAll('cre8-tag');\n tags.forEach((element: Cre8Tag) => {\n element.isSelected = false;\n element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '-1');\n element.resetField();\n });\n }\n }\n\n/**\n* Reset form callback\n* 1) Remove the checked state from all radio tags\n* 2) Set the checked state to the initial checked state\n* 3) Set the radio field input checked attribute to the initial checked state\n*/\n formResetCallback(): void {\n this._removeChecked();\n this.isSelected = this.initialSelected;\n this.field.checked = this.initialSelected;\n }\n\n private _clickRadioHandler() {\n this._removeChecked();\n this.isSelected = !this.isSelected;\n const tagInput = this.shadowRoot?.querySelector<HTMLInputElement>('.cre8-c-tag');\n if (tagInput) {\n tagInput.setAttribute('tabindex', '0');\n }\n if (this.isSelected) {\n this._internals.setFormValue(this.value || 'on');\n } else {\n this._internals.setFormValue(null);\n }\n }\n\n private _updateSibling(event: KeyboardEvent, sibling: Element, element: HTMLElement) {\n event.preventDefault();\n this._removeChecked();\n element.focus();\n element.setAttribute('tabindex', '0');\n sibling.setAttribute('isSelected', '');\n }\n\n private _checkPreviousTag(event: KeyboardEvent) {\n let previous = this.previousElementSibling;\n while (previous) {\n const previousElement = previous?.shadowRoot?.querySelector<HTMLInputElement>(\n '.cre8-c-tag:not([aria-disabled=\"true\"])'\n );\n\n if (previousElement) {\n this._updateSibling(event, previous, previousElement);\n return;\n }\n\n previous = previous.previousElementSibling;\n }\n }\n\n private _checkNextTag(event: KeyboardEvent) {\n let next = this.nextElementSibling;\n while (next) {\n const nextElement = next?.shadowRoot?.querySelector<HTMLInputElement>(\n '.cre8-c-tag:not([aria-disabled=\"true\"])'\n );\n\n if (nextElement) {\n this._updateSibling(event, next, nextElement);\n return;\n }\n\n next = next.nextElementSibling;\n }\n }\n\n handleRadioKeyDown(event: KeyboardEvent) {\n if (event.code === 'ArrowLeft' || event.code === 'ArrowUp') {\n this._checkPreviousTag(event);\n } else if (event.code === 'ArrowRight' || event.code === 'ArrowDown') {\n this._checkNextTag(event);\n } else if (event.code === 'Tab' && !this.isSelected) {\n const tags = this.parentNode.querySelectorAll('cre8-tag');\n tags.forEach((element: HTMLElement) => {\n element.shadowRoot.querySelector('.cre8-c-tag').setAttribute('tabindex', '-1');\n });\n\n // After making tabbing away from the fieldset,\n // reset the items to be tabbable again so the user can come back to the fieldset\n setTimeout(this.resetTabIndeces, 100, tags);\n }\n }\n\n /**\n * access role when tag embedded in tag-list\n */\n private _getRole(): 'listitem' | undefined {\n const tagContainer = this.closest('cre8-tag-list');\n if (tagContainer) {\n return 'listitem';\n }\n return undefined;\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-tag', {\n [`cre8-c-tag--${this.type}`]: true,\n [`cre8-c-tag--${this.shape}`]: true,\n [`cre8-c-tag--${this.variant}`]: true,\n [`cre8-c-tag--${this.variant}-selected`]: this.isSelected,\n 'cre8-c-tag--disabled': this.isDisabled,\n });\n\n const isSelected = this.isSelected === true || this.initialSelected === true;\n\n return html` \n <div role=\"${ifDefined(this._getRole())}\">\n <div role=\"${ifDefined(this.type)}\" aria-checked=\"${isSelected}\" class=\"${componentClassNames}\"\n aria-disabled=\"${ifDefined(this.isDisabled)}\"\n @click=\"${this.type === 'radio' ? this._clickRadioHandler : this._clickCheckHandler}\"\n @keydown=\"${this.type === 'radio' ? this.handleRadioKeyDown : this._handleCheckKeyDown}\"\n tabindex=\"0\"\n >\n ${this.renderCheckboxIcon()}\n <label \n @input=\"${this.type === 'radio' ? this._clickRadioHandler : this._clickCheckHandler}\"\n for=\"${this.fieldId}\" class=\"cre8-tag-text\">${this.text}\n </label>\n </div>\n <input\n class=\"cre8-c-tag__input\" \n type=\"${this.type}\"\n id=\"${this.fieldId}\"\n name=${this.text}\n .value=\"${this.text}\"\n ?disabled=\"${this.isDisabled}\"\n .checked = \"${isSelected}\"\n />\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-tag') === undefined) {\n customElements.define('cre8-tag', Cre8Tag);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-tag': Cre8Tag;\n }\n}\n\nexport default Cre8Tag;\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}.cre8-c-tag{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:flex;align-items:center;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);color:var(--cre8-color-content-default);cursor:pointer;gap:var(--cre8-spacing-8);padding:var(--cre8-spacing-4) var(--cre8-spacing-16);transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);white-space:nowrap}.cre8-c-tag--square{border-radius:var(--cre8-border-radius-small)}.cre8-c-tag--round{border-radius:var(--cre8-border-radius-round)}.cre8-c-tag--neutral:hover,.cre8-c-tag--neutral:focus{background-color:var(--cre8-color-bg-default-hover);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tag--branded{background-color:var(--cre8-color-bg-brand);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent)}.cre8-c-tag--branded:hover,.cre8-c-tag--branded:focus{background-color:var(--cre8-color-bg-brand-hover)}.cre8-c-tag--neutral-hybrid{color:var(--cre8-color-content-brand)}.cre8-c-tag--neutral-hybrid:hover,.cre8-c-tag--neutral-hybrid:focus{background-color:var(--cre8-color-bg-default-hover)}.cre8-c-tag--neutral-selected,.cre8-c-tag--neutral-hybrid-selected{background-color:var(--cre8-color-bg-brand-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--neutral-selected:hover,.cre8-c-tag--neutral-selected:focus,.cre8-c-tag--neutral-hybrid-selected:hover,.cre8-c-tag--neutral-hybrid-selected:focus{background-color:var(--cre8-color-bg-brand-strong-hover)}.cre8-c-tag--branded-selected{background-color:var(--cre8-color-bg-brand-xstrong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--branded-selected:hover,.cre8-c-tag--branded-selected:focus{background-color:var(--cre8-color-bg-brand-xstrong-hover)}.cre8-c-tag:focus{outline:var(--cre8-border-width-focus) var(--cre8-border-style-default) var(--cre8-color-border-active-outline);outline-offset:var(--cre8-border-width-focus)}.cre8-c-tag.cre8-c-tag--disabled,.cre8-c-tag.cre8-c-tag--disabled:hover,.cre8-c-tag.cre8-c-tag--disabled:focus{background-color:var(--cre8-color-bg-disabled);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed;outline:none}.cre8-c-tag__input{font-family:var(--cre8-typography-body-small-font-family);font-size:var(--cre8-typography-body-small-font-size);font-weight:var(--cre8-typography-body-small-font-weight);line-height:var(--cre8-typography-body-small-line-height);text-decoration:var(--cre8-typography-body-small-text-decoration);text-transform:var(--cre8-typography-body-small-text-transform);display:none}.cre8-tag-text{cursor:pointer}.cre8-c-tag--disabled>.cre8-tag-text{cursor:not-allowed}cre8-icon{display:flex;align-items:center}`;
|
|
3
|
+
export default styles;
|
|
4
|
+
//# sourceMappingURL=tag.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.styles.js","sourceRoot":"","sources":["../../../components/tag/tag.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,2qKAA2qK,CAAC;AAC9rK,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}.cre8-c-tag{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:flex;align-items:center;background-color:var(--cre8-color-bg-default);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);color:var(--cre8-color-content-default);cursor:pointer;gap:var(--cre8-spacing-8);padding:var(--cre8-spacing-4) var(--cre8-spacing-16);transition:all var(--cre8-anim-fade-quick) var(--cre8-anim-ease);white-space:nowrap}.cre8-c-tag--square{border-radius:var(--cre8-border-radius-small)}.cre8-c-tag--round{border-radius:var(--cre8-border-radius-round)}.cre8-c-tag--neutral:hover,.cre8-c-tag--neutral:focus{background-color:var(--cre8-color-bg-default-hover);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tag--branded{background-color:var(--cre8-color-bg-brand);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent)}.cre8-c-tag--branded:hover,.cre8-c-tag--branded:focus{background-color:var(--cre8-color-bg-brand-hover)}.cre8-c-tag--neutral-hybrid{color:var(--cre8-color-content-brand)}.cre8-c-tag--neutral-hybrid:hover,.cre8-c-tag--neutral-hybrid:focus{background-color:var(--cre8-color-bg-default-hover)}.cre8-c-tag--neutral-selected,.cre8-c-tag--neutral-hybrid-selected{background-color:var(--cre8-color-bg-brand-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--neutral-selected:hover,.cre8-c-tag--neutral-selected:focus,.cre8-c-tag--neutral-hybrid-selected:hover,.cre8-c-tag--neutral-hybrid-selected:focus{background-color:var(--cre8-color-bg-brand-strong-hover)}.cre8-c-tag--branded-selected{background-color:var(--cre8-color-bg-brand-xstrong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-transparent);color:var(--cre8-color-content-knockout)}.cre8-c-tag--branded-selected:hover,.cre8-c-tag--branded-selected:focus{background-color:var(--cre8-color-bg-brand-xstrong-hover)}.cre8-c-tag:focus{outline:var(--cre8-border-width-focus) var(--cre8-border-style-default) var(--cre8-color-border-active-outline);outline-offset:var(--cre8-border-width-focus)}.cre8-c-tag.cre8-c-tag--disabled,.cre8-c-tag.cre8-c-tag--disabled:hover,.cre8-c-tag.cre8-c-tag--disabled:focus{background-color:var(--cre8-color-bg-disabled);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed;outline:none}.cre8-c-tag__input{font-family:var(--cre8-typography-body-small-font-family);font-size:var(--cre8-typography-body-small-font-size);font-weight:var(--cre8-typography-body-small-font-weight);line-height:var(--cre8-typography-body-small-line-height);text-decoration:var(--cre8-typography-body-small-text-decoration);text-transform:var(--cre8-typography-body-small-text-transform);display:none}.cre8-tag-text{cursor:pointer}.cre8-c-tag--disabled>.cre8-tag-text{cursor:not-allowed}cre8-icon{display:flex;align-items:center}`;\nexport default styles;\n"]}
|