@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,145 +1,251 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const g = 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-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;
|
|
7
|
-
var v = Object.defineProperty, i = (d, t, e, s) => {
|
|
8
|
-
for (var a = void 0, n = d.length - 1, p; n >= 0; n--)
|
|
9
|
-
(p = d[n]) && (a = p(t, e, a) || a);
|
|
10
|
-
return a && v(t, e, a), a;
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
6
|
};
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
7
|
+
import { html, } from 'lit';
|
|
8
|
+
import { property, query } from 'lit/decorators.js';
|
|
9
|
+
import { nanoid } from 'nanoid';
|
|
10
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
+
import { Cre8Element } from '../cre8-element';
|
|
12
|
+
import styles from './tooltip.styles.js';
|
|
13
|
+
/**
|
|
14
|
+
* The purpose of tooltips is to provide a tip or hint about what a tool, icon, link, or other interaction does.
|
|
15
|
+
* If you need to present a call to action with perhaps a button for the user to click, then use
|
|
16
|
+
* [Popover](/docs/cre8-components-popover--docs) instead.
|
|
17
|
+
*
|
|
18
|
+
* ##Tooltip Styles
|
|
19
|
+
* There are 4 alignment options for Tooltips: Top, Bottom, Right, and Left. Default placement is Bottom, below the
|
|
20
|
+
* element it is describing. Top or Bottom alignment are the the preferred placement, particularly on screens that
|
|
21
|
+
* have a more narrow viewport. Tooltips utilize Global styles and are not affected by brand themes.
|
|
22
|
+
*
|
|
23
|
+
* **With icon**
|
|
24
|
+
* - **iconRotateDegree** & **iconFlipDirection** props are optional.
|
|
25
|
+
* - They are used to set up the correct dirrection for icons, for example,
|
|
26
|
+
* arrows, caret up or caret down.
|
|
27
|
+
*
|
|
28
|
+
* ##Usability Considerations
|
|
29
|
+
* With the exception of icons - which should always have alt text at a minimum - the UI should never rely on
|
|
30
|
+
* Tooltips for clarity, especially because they are not always discovered by the user. If the user cannot
|
|
31
|
+
* intuitively understand the interface without Tooltips, the interface should be redesigned.
|
|
32
|
+
*
|
|
33
|
+
* ##How to use
|
|
34
|
+
* - Use Tooltips to clarify the UI element the user is interacting with, not to add additional content on the page.
|
|
35
|
+
* Also, do not simply restate content on the page, for example, the title of the field.
|
|
36
|
+
* - Tooltips should be short and to the point. Example: "Click X to do X" or "Icon Description." If a succinct
|
|
37
|
+
* description is not possible, the interaction element should be redesigned.
|
|
38
|
+
* - In a mouse-driven UI, Tooltips are triggered on hover (mouseover) and dismissed (disappear)
|
|
39
|
+
* when the user mouses away from the element. In touch UIs, a Tooltip is triggered by tapping
|
|
40
|
+
* and holding an item. The Tooltip is displayed as long as the user continues to hold the element.
|
|
41
|
+
* Tap and hold is a more advanced user behavior, and further reason for not relying on Tooltips.
|
|
42
|
+
* A novice user may never discover tap and hold for Tooltips.
|
|
43
|
+
*
|
|
44
|
+
* @slot default - Default, unnamed slot container for Tooltip text
|
|
45
|
+
* @slot trigger - Named slot container for Tooltip element to trigger showing/hiding the Tooltip text
|
|
46
|
+
*/
|
|
47
|
+
export class Cre8Tooltip extends Cre8Element {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
/**
|
|
51
|
+
* iconRotateDegree is used for <cre8-icon> to set the arrow in the correct direction
|
|
52
|
+
*/
|
|
53
|
+
this.iconRotateDegree = 0;
|
|
54
|
+
/**
|
|
55
|
+
* Remove Active State
|
|
56
|
+
* 1. If a specific event is fired, remove the active state.
|
|
57
|
+
*/
|
|
58
|
+
this.removeActive = () => {
|
|
59
|
+
if (this.isActive) {
|
|
60
|
+
this.toggleActive();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
57
63
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* 4. Set the id and aria-describedby
|
|
65
|
-
*/
|
|
66
|
-
connectedCallback() {
|
|
67
|
-
super.connectedCallback(), this.addEventListener("mouseover", this.toggleActive), this.addEventListener("mouseout", this.removeActive);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Disconnected Callback Lifecycle
|
|
71
|
-
* 1. Remove window mouseover event listener
|
|
72
|
-
* 2. Remove window mouseout event listener
|
|
73
|
-
*/
|
|
74
|
-
disconnectedCallback() {
|
|
75
|
-
super.disconnectedCallback(), this.removeEventListener("mouseover", this.toggleActive), this.removeEventListener("mouseout", this.removeActive);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Handle all dynamic placement
|
|
79
|
-
*/
|
|
80
|
-
dynamicPosition() {
|
|
81
|
-
if (this.isDynamic && this._Cre8TooltipPanel) {
|
|
82
|
-
const t = document.querySelector("body").getBoundingClientRect(), e = this._Cre8TooltipPanel.getBoundingClientRect(), s = this._Cre8Tooltip.clientHeight + e.height + e.top;
|
|
83
|
-
e.left < 0 && (this.position = this.isRTL ? "left" : "right"), e.right >= t.width && (this.position = this.isRTL ? "right" : "left"), e.top < 0 && e.left > 0 && e.right < t.width && (this.position = null), s >= window.innerHeight && e.bottom >= window.innerHeight && e.left >= 0 && e.right <= t.width && (this.position = "top");
|
|
64
|
+
/**
|
|
65
|
+
* Query the document direction value
|
|
66
|
+
* <br/><br/> _*This property is dynamically set_
|
|
67
|
+
*/
|
|
68
|
+
get isRTL() {
|
|
69
|
+
return document.dir === 'rtl';
|
|
84
70
|
}
|
|
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
|
-
|
|
71
|
+
/**
|
|
72
|
+
* updated Callback Lifecycle
|
|
73
|
+
* 1. Find the second slot
|
|
74
|
+
* 2. Create a string from joining the textContent of the textnodes
|
|
75
|
+
* 3. Set the textContent of the tip generated in the firstUpdated lifecycle callback
|
|
76
|
+
* */
|
|
77
|
+
updated() {
|
|
78
|
+
/* 1 & 2 */
|
|
79
|
+
const tipContent = this.shadowRoot.querySelectorAll('slot')[1]
|
|
80
|
+
.assignedNodes()
|
|
81
|
+
.reduce(((str, item) => `${str}${item.textContent.replace(/\n/g, '').trim()}`), '');
|
|
82
|
+
/* 3 */
|
|
83
|
+
if (document.getElementById(this._uniqueId)) {
|
|
84
|
+
document.getElementById(this._uniqueId).textContent = tipContent;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* firstUpdated Callback Lifecycle
|
|
89
|
+
* 1. If ariaDescribes is set
|
|
90
|
+
* a. create an ID and assign it to the property _uniqueId
|
|
91
|
+
* b. Generate an empty div, assign it the _uniqueId and the tooltip role
|
|
92
|
+
* 2. Set the aria-describedby on the ariaDescribes target
|
|
93
|
+
*/
|
|
94
|
+
firstUpdated() {
|
|
95
|
+
if (this.ariaDescribes) { /* 1 */
|
|
96
|
+
this._uniqueId = this._uniqueId || nanoid(); /* 1.a */
|
|
97
|
+
const idMatcher = new RegExp(`\\b${this._uniqueId}\\b`); // prevents dupes from reconnects below
|
|
98
|
+
/* 1.b */
|
|
99
|
+
const a11yProxy = document.createElement('div');
|
|
100
|
+
a11yProxy.setAttribute('role', 'tooltip');
|
|
101
|
+
a11yProxy.setAttribute('style', 'position:fixed; left: -1000px; top: -1000px;');
|
|
102
|
+
a11yProxy.id = this._uniqueId;
|
|
103
|
+
const describedEl = document.getElementById(this.ariaDescribes);
|
|
104
|
+
describedEl.parentNode.insertBefore(a11yProxy, describedEl);
|
|
105
|
+
const idList = describedEl?.getAttribute('aria-describedBy');
|
|
106
|
+
/* 2 */
|
|
107
|
+
describedEl?.setAttribute('aria-describedby', `${idList ? `${idList.replace(idMatcher, '')} ` : ''}${this._uniqueId}`.trim());
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Connected Callback Lifecycle
|
|
112
|
+
* 1. Add window mouseover event listener
|
|
113
|
+
* 2. Add window mouseout event listener
|
|
114
|
+
* 3. Add mousedown event listener
|
|
115
|
+
* 4. Set the id and aria-describedby
|
|
116
|
+
*/
|
|
117
|
+
connectedCallback() {
|
|
118
|
+
super.connectedCallback();
|
|
119
|
+
this.addEventListener('mouseover', this.toggleActive); /* 1 */
|
|
120
|
+
this.addEventListener('mouseout', this.removeActive); /* 2 */
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Disconnected Callback Lifecycle
|
|
124
|
+
* 1. Remove window mouseover event listener
|
|
125
|
+
* 2. Remove window mouseout event listener
|
|
126
|
+
*/
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
super.disconnectedCallback();
|
|
129
|
+
this.removeEventListener('mouseover', this.toggleActive); /* 1 */
|
|
130
|
+
this.removeEventListener('mouseout', this.removeActive); /* 2 */
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Handle all dynamic placement
|
|
134
|
+
*/
|
|
135
|
+
dynamicPosition() {
|
|
136
|
+
// TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.
|
|
137
|
+
/* eslint complexity: ["warn", 10] */
|
|
138
|
+
if (this.isDynamic && this._Cre8TooltipPanel) {
|
|
139
|
+
const body = document.querySelector('body').getBoundingClientRect();
|
|
140
|
+
const tooltipPanel = this._Cre8TooltipPanel.getBoundingClientRect();
|
|
141
|
+
const tooltipHeight = this._Cre8Tooltip.clientHeight + tooltipPanel.height + tooltipPanel.top;
|
|
142
|
+
/**
|
|
143
|
+
* If tooltip panel breaks out the left side of the window, position it to the right
|
|
144
|
+
*/
|
|
145
|
+
if (tooltipPanel.left < 0) {
|
|
146
|
+
this.position = this.isRTL ? 'left' : 'right';
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* If tooltip panel breaks out the right side of the window, position it to the left
|
|
150
|
+
*/
|
|
151
|
+
if (tooltipPanel.right >= body.width) {
|
|
152
|
+
this.position = this.isRTL ? 'right' : 'left';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* If tooltip panel breaks out the top side of the window only, position it to the bottom center
|
|
156
|
+
*/
|
|
157
|
+
if (tooltipPanel.top < 0 && tooltipPanel.left > 0 && tooltipPanel.right < body.width) {
|
|
158
|
+
this.position = null;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* If tooltip panel breaks out the bottom side of the window only, position it to the top center
|
|
162
|
+
*/
|
|
163
|
+
if (tooltipHeight >= window.innerHeight
|
|
164
|
+
&& tooltipPanel.bottom >= window.innerHeight
|
|
165
|
+
&& tooltipPanel.left >= 0
|
|
166
|
+
&& tooltipPanel.right <= body.width) {
|
|
167
|
+
this.position = 'top';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Handle Keydown
|
|
173
|
+
* 1. If escape or tab key is struck when the tooltip is active, close it
|
|
174
|
+
* 2. If enter or escape is keyed, toggle the tooltip open or close.
|
|
175
|
+
* We need these since the click event is on a div so that accessibility reads this aloud to a user
|
|
176
|
+
*/
|
|
177
|
+
_handleKeydown(e) {
|
|
178
|
+
if (this.isActive) {
|
|
179
|
+
if (e.code === 'Escape' || e.code === 'Tab') {
|
|
180
|
+
this.toggleActive(); /* 1 */
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (e.code === 'Enter' || e.code === 'Space') {
|
|
184
|
+
this.toggleActive(); /* 2 */
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Set Tooltip Active State
|
|
189
|
+
* 1. Toggle the active state between true and false
|
|
190
|
+
* 2. If is active, set the dynamic position and custom event.
|
|
191
|
+
* 3. If is not active, remove fire the close custom event.
|
|
192
|
+
* 4. Toggle the active state for dynamic. This prevents a flash of the tooltip in the orginal position.
|
|
193
|
+
*/
|
|
194
|
+
toggleActive() {
|
|
195
|
+
this.isActive = !this.isActive; /* 1 */
|
|
196
|
+
if (this.isActive) {
|
|
197
|
+
/* 2 */
|
|
198
|
+
setTimeout(() => {
|
|
199
|
+
this.dynamicPosition();
|
|
200
|
+
}, 1);
|
|
201
|
+
this.dispatchEvent(new CustomEvent('open', {
|
|
202
|
+
detail: { isActive: this.isActive }, bubbles: true, composed: true,
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
/* 3 */
|
|
207
|
+
this.dispatchEvent(new CustomEvent('close', {
|
|
208
|
+
detail: { isActive: this.isActive }, bubbles: true, composed: true,
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
/* 4 */
|
|
212
|
+
setTimeout(() => {
|
|
213
|
+
if (this.isActive && this.isDynamic) {
|
|
214
|
+
this.isActiveDynamic = true;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
this.isActiveDynamic = false;
|
|
218
|
+
}
|
|
219
|
+
}, 2);
|
|
220
|
+
}
|
|
221
|
+
render() {
|
|
222
|
+
const componentClassNames = this.componentClassNames('cre8-c-tooltip', {
|
|
223
|
+
'cre8-c-tooltip--top': this.position === 'top',
|
|
224
|
+
'cre8-c-tooltip--left': this.position === 'left',
|
|
225
|
+
'cre8-c-tooltip--right': this.position === 'right',
|
|
226
|
+
'cre8-c-tooltip--knockout': this.knockout,
|
|
227
|
+
'cre8-is-active': this.isActive,
|
|
228
|
+
'cre8-is-dynamic': this.isDynamic,
|
|
229
|
+
'cre8-is-dynamic-active': this.isActiveDynamic,
|
|
230
|
+
});
|
|
231
|
+
return html `
|
|
232
|
+
<div class="${componentClassNames}">
|
|
129
233
|
<div
|
|
130
234
|
class="cre8-c-tooltip__trigger"
|
|
131
235
|
tabindex="0"
|
|
132
236
|
@focus=${this.toggleActive}
|
|
133
237
|
@keydown=${this._handleKeydown}
|
|
134
238
|
>
|
|
135
|
-
${this.svg
|
|
239
|
+
${this.svg
|
|
240
|
+
? html `
|
|
136
241
|
<slot name="trigger">
|
|
137
242
|
<cre8-icon svg='${this.svg}' rotate="${Number(this.iconRotateDegree)}"
|
|
138
243
|
flip="${this.iconFlipDirection}" aria-hidden="true"></cre8-icon>
|
|
139
|
-
</slot>`
|
|
244
|
+
</slot>`
|
|
245
|
+
: html `<slot name="trigger"></slot>`}
|
|
140
246
|
</div>
|
|
141
247
|
<dialog
|
|
142
|
-
id=${
|
|
248
|
+
id=${ifDefined(this._uniqueId)}
|
|
143
249
|
aria-labelledby=${this.ariaDescribes}
|
|
144
250
|
class="cre8-c-tooltip__panel"
|
|
145
251
|
role="tooltip">
|
|
@@ -147,48 +253,47 @@ const l = class l extends m {
|
|
|
147
253
|
</dialog>
|
|
148
254
|
</div>
|
|
149
255
|
`;
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
customElements.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
Cre8Tooltip.styles = [styles];
|
|
259
|
+
__decorate([
|
|
260
|
+
property()
|
|
261
|
+
], Cre8Tooltip.prototype, "position", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ type: Boolean, reflect: true })
|
|
264
|
+
], Cre8Tooltip.prototype, "knockout", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
property({ type: Boolean, reflect: true })
|
|
267
|
+
], Cre8Tooltip.prototype, "isDynamic", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
property({ type: Boolean })
|
|
270
|
+
], Cre8Tooltip.prototype, "isActiveDynamic", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
property({ type: Boolean, reflect: true })
|
|
273
|
+
], Cre8Tooltip.prototype, "isActive", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: String })
|
|
276
|
+
], Cre8Tooltip.prototype, "ariaDescribes", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: String })
|
|
279
|
+
], Cre8Tooltip.prototype, "_uniqueId", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property()
|
|
282
|
+
], Cre8Tooltip.prototype, "svg", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: Number })
|
|
285
|
+
], Cre8Tooltip.prototype, "iconRotateDegree", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
property()
|
|
288
|
+
], Cre8Tooltip.prototype, "iconFlipDirection", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
query('.cre8-c-tooltip')
|
|
291
|
+
], Cre8Tooltip.prototype, "_Cre8Tooltip", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
query('.cre8-c-tooltip__panel')
|
|
294
|
+
], Cre8Tooltip.prototype, "_Cre8TooltipPanel", void 0);
|
|
295
|
+
if (customElements.get('cre8-tooltip') === undefined) {
|
|
296
|
+
customElements.define('cre8-tooltip', Cre8Tooltip);
|
|
297
|
+
}
|
|
298
|
+
export default Cre8Tooltip;
|
|
299
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../components/tooltip/tooltip.ts"],"names":[],"mappings":";;;;;;AAAA,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,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAE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AAC;oDACE;AAU1B;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACpB;AAQnB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACA;AAGvB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACJ;AAQnB;IADH,QAAQ,EAAE;wCACM;AAMb;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACO;AAM9B;IADH,QAAQ,EAAE;sDACoB;AAM3B;IADH,KAAK,CAAC,iBAAiB,CAAC;iDACK;AAM1B;IADH,KAAK,CAAC,wBAAwB,CAAC;sDACG;AAqOrC,IAAI,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE,CAAC;IACnD,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAQD,eAAe,WAAW,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { nanoid } from 'nanoid';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './tooltip.styles.js';\n\n/**\n * The purpose of tooltips is to provide a tip or hint about what a tool, icon, link, or other interaction does.\n * If you need to present a call to action with perhaps a button for the user to click, then use\n * [Popover](/docs/cre8-components-popover--docs) instead.\n *\n * ##Tooltip Styles\n * There are 4 alignment options for Tooltips: Top, Bottom, Right, and Left. Default placement is Bottom, below the\n * element it is describing. Top or Bottom alignment are the the preferred placement, particularly on screens that\n * have a more narrow viewport. Tooltips utilize Global styles and are not affected by brand themes.\n *\n * **With icon**\n * - **iconRotateDegree** & **iconFlipDirection** props are optional.\n * - They are used to set up the correct dirrection for icons, for example,\n * arrows, caret up or caret down.\n *\n * ##Usability Considerations\n * With the exception of icons - which should always have alt text at a minimum - the UI should never rely on\n * Tooltips for clarity, especially because they are not always discovered by the user. If the user cannot\n * intuitively understand the interface without Tooltips, the interface should be redesigned.\n *\n * ##How to use\n * - Use Tooltips to clarify the UI element the user is interacting with, not to add additional content on the page.\n * Also, do not simply restate content on the page, for example, the title of the field.\n * - Tooltips should be short and to the point. Example: \"Click X to do X\" or \"Icon Description.\" If a succinct\n * description is not possible, the interaction element should be redesigned.\n * - In a mouse-driven UI, Tooltips are triggered on hover (mouseover) and dismissed (disappear)\n * when the user mouses away from the element. In touch UIs, a Tooltip is triggered by tapping\n * and holding an item. The Tooltip is displayed as long as the user continues to hold the element.\n * Tap and hold is a more advanced user behavior, and further reason for not relying on Tooltips.\n * A novice user may never discover tap and hold for Tooltips.\n *\n * @slot default - Default, unnamed slot container for Tooltip text\n * @slot trigger - Named slot container for Tooltip element to trigger showing/hiding the Tooltip text\n */\n\nexport class Cre8Tooltip extends Cre8Element {\n static styles = [styles];\n\n /**\n * Positions the tooltip panel absolutely to the icon. Position overrides `isDynamic`.\n * @type {\"default\"|\"top\"|\"left\"|\"right\"}\n * @attr {string}\n * - **default** positions the tooltip panel below the trigger element\n * - **top** positions the tooltip panel above the trigger element\n * - **left** positions the tooltip panel left of the trigger element\n * - **right** positions the tooltip panel right of the trigger element\n */\n @property()\n position?: 'top' | 'left' | 'right';\n\n /**\n * The knockout variant for the tooltip\n * @attr {boolean}\n * 1. If is true, the tooltip background is white\n * 2. If is false, the tooltip background is gray\n */\n @property({ type: Boolean, reflect: true })\n knockout?: boolean;\n\n /**\n * The dynamic state for the tooltip. Position overrides isDynamic.\n * @attr {boolean}\n * - If true, the tooltip panel placement is determined by its position in the viewport\n * - If false, the tooltip panel placement will be placed according to the position value\n */\n @property({ type: Boolean, reflect: true })\n isDynamic?: boolean;\n\n /**\n * The dynamic active state\n * @attr {boolean}\n * <br/><br/> _*This property is dynamically set_\n */\n @property({ type: Boolean })\n isActiveDynamic?: boolean;\n\n /**\n * The active state for the tooltip\n * @attr {boolean}\n * - If true, the tooltip panel is visible\n * - If false, the tooltip panel is hidden\n * <br/><br/> _*This property is dynamically set_\n */\n @property({ type: Boolean, reflect: true })\n isActive?: boolean;\n\n /**\n * Accepts the ID string of the item the tooltip is referencing\n * @attr {string}\n * Dynmically appends its own ID to the aria-describedby attribute on the referenced element\n */\n @property({ type: String })\n ariaDescribes?: string;\n\n @property({ type: String })\n _uniqueId?: string;\n\n /**\n * svg as a raw string\n * - The icon is defined by this prop.\n * - Pass in a raw svg as a String for using <cre8-icon>\n */\n @property()\n svg?: string;\n\n /**\n * iconRotateDegree is used for <cre8-icon> to set the arrow in the correct direction\n */\n @property({ type: Number })\n iconRotateDegree?: number = 0;\n\n /**\n * iconFlipDirection is used for <cre8-icon> to set the icon in the correct direction\n */\n @property()\n iconFlipDirection?: string;\n\n /**\n * Query the tooltip panel element\n */\n @query('.cre8-c-tooltip')\n _Cre8Tooltip: HTMLElement;\n\n /**\n * Query the tooltip panel element\n */\n @query('.cre8-c-tooltip__panel')\n _Cre8TooltipPanel: HTMLElement;\n\n /**\n * Query the document direction value\n * <br/><br/> _*This property is dynamically set_\n */\n get isRTL() {\n return document.dir === 'rtl';\n }\n\n /**\n * updated Callback Lifecycle\n * 1. Find the second slot\n * 2. Create a string from joining the textContent of the textnodes\n * 3. Set the textContent of the tip generated in the firstUpdated lifecycle callback\n * */\n updated() {\n /* 1 & 2 */\n const tipContent = this.shadowRoot.querySelectorAll('slot')[1]\n .assignedNodes()\n .reduce(\n ((str, item) => `${str}${item.textContent.replace(/\\n/g, '').trim()}`),\n ''\n );\n /* 3 */\n if (document.getElementById(this._uniqueId)) {\n document.getElementById(this._uniqueId).textContent = tipContent;\n }\n }\n\n /**\n * firstUpdated Callback Lifecycle\n * 1. If ariaDescribes is set\n * a. create an ID and assign it to the property _uniqueId\n * b. Generate an empty div, assign it the _uniqueId and the tooltip role\n * 2. Set the aria-describedby on the ariaDescribes target\n */\n firstUpdated() {\n if (this.ariaDescribes) { /* 1 */\n this._uniqueId = this._uniqueId || nanoid(); /* 1.a */\n const idMatcher = new RegExp(`\\\\b${this._uniqueId}\\\\b`); // prevents dupes from reconnects below\n /* 1.b */\n const a11yProxy = document.createElement('div');\n a11yProxy.setAttribute('role', 'tooltip');\n a11yProxy.setAttribute('style', 'position:fixed; left: -1000px; top: -1000px;');\n a11yProxy.id = this._uniqueId;\n const describedEl = document.getElementById(this.ariaDescribes);\n describedEl.parentNode.insertBefore(a11yProxy, describedEl);\n const idList = describedEl?.getAttribute('aria-describedBy');\n /* 2 */\n describedEl?.setAttribute(\n 'aria-describedby',\n `${idList ? `${idList.replace(idMatcher, '')} ` : ''}${this._uniqueId}`.trim()\n );\n }\n }\n\n /**\n * Connected Callback Lifecycle\n * 1. Add window mouseover event listener\n * 2. Add window mouseout event listener\n * 3. Add mousedown event listener\n * 4. Set the id and aria-describedby\n */\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('mouseover', this.toggleActive); /* 1 */\n this.addEventListener('mouseout', this.removeActive); /* 2 */\n }\n\n /**\n * Disconnected Callback Lifecycle\n * 1. Remove window mouseover event listener\n * 2. Remove window mouseout event listener\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('mouseover', this.toggleActive); /* 1 */\n this.removeEventListener('mouseout', this.removeActive); /* 2 */\n }\n\n /**\n * Handle all dynamic placement\n */\n dynamicPosition() {\n // TODO: Temporarily keep eslint complexity as warning. Update during specific story for this rule.\n /* eslint complexity: [\"warn\", 10] */\n if (this.isDynamic && this._Cre8TooltipPanel) {\n const body = document.querySelector('body').getBoundingClientRect();\n const tooltipPanel = this._Cre8TooltipPanel.getBoundingClientRect();\n const tooltipHeight = this._Cre8Tooltip.clientHeight + tooltipPanel.height + tooltipPanel.top;\n\n /**\n * If tooltip panel breaks out the left side of the window, position it to the right\n */\n if (tooltipPanel.left < 0) {\n this.position = this.isRTL ? 'left' : 'right';\n }\n\n /**\n * If tooltip panel breaks out the right side of the window, position it to the left\n */\n if (tooltipPanel.right >= body.width) {\n this.position = this.isRTL ? 'right' : 'left';\n }\n\n /**\n * If tooltip panel breaks out the top side of the window only, position it to the bottom center\n */\n if (tooltipPanel.top < 0 && tooltipPanel.left > 0 && tooltipPanel.right < body.width) {\n this.position = null;\n }\n\n /**\n * If tooltip panel breaks out the bottom side of the window only, position it to the top center\n */\n if (\n tooltipHeight >= window.innerHeight\n && tooltipPanel.bottom >= window.innerHeight\n && tooltipPanel.left >= 0\n && tooltipPanel.right <= body.width\n ) {\n this.position = 'top';\n }\n }\n }\n\n /**\n * Handle Keydown\n * 1. If escape or tab key is struck when the tooltip is active, close it\n * 2. If enter or escape is keyed, toggle the tooltip open or close.\n * We need these since the click event is on a div so that accessibility reads this aloud to a user\n */\n private _handleKeydown(e: KeyboardEvent) {\n if (this.isActive) {\n if (e.code === 'Escape' || e.code === 'Tab') {\n this.toggleActive(); /* 1 */\n }\n }\n if (e.code === 'Enter' || e.code === 'Space') {\n this.toggleActive(); /* 2 */\n }\n }\n\n /**\n * Set Tooltip Active State\n * 1. Toggle the active state between true and false\n * 2. If is active, set the dynamic position and custom event.\n * 3. If is not active, remove fire the close custom event.\n * 4. Toggle the active state for dynamic. This prevents a flash of the tooltip in the orginal position.\n */\n toggleActive() {\n this.isActive = !this.isActive; /* 1 */\n\n if (this.isActive) {\n /* 2 */\n setTimeout(() => {\n this.dynamicPosition();\n }, 1);\n this.dispatchEvent(new CustomEvent('open', {\n detail: { isActive: this.isActive }, bubbles: true, composed: true,\n }));\n } else {\n /* 3 */\n this.dispatchEvent(new CustomEvent('close', {\n detail: { isActive: this.isActive }, bubbles: true, composed: true,\n }));\n }\n\n /* 4 */\n setTimeout(() => {\n if (this.isActive && this.isDynamic) {\n this.isActiveDynamic = true;\n } else {\n this.isActiveDynamic = false;\n }\n }, 2);\n }\n\n /**\n * Remove Active State\n * 1. If a specific event is fired, remove the active state.\n */\n removeActive = () => {\n if (this.isActive) {\n this.toggleActive();\n }\n };\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-tooltip', {\n 'cre8-c-tooltip--top': this.position === 'top',\n 'cre8-c-tooltip--left': this.position === 'left',\n 'cre8-c-tooltip--right': this.position === 'right',\n 'cre8-c-tooltip--knockout': this.knockout,\n 'cre8-is-active': this.isActive,\n 'cre8-is-dynamic': this.isDynamic,\n 'cre8-is-dynamic-active': this.isActiveDynamic,\n });\n\n return html`\n <div class=\"${componentClassNames}\">\n <div \n class=\"cre8-c-tooltip__trigger\"\n tabindex=\"0\"\n @focus=${this.toggleActive}\n @keydown=${this._handleKeydown}\n >\n ${this.svg\n ? html`\n <slot name=\"trigger\">\n <cre8-icon svg='${this.svg}' rotate=\"${Number(this.iconRotateDegree)}\" \n flip=\"${this.iconFlipDirection}\" aria-hidden=\"true\"></cre8-icon>\n </slot>`\n : html`<slot name=\"trigger\"></slot>`\n}\n </div>\n <dialog\n id=${ifDefined(this._uniqueId)}\n aria-labelledby=${this.ariaDescribes}\n class=\"cre8-c-tooltip__panel\"\n role=\"tooltip\">\n <slot></slot>\n </dialog>\n </div>\n `;\n }\n}\n\nif (customElements.get('cre8-tooltip') === undefined) {\n customElements.define('cre8-tooltip', Cre8Tooltip);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-tooltip': Cre8Tooltip;\n }\n}\n\nexport default Cre8Tooltip;\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-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:"";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;
|
|
3
|
+
export default styles;
|
|
4
|
+
//# sourceMappingURL=tooltip.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.styles.js","sourceRoot":"","sources":["../../../components/tooltip/tooltip.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,ygMAAygM,CAAC;AAC5hM,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-tooltip{position:relative;display:table}.cre8-c-tooltip__panel{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);opacity:0;visibility:hidden;position:absolute;word-wrap:break-word;inset-block-start:calc(100% + 0.75rem);inset-block-end:auto;inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%));display:flex;flex-direction:column;gap:0.5rem;width:max-content;max-width:17.5rem;z-index:400;color:var(--cre8-color-content-knockout);background-color:var(--cre8-color-bg-strong);border:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.5rem}.cre8-is-active:not(.cre8-is-dynamic) .cre8-c-tooltip__panel,.cre8-is-active.cre8-is-dynamic-active .cre8-c-tooltip__panel{opacity:1;visibility:visible}.cre8-c-tooltip--top .cre8-c-tooltip__panel{inset-block-start:auto;inset-block-end:calc(100% + 0.75rem);inset-inline-start:50%;inset-inline-end:auto;transform:translateX(var(--rtlTranslateX, -50%))}.cre8-c-tooltip--left .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc(100% + 0.75rem);transform:translateY(-50%)}.cre8-c-tooltip--right .cre8-c-tooltip__panel{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc(100% + 0.75rem);inset-inline-end:auto;transform:translateY(-50%)}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel{background-color:var(--cre8-color-bg-default);color:var(--cre8-color-content-default)}.cre8-c-tooltip__panel::before{content:\"\";display:block;width:0.75rem;height:0.75rem;position:absolute;margin:auto;background-color:var(--cre8-color-bg-strong);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);inset-block-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-start:50%;transform:translateX(var(--rtlTranslateX, -50%)) rotate(45deg)}.cre8-c-tooltip--top .cre8-c-tooltip__panel::before{inset-block-start:auto;inset-block-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:none;border-inline-start:none;border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong)}.cre8-c-tooltip--left .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:auto;inset-inline-end:calc((var(--cre8-border-width-default) + 0.375rem)*-1);border-block-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-start:none;border-block-end:none;border-inline-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--right .cre8-c-tooltip__panel::before{inset-block-start:50%;inset-block-end:auto;inset-inline-start:calc((var(--cre8-border-width-default) + 0.375rem)*-1);inset-inline-end:auto;border-block-start:none;border-inline-start:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-block-end:var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-strong);border-inline-end:none;transform:translateY(-50%) rotate(var(--rtlRotate45Inverse, 45deg))}.cre8-c-tooltip--knockout .cre8-c-tooltip__panel::before{background-color:var(--cre8-color-bg-default)}.cre8-c-tooltip__footer{display:flex;gap:1rem;justify-content:flex-end;flex-grow:1}.cre8-c-tooltip__trigger{cursor:pointer}.cre8-c-tooltip__trigger:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}svg{display:flex;height:1rem;width:1rem}`;\nexport default styles;\n"]}
|