@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"danger-button.styles.js","sourceRoot":"","sources":["../../../components/danger-button/danger-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,u4tBAAu4tB,CAAC;AAC15tB,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}:host([fullWidth]){display:flex}.cre8-c-danger-button{font-family:var(--cre8-typography-label-default-font-family);font-size:var(--cre8-typography-label-default-font-size);font-weight:var(--cre8-typography-label-default-font-weight);line-height:var(--cre8-typography-label-default-line-height);text-decoration:var(--cre8-typography-label-default-text-decoration);text-transform:var(--cre8-typography-label-default-text-transform);width:var(--cre8-button-width, auto);height:var(--cre8-button-height, auto);min-width:var(--cre8-button-min-width, auto);min-height:var(--cre8-button-min-height, auto);justify-content:center;text-align:center;margin-top:var(--cre8-button-margin-top, 0);margin-bottom:var(--cre8-button-margin-bottom, 0);margin-left:var(--cre8-button-margin-left, 0);margin-right:var(--cre8-button-margin-right, 0);display:inline-flex;align-items:center;border-width:var(--cre8-border-width-button-default);box-shadow:var(--cre8-shadow-button);padding-top:var(--cre8-button-padding-vertical-medium);padding-right:var(--cre8-button-padding-horizontal-medium);padding-bottom:var(--cre8-button-padding-vertical-medium);padding-left:var(--cre8-button-padding-horizontal-medium);margin:0;cursor:pointer;border-style:var(--cre8-border-style-default);transition:revert;transform:revert;white-space:nowrap}.cre8-c-danger-button:hover,.cre8-c-danger-button:focus,.cre8-c-danger-button:active,.cre8-c-danger-button:focus-visible{border-style:var(--cre8-border-style-default);box-shadow:none;transform:revert;transition:revert}.cre8-c-danger-button.cre8-c-danger-button--primary{background:var(--cre8-color-button-primary-danger-bg);border-width:var(--cre8-border-width-button-default);border-color:var(--cre8-color-button-primary-danger-border);border-radius:var(--cre8-border-radius-button);box-shadow:var(--cre8-shadow-button);color:var(--cre8-color-button-primary-danger-content);--cre8-icon-fill: var(--cre8-color-button-primary-danger-content)}.cre8-c-danger-button.cre8-c-danger-button--primary:hover,.cre8-c-danger-button.cre8-c-danger-button--primary:focus{box-shadow:none;--cre8-icon-fill: var(--cre8-color-button-primary-danger-content-hover);color:var(--cre8-color-button-primary-danger-content-hover);border-color:var(--cre8-color-button-primary-danger-border-hover);background:var(--cre8-color-button-primary-danger-bg-hover);text-decoration:none}.cre8-c-danger-button.cre8-c-danger-button--primary:hover:focus,.cre8-c-danger-button.cre8-c-danger-button--primary:focus:focus{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--primary:active,.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--loading{box-shadow:none;color:var(--cre8-color-button-primary-danger-content-active);--cre8-icon-fill: var(--cre8-color-button-primary-danger-content-active);border-color:var(--cre8-color-button-primary-danger-border-active);background-color:var(--cre8-color-button-primary-danger-bg-active)}.cre8-c-danger-button.cre8-c-danger-button--primary:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--loading{cursor:not-allowed}.cre8-c-danger-button.cre8-c-danger-button--primary:disabled{box-shadow:none;background-color:var(--cre8-color-button-primary-danger-bg-disabled);border-color:var(--cre8-color-button-primary-danger-border-disabled);color:var(--cre8-color-button-primary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-primary-danger-content-disabled);cursor:not-allowed;outline:none}.cre8-c-danger-button.cre8-c-danger-button--primary:disabled:hover,.cre8-c-danger-button.cre8-c-danger-button--primary:disabled:focus,.cre8-c-danger-button.cre8-c-danger-button--primary:disabled:active,.cre8-c-danger-button.cre8-c-danger-button--primary:disabled:focus-visible{outline:none;background-color:var(--cre8-color-button-primary-danger-bg-disabled);border-color:var(--cre8-color-button-primary-danger-border-disabled);color:var(--cre8-color-button-primary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-primary-danger-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted{background-color:var(--cre8-color-button-primary-danger-inverse-bg);border-color:var(--cre8-color-button-primary-danger-inverse-border);color:var(--cre8-color-button-primary-danger-inverse-content)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:hover,.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:focus{background-color:var(--cre8-color-button-primary-danger-inverse-bg-hover);border-color:var(--cre8-color-button-primary-danger-inverse-border-hover);color:var(--cre8-color-button-primary-danger-inverse-content-hover)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:focus{outline-color:var(--cre8-color-button-primary-danger-inverse-outline)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:active{background-color:var(--cre8-color-button-primary-danger-inverse-bg-active);border-color:var(--cre8-color-button-primary-danger-inverse-border-active);color:var(--cre8-color-button-primary-danger-inverse-content-active)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:active.cre8-c-danger-button--loading{--cre8-icon-fill: var(--cre8-color-button-primary-danger-content-active)}.cre8-c-danger-button.cre8-c-danger-button--primary.cre8-c-danger-button--inverted:disabled{outline:none;cursor:not-allowed;background-color:var(--cre8-color-button-primary-danger-inverse-bg-disabled);border-color:var(--cre8-color-button-primary-danger-inverse-border-disabled);color:var(--cre8-color-button-primary-danger-inverse-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--secondary{background-color:var(--cre8-color-button-secondary-danger-bg);border-color:var(--cre8-color-button-secondary-danger-border);color:var(--cre8-color-button-secondary-danger-content);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content);border-radius:var(--cre8-border-radius-button);border-width:var(--cre8-border-width-button-default)}.cre8-c-danger-button.cre8-c-danger-button--secondary:hover,.cre8-c-danger-button.cre8-c-danger-button--secondary:focus{background-color:var(--cre8-color-button-secondary-danger-bg-hover);border-color:var(--cre8-color-button-secondary-danger-border-hover);color:var(--cre8-color-button-secondary-danger-content-hover);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-hover)}.cre8-c-danger-button.cre8-c-danger-button--secondary:hover:focus,.cre8-c-danger-button.cre8-c-danger-button--secondary:focus:focus{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--secondary:active,.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--loading{transition:none;transform:none;background-color:var(--cre8-color-button-secondary-danger-bg-active);border-color:var(--cre8-color-button-secondary-danger-border-active);color:var(--cre8-color-button-secondary-danger-content-active);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-active)}.cre8-c-danger-button.cre8-c-danger-button--secondary:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--loading{cursor:not-allowed}.cre8-c-danger-button.cre8-c-danger-button--secondary:disabled{box-shadow:none;background-color:var(--cre8-color-button-secondary-danger-bg-disabled);border-color:var(--cre8-color-button-secondary-danger-border-disabled);color:var(--cre8-color-button-secondary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-disabled);outline:none;border-radius:var(--cre8-border-radius-button);border-width:var(--cre8-border-width-button-default);cursor:not-allowed}.cre8-c-danger-button.cre8-c-danger-button--secondary:disabled:hover,.cre8-c-danger-button.cre8-c-danger-button--secondary:disabled:focus,.cre8-c-danger-button.cre8-c-danger-button--secondary:disabled:active,.cre8-c-danger-button.cre8-c-danger-button--secondary:disabled:focus-visible{outline:none;background-color:var(--cre8-color-button-secondary-danger-bg-disabled);border-color:var(--cre8-color-button-secondary-danger-border-disabled);color:var(--cre8-color-button-secondary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted{background-color:var(--cre8-color-button-secondary-danger-inverse-bg);border-color:var(--cre8-color-button-secondary-danger-inverse-border);color:var(--cre8-color-button-secondary-danger-inverse-content)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:hover,.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:focus{background-color:var(--cre8-color-button-secondary-danger-inverse-bg-hover);border-color:var(--cre8-color-button-secondary-danger-inverse-border-hover);color:var(--cre8-color-button-secondary-danger-inverse-content-hover)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:focus{outline-color:var(--cre8-color-button-secondary-danger-inverse-outline)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:active{background-color:var(--cre8-color-button-secondary-danger-inverse-bg-active);border-color:var(--cre8-color-button-secondary-danger-inverse-border-active);color:var(--cre8-color-button-secondary-danger-inverse-content-active)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:active.cre8-c-danger-button--loading{--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-active)}.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--inverted:disabled{outline:none;cursor:not-allowed;background-color:var(--cre8-color-button-secondary-danger-inverse-bg-disabled);border-color:var(--cre8-color-button-secondary-danger-inverse-border-disabled);color:var(--cre8-color-button-secondary-danger-inverse-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--tertiary{border-radius:var(--cre8-border-radius-button);background-color:var(--cre8-color-button-tertiary-danger-bg);border-width:var(--cre8-border-width-button-default);border-color:var(--cre8-color-button-tertiary-danger-border);color:var(--cre8-color-button-tertiary-danger-content);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content);box-shadow:none}.cre8-c-danger-button.cre8-c-danger-button--tertiary:hover,.cre8-c-danger-button.cre8-c-danger-button--tertiary:focus{border-radius:var(--cre8-border-radius-button);background-color:var(--cre8-color-button-tertiary-danger-bg-hover);border-width:var(--cre8-border-width-button-default, --cre8-border-width-none);border-color:var(--cre8-color-button-tertiary-danger-border-hover);color:var(--cre8-color-button-tertiary-danger-content-hover);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-hover)}.cre8-c-danger-button.cre8-c-danger-button--tertiary:hover:focus,.cre8-c-danger-button.cre8-c-danger-button--tertiary:focus:focus{outline:var(--cre8-border-width-focus) var(--cre8-border-style-button-tertiary-outline-focus) var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--tertiary:active,.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--loading{border-radius:var(--cre8-border-radius-button);background-color:var(--cre8-color-button-tertiary-danger-bg-active);border-color:var(--cre8-color-button-tertiary-danger-border-active);border-width:var(--cre8-border-width-button-default);color:var(--cre8-color-button-tertiary-danger-content-active);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-active)}.cre8-c-danger-button.cre8-c-danger-button--tertiary:focus-visible{outline:var(--cre8-border-width-focus) var(--cre8-border-style-button-tertiary-outline-focus) var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--loading{cursor:not-allowed}.cre8-c-danger-button.cre8-c-danger-button--tertiary:disabled{background-color:var(--cre8-color-button-tertiary-danger-bg-disabled);border-color:rgba(0,0,0,0);color:var(--cre8-color-button-tertiary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-disabled);outline:none;box-shadow:none;cursor:not-allowed}.cre8-c-danger-button.cre8-c-danger-button--tertiary:disabled:hover,.cre8-c-danger-button.cre8-c-danger-button--tertiary:disabled:focus{outline:none;box-shadow:none;background-color:var(--cre8-color-button-tertiary-danger-bg-disabled);color:var(--cre8-color-button-tertiary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--tertiary:disabled:active,.cre8-c-danger-button.cre8-c-danger-button--tertiary:disabled:focus-visible{outline:none;box-shadow:none;background-color:var(--cre8-color-button-tertiary-danger-bg-disabled);color:var(--cre8-color-button-tertiary-danger-content-disabled);--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted{background-color:var(--cre8-color-button-tertiary-danger-inverse-bg);border-color:var(--cre8-color-button-tertiary-danger-inverse-border);color:var(--cre8-color-button-tertiary-danger-inverse-content)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:hover,.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:focus{background-color:var(--cre8-color-button-tertiary-danger-inverse-bg-hover);border-color:var(--cre8-color-button-tertiary-danger-inverse-border-hover);color:var(--cre8-color-button-tertiary-danger-inverse-content-hover)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:focus{outline-color:var(--cre8-color-button-tertiary-danger-inverse-outline)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:active{background-color:var(--cre8-color-button-tertiary-danger-inverse-bg-active);border-color:var(--cre8-color-button-tertiary-danger-inverse-border-active);color:var(--cre8-color-button-tertiary-danger-inverse-content-active)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:active.cre8-c-danger-button--loading{--cre8-icon-fill: var(--cre8-color-button-tertiary-danger-content-active)}.cre8-c-danger-button.cre8-c-danger-button--tertiary.cre8-c-danger-button--inverted:disabled{outline:none;cursor:not-allowed;background-color:var(--cre8-color-button-tertiary-danger-inverse-bg-disabled);border-color:var(--cre8-color-button-tertiary-danger-inverse-border-disabled);color:var(--cre8-color-button-tertiary-danger-inverse-content-disabled)}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--split-button-text{border-radius:var(--cre8-border-radius-button) var(--cre8-border-radius-none) var(--cre8-border-radius-none) var(--cre8-border-radius-button);border-color:var(--cre8-color-button-secondary-danger-border);border-width:var(--cre8-border-width-button-default);color:var(--cre8-color-button-secondary-danger-content)}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--split-button-text:active,.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--split-button-text:focus-visible{outline:none}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--split-button-text.cre8-c-danger-button--lg{padding:var(--cre8-button-padding-vertical-large) var(--cre8-button-padding-horizontal-large)}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--secondary.cre8-c-danger-button--split-button-text.cre8-c-danger-button--sm{padding:var(--cre8-button-padding-vertical-small) var(--cre8-button-padding-horizontal-small)}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--icon-only.cre8-c-danger-button--split-button-caret{padding:var(--cre8-button-padding-vertical-medium);border-radius:var(--cre8-border-radius-none) var(--cre8-border-radius-button) var(--cre8-border-radius-button) var(--cre8-border-radius-none);height:100%;border-left:none !important;border-collapse:collapse;background:var(--cre8-color-button-secondary-danger-bg);border-color:var(--cre8-color-button-secondary-danger-border);border-width:var(--cre8-border-width-button-default);color:var(--cre8-color-button-secondary-danger-content);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content)}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--icon-only.cre8-c-danger-button--split-button-caret:hover,.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--icon-only.cre8-c-danger-button--split-button-caret:focus{background:var(--cre8-color-button-secondary-danger-bg-hover);border-color:var(--cre8-color-button-secondary-danger-border-hover);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-hover);outline:none;border-left:none;border-collapse:collapse}.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--icon-only.cre8-c-danger-button--split-button-caret:active,.cre8-c-danger-button.cre8-c-danger-button.cre8-c-danger-button--icon-only.cre8-c-danger-button--split-button-caret:focus-visible{background:var(--cre8-color-button-secondary-danger-bg-active);border-color:var(--cre8-color-button-secondary-danger-border-active);--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-active);outline:none;border-left:none;border-collapse:collapse}.cre8-c-danger-button--lg{padding:var(--cre8-button-padding-vertical-large)}.cre8-c-danger-button--sm{padding:var(--cre8-button-padding-vertical-small)}.cre8-c-danger-button--icon-only{padding:var(--cre8-button-padding-vertical-small);color:var(--cre8-icon-fill, currentColor)}.cre8-c-danger-button--full-width{width:100%;display:flex}.cre8-c-danger-button--sm{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);padding-top:var(--cre8-button-padding-vertical-small);padding-right:var(--cre8-button-padding-horizontal-small);padding-bottom:var(--cre8-button-padding-vertical-small);padding-left:var(--cre8-button-padding-horizontal-small)}.cre8-c-danger-button--lg{font-family:var(--cre8-typography-label-large-font-family);font-size:var(--cre8-typography-label-large-font-size);font-weight:var(--cre8-typography-label-large-font-weight);line-height:var(--cre8-typography-label-large-line-height);text-decoration:var(--cre8-typography-label-large-text-decoration);text-transform:var(--cre8-typography-label-large-text-transform);padding-top:var(--cre8-button-padding-vertical-large);padding-right:var(--cre8-button-padding-horizontal-large);padding-bottom:var(--cre8-button-padding-vertical-large);padding-left:var(--cre8-button-padding-horizontal-large)}.cre8-c-danger-button--sm cre8-icon{--cre8-icon-height: var(--cre8-icon-size-small);--cre8-icon-width: var(--cre8-icon-size-small)}.cre8-c-danger-button--lg cre8-icon{--cre8-icon-height: var(--cre8-icon-size-large);--cre8-icon-width: var(--cre8-icon-size-large)}::slotted(*){margin-right:0}cre8-icon+.cre8-c-danger-button__text:not(.cre8-u-is-vishidden){margin-left:0.5rem;display:inline-flex}.cre8-c-danger-button__text:not(.cre8-u-is-vishidden)+cre8-icon{margin-left:0.5rem;display:inline-flex}.cre8-c-danger-button:has(.cre8-c-danger-button__text.cre8-u-is-vishidden)+cre8-icon{border-radius:var(--cre8-border-radius-button)}.cre8-c-danger-button__text.cre8-u-is-vishidden+cre8-icon{margin-left:0px;margin-right:0px;display:flex}.cre8-c-danger-button__text.cre8-u-is-vishidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.cre8-c-danger-button--primary.cre8-c-danger-button--loading{--cre8-icon-fill: var(--cre8-color-content-knockout)}.cre8-c-danger-button--secondary.cre8-c-danger-button--loading,.cre8-c-danger-button--tertiary.cre8-c-danger-button--loading{--cre8-icon-fill: var(--cre8-color-button-secondary-danger-content-active)}.cre8-u-is-vishidden{--cre8-icon-height: 0px;--cre8-icon-width: 0px;max-width:fit-content;min-width:0px;width:auto;height:auto;max-height:fit-content;min-width:0px;border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}cre8-icon.cre8-u-is-vishidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}cre8-icon{display:flex;align-items:center;justify-content:center}span.cre8-c-danger-button__icon{margin-left:0.5rem;max-width:fit-content;min-width:0px;width:auto;height:auto;max-height:fit-content;min-width:0px}`;\nexport default styles;\n"]}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/* eslint-disable max-statements */
|
|
2
|
+
/* eslint-disable indent */
|
|
3
|
+
/* eslint-disable lit/no-template-arrow */
|
|
4
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
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;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
};
|
|
10
|
+
/* TODO: remove eslint disable on no-template-arrow */
|
|
11
|
+
import { html, nothing, } from 'lit';
|
|
12
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
13
|
+
import styles from './calendar.styles.js';
|
|
14
|
+
import { Cre8Element } from '../../cre8-element';
|
|
15
|
+
import '../../icon/icon';
|
|
16
|
+
import '../calendar-month-modal/calendar-month-modal';
|
|
17
|
+
import '../calendar-year-modal/calendar-year-modal';
|
|
18
|
+
import '../calendar-navigation/calendar-navigation';
|
|
19
|
+
import '../../button/button';
|
|
20
|
+
export var CalendarModal;
|
|
21
|
+
(function (CalendarModal) {
|
|
22
|
+
CalendarModal["Month"] = "month";
|
|
23
|
+
CalendarModal["Year"] = "year";
|
|
24
|
+
CalendarModal["None"] = "none";
|
|
25
|
+
})(CalendarModal || (CalendarModal = {}));
|
|
26
|
+
export class Cre8Calendar extends Cre8Element {
|
|
27
|
+
get activeModal() {
|
|
28
|
+
return this._activeModal;
|
|
29
|
+
}
|
|
30
|
+
set activeModal(activeModal) {
|
|
31
|
+
this._activeModal = activeModal;
|
|
32
|
+
}
|
|
33
|
+
get fieldDate() {
|
|
34
|
+
return this._fieldDate;
|
|
35
|
+
}
|
|
36
|
+
set fieldDate(newFieldDate) {
|
|
37
|
+
const oldDate = this._fieldDate;
|
|
38
|
+
this.requestUpdate('fieldDate', oldDate);
|
|
39
|
+
const isNewDateValid = !!(newFieldDate && new Date(`${newFieldDate}T00:00`).getTime());
|
|
40
|
+
this.currentDate = isNewDateValid
|
|
41
|
+
? new Date(`${newFieldDate}T00:00`)
|
|
42
|
+
: new Date();
|
|
43
|
+
this._fieldDate = isNewDateValid ? newFieldDate : '';
|
|
44
|
+
}
|
|
45
|
+
get currentDate() {
|
|
46
|
+
return this._currentDate;
|
|
47
|
+
}
|
|
48
|
+
set currentDate(newDate) {
|
|
49
|
+
const oldDate = this._currentDate;
|
|
50
|
+
this._currentDate = newDate;
|
|
51
|
+
this.requestUpdate('currentDate', oldDate);
|
|
52
|
+
}
|
|
53
|
+
constructor() {
|
|
54
|
+
super();
|
|
55
|
+
this._activeModal = CalendarModal.None;
|
|
56
|
+
this._handleOnClickOutside = this._handleOnClickOutside.bind(this);
|
|
57
|
+
this.currentDate = (this.fieldDate && new Date(`${this.fieldDate}T00:00`)) ?? new Date();
|
|
58
|
+
this.locale = document.documentElement.getAttribute('lang') || 'en-US';
|
|
59
|
+
this.dateConfig = {
|
|
60
|
+
locale: this.locale,
|
|
61
|
+
today: new Date(),
|
|
62
|
+
weekInfo: {
|
|
63
|
+
firstDay: 7,
|
|
64
|
+
weekend: [6, 7],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
this.weekDays = [
|
|
68
|
+
'Sunday',
|
|
69
|
+
'Monday',
|
|
70
|
+
'Tuesday',
|
|
71
|
+
'Wednesday',
|
|
72
|
+
'Thursday',
|
|
73
|
+
'Friday',
|
|
74
|
+
'Saturday',
|
|
75
|
+
];
|
|
76
|
+
this.dateFormatOptions = {
|
|
77
|
+
weekday: 'long',
|
|
78
|
+
year: 'numeric',
|
|
79
|
+
month: 'long',
|
|
80
|
+
day: 'numeric',
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
connectedCallback() {
|
|
84
|
+
super.connectedCallback();
|
|
85
|
+
window.addEventListener('click', this._handleOnClickOutside, false);
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
super.disconnectedCallback();
|
|
89
|
+
window.removeEventListener('click', this._handleOnClickOutside, false);
|
|
90
|
+
}
|
|
91
|
+
/* Click Event Functions */
|
|
92
|
+
_handleOnClickOutside(event) {
|
|
93
|
+
if (!this.shadowRoot?.host) {
|
|
94
|
+
throw Error('Could not determine navigation context during click handler');
|
|
95
|
+
}
|
|
96
|
+
const didClickInside = event.composedPath().includes(this.shadowRoot.host);
|
|
97
|
+
if (!didClickInside) {
|
|
98
|
+
const outsideClickEvent = new CustomEvent('outsideClick', {
|
|
99
|
+
detail: {
|
|
100
|
+
composedPath: event.composedPath(),
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
this.dispatchEvent(outsideClickEvent);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
emitSelectedDate(date) {
|
|
107
|
+
const event = new CustomEvent('dateSelect', {
|
|
108
|
+
detail: {
|
|
109
|
+
date,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
this.currentDate = new Date(`${date}T00:00`);
|
|
113
|
+
this.dispatchEvent(event);
|
|
114
|
+
}
|
|
115
|
+
changeYear(year) {
|
|
116
|
+
const oldDate = this.currentDate;
|
|
117
|
+
const newDate = new Date(oldDate.setFullYear(year));
|
|
118
|
+
this.currentDate = newDate;
|
|
119
|
+
this.activeModal = CalendarModal.None;
|
|
120
|
+
}
|
|
121
|
+
changeMonth(month) {
|
|
122
|
+
const oldDate = this.currentDate;
|
|
123
|
+
const newDate = new Date(oldDate.setMonth(month));
|
|
124
|
+
this.currentDate = newDate;
|
|
125
|
+
this.activeModal = CalendarModal.None;
|
|
126
|
+
}
|
|
127
|
+
activateModal(modal) {
|
|
128
|
+
this.activeModal = modal;
|
|
129
|
+
}
|
|
130
|
+
/* Helper/Get Functions */
|
|
131
|
+
static formatMonthOrDayIndex(val) {
|
|
132
|
+
return (val + 1).toString().padStart(2, '0');
|
|
133
|
+
}
|
|
134
|
+
static formatDate(val) {
|
|
135
|
+
return val.toString().padStart(2, '0');
|
|
136
|
+
}
|
|
137
|
+
numberOfDaysinMonth() {
|
|
138
|
+
return new Date(this.getYear(), this.getMonth() + 1, 0).getDate();
|
|
139
|
+
}
|
|
140
|
+
getMonth() {
|
|
141
|
+
return this.currentDate.getMonth();
|
|
142
|
+
}
|
|
143
|
+
getMonthName() {
|
|
144
|
+
const monthName = new Intl.DateTimeFormat(this.locale, {
|
|
145
|
+
month: 'long',
|
|
146
|
+
}).format(this.currentDate);
|
|
147
|
+
return monthName;
|
|
148
|
+
}
|
|
149
|
+
getYear() {
|
|
150
|
+
return this.currentDate.getFullYear();
|
|
151
|
+
}
|
|
152
|
+
static dateToString(date) {
|
|
153
|
+
return `${date.getFullYear()}-${Cre8Calendar.formatMonthOrDayIndex(date.getMonth())}-${Cre8Calendar.formatDate(date.getDate())}`;
|
|
154
|
+
}
|
|
155
|
+
async updateFocusForKeydown(newDate) {
|
|
156
|
+
this.currentDate = newDate;
|
|
157
|
+
await this.updateComplete;
|
|
158
|
+
const newFocus = this.shadowRoot?.querySelector(`button[datetime="${Cre8Calendar.dateToString(newDate)}"]`);
|
|
159
|
+
newFocus.setAttribute('tabindex', '0');
|
|
160
|
+
newFocus.focus();
|
|
161
|
+
}
|
|
162
|
+
_handleCalendarKeyDown(e) {
|
|
163
|
+
const oldFocus = this.shadowRoot?.querySelector(`button[datetime="${Cre8Calendar.dateToString(this.currentDate)}"]`);
|
|
164
|
+
if (e.key === 'ArrowUp') {
|
|
165
|
+
const newDate = new Date(this.getYear(), this.getMonth(), this.currentDate.getDate() - 7);
|
|
166
|
+
this.updateFocusForKeydown(newDate);
|
|
167
|
+
oldFocus.setAttribute('tabindex', '-1');
|
|
168
|
+
}
|
|
169
|
+
if (e.key === 'ArrowDown') {
|
|
170
|
+
const newDate = new Date(this.getYear(), this.getMonth(), this.currentDate.getDate() + 7);
|
|
171
|
+
this.updateFocusForKeydown(newDate);
|
|
172
|
+
oldFocus.setAttribute('tabindex', '-1');
|
|
173
|
+
}
|
|
174
|
+
if (e.key === 'ArrowLeft') {
|
|
175
|
+
const newDate = new Date(this.getYear(), this.getMonth(), this.currentDate.getDate() - 1);
|
|
176
|
+
this.updateFocusForKeydown(newDate);
|
|
177
|
+
oldFocus.setAttribute('tabindex', '-1');
|
|
178
|
+
}
|
|
179
|
+
if (e.key === 'ArrowRight') {
|
|
180
|
+
const newDate = new Date(this.getYear(), this.getMonth(), this.currentDate.getDate() + 1);
|
|
181
|
+
this.updateFocusForKeydown(newDate);
|
|
182
|
+
oldFocus.setAttribute('tabindex', '-1');
|
|
183
|
+
}
|
|
184
|
+
if (e.key === 'Tab' && !e.shiftKey) {
|
|
185
|
+
const outsideClickEvent = new CustomEvent('outsideClick', {
|
|
186
|
+
detail: {
|
|
187
|
+
composedPath: [],
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
// This allows the tab off to happen before the calendar closes
|
|
191
|
+
setTimeout(() => { this.dispatchEvent(outsideClickEvent); }, 20);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async changeMonthFromNav(month) {
|
|
195
|
+
this.changeMonth(month);
|
|
196
|
+
await this.updateComplete;
|
|
197
|
+
const nav = this.shadowRoot?.querySelector('cre8-calendar-navigation');
|
|
198
|
+
const monthPickerButton = nav.shadowRoot?.querySelector('.cre8-c-calendar-navigation__month-modal-button');
|
|
199
|
+
await this.updateComplete;
|
|
200
|
+
const button = monthPickerButton.shadowRoot.querySelector('button');
|
|
201
|
+
button.focus();
|
|
202
|
+
}
|
|
203
|
+
async changeYearFromNav(year) {
|
|
204
|
+
this.changeYear(year);
|
|
205
|
+
await this.updateComplete;
|
|
206
|
+
const nav = this.shadowRoot?.querySelector('cre8-calendar-navigation');
|
|
207
|
+
const yearPickerButton = nav.shadowRoot?.querySelector('.cre8-c-calendar-navigation__year-modal-button');
|
|
208
|
+
await this.updateComplete;
|
|
209
|
+
const button = yearPickerButton.shadowRoot.querySelector('button');
|
|
210
|
+
button.focus();
|
|
211
|
+
}
|
|
212
|
+
/* Template Map Functions */
|
|
213
|
+
getDaysOfWeekAbbreviations() {
|
|
214
|
+
return this.weekDays.map((day) => html ` <td>
|
|
215
|
+
<span aria-label="${day}">${day[0]}</span>
|
|
216
|
+
</td>`);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Create array of Day Buttons to fill in excess calendar space at the beginning of the month.
|
|
220
|
+
*
|
|
221
|
+
* 1. Map from empty array of length equal to the amount of access calendar "slots" in the beginning of the month.
|
|
222
|
+
* (i.e. if the month starts on Wednesday (getDay = 3), there are 3 days prior that week from last month.)
|
|
223
|
+
*
|
|
224
|
+
* 2. Based on the indice of array, get the given day button's date, where the date is
|
|
225
|
+
* the last day of last month minus the max of the array plus the indice plus one -> x = lastday - (max - (i + 1))
|
|
226
|
+
* (Note: (max - (i + 1) equals the keys of the array in reverse order:
|
|
227
|
+
* [max - i + 1] -> [3-1, 3-2, 3-3] -> [2,1,0] for an array of [3])
|
|
228
|
+
* (i.e. if the calendar is starting on Wednesday June 1st, the access days on the calendar will be
|
|
229
|
+
* Sunday May 29th (31 - (2)), Monday May 30th (31 - (1)), Tuesday May 31st (31 - (0)))
|
|
230
|
+
*
|
|
231
|
+
* 3. Build out day button with necessary props
|
|
232
|
+
* */
|
|
233
|
+
getPreviousMonthDayButtons() {
|
|
234
|
+
/* 1 */
|
|
235
|
+
return [
|
|
236
|
+
...Array(new Date(this.getYear(), this.getMonth(), 1).getDay()).keys(),
|
|
237
|
+
].map((i) => {
|
|
238
|
+
const priorMonthArrayLength = new Date(this.getYear(), this.getMonth(), 1).getDay();
|
|
239
|
+
const finalDayLastMonth = new Date(this.getYear(), this.getMonth(), 0);
|
|
240
|
+
const numberOfDaysinLastMonth = finalDayLastMonth.getDate();
|
|
241
|
+
/* 2 */
|
|
242
|
+
const priorMonthDay = new Date(finalDayLastMonth.getFullYear(), finalDayLastMonth.getMonth(), numberOfDaysinLastMonth - priorMonthArrayLength + (i + 1));
|
|
243
|
+
const isToday = this.dateConfig.today.getDate() === priorMonthDay.getDate()
|
|
244
|
+
&& this.dateConfig.today.getMonth() === priorMonthDay.getMonth()
|
|
245
|
+
&& this.dateConfig.today.getFullYear() === priorMonthDay.getFullYear();
|
|
246
|
+
const isSelected = new Date(`${this.fieldDate}T00:00`).getTime()
|
|
247
|
+
=== priorMonthDay.getTime();
|
|
248
|
+
/* 3 */
|
|
249
|
+
return html ` <td>
|
|
250
|
+
<button
|
|
251
|
+
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
252
|
+
datetime="${Cre8Calendar.dateToString(priorMonthDay)}"
|
|
253
|
+
?data-today="${isToday}"
|
|
254
|
+
?data-selected="${isSelected}"
|
|
255
|
+
tabindex="-1"
|
|
256
|
+
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
257
|
+
weekday: 'long',
|
|
258
|
+
year: 'numeric',
|
|
259
|
+
month: 'long',
|
|
260
|
+
day: 'numeric',
|
|
261
|
+
}).format(new Date(`${Cre8Calendar.dateToString(priorMonthDay)}T00:00`))}"
|
|
262
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(priorMonthDay))}"
|
|
263
|
+
>
|
|
264
|
+
${new Intl.NumberFormat(this.locale).format(priorMonthDay.getDate())}
|
|
265
|
+
</button>
|
|
266
|
+
</td>`;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Create array of Day Buttons to fill out current month
|
|
271
|
+
*
|
|
272
|
+
* 1. Map from empty array of length equal to the amount days in this month
|
|
273
|
+
*
|
|
274
|
+
* 2. Get the date of the current month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
|
|
275
|
+
*
|
|
276
|
+
* 3. Build out day button with necessary props
|
|
277
|
+
* */
|
|
278
|
+
getCurrentMonthDayButtons() {
|
|
279
|
+
/* 1 */
|
|
280
|
+
return [...Array(this.numberOfDaysinMonth()).keys()].map((i) => {
|
|
281
|
+
const dayOfTheMonth = i + 1;
|
|
282
|
+
/* 2 */
|
|
283
|
+
const current = new Date(this.getYear(), this.getMonth(), dayOfTheMonth);
|
|
284
|
+
const isToday = this.dateConfig.today.getDate() === dayOfTheMonth
|
|
285
|
+
&& this.dateConfig.today.getMonth() === this.getMonth()
|
|
286
|
+
&& this.dateConfig.today.getFullYear() === this.getYear();
|
|
287
|
+
const isSelected = new Date(`${this.fieldDate}T00:00`).getTime() === current.getTime();
|
|
288
|
+
/* 3 */
|
|
289
|
+
return html ` <td>
|
|
290
|
+
<button
|
|
291
|
+
class="cre8-c-calendar__day-button"
|
|
292
|
+
datetime="${Cre8Calendar.dateToString(current)}"
|
|
293
|
+
?data-today="${isToday}"
|
|
294
|
+
?data-selected="${isSelected}"
|
|
295
|
+
tabindex="${dayOfTheMonth === this.currentDate.getDate()
|
|
296
|
+
? '0'
|
|
297
|
+
: '-1'}"
|
|
298
|
+
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
299
|
+
weekday: 'long',
|
|
300
|
+
year: 'numeric',
|
|
301
|
+
month: 'long',
|
|
302
|
+
day: 'numeric',
|
|
303
|
+
}).format(new Date(`${Cre8Calendar.dateToString(current)}T00:00`))}"
|
|
304
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(current))}"
|
|
305
|
+
>
|
|
306
|
+
${new Intl.NumberFormat(this.locale).format(i + 1)}
|
|
307
|
+
</button>
|
|
308
|
+
</td>`;
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Create array of Day Buttons to fill in excess calendar space at the end of the month.
|
|
313
|
+
*
|
|
314
|
+
* 1. Map from empty array of length equal to the amount of access calendar "slots" at the end of the month.
|
|
315
|
+
* The array have an amount of slots equal to the number of days in a week minus how many days have already past
|
|
316
|
+
* and since getDay returns the index of the day of the week (Sunday = 0, Monday = 1 ...) our equations is
|
|
317
|
+
* x = 7 - (getDay() + 1)
|
|
318
|
+
* Note: (we need to add 1 because indexing starts at 0)
|
|
319
|
+
* so if the month ends on Monday (getDay() = 1), 5 = 7 - (1 + 1), there are 5 days that week from the new month
|
|
320
|
+
*
|
|
321
|
+
* 2. Get the date from the next month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
|
|
322
|
+
*
|
|
323
|
+
* 3. Build out day button with necessary props
|
|
324
|
+
* */
|
|
325
|
+
getNextMonthDayButtons() {
|
|
326
|
+
/* 1 */
|
|
327
|
+
return [
|
|
328
|
+
...Array(6
|
|
329
|
+
- new Date(this.getYear(), this.getMonth(), this.numberOfDaysinMonth()).getDay()).keys(),
|
|
330
|
+
].map((i) => {
|
|
331
|
+
const lastDayThisMonth = new Date(this.getYear(), this.getMonth(), this.numberOfDaysinMonth());
|
|
332
|
+
const firstDayNextMonth = new Date(lastDayThisMonth.setDate(lastDayThisMonth.getDate() + 1));
|
|
333
|
+
/* 2 */
|
|
334
|
+
const nextMonthDay = new Date(firstDayNextMonth.getFullYear(), firstDayNextMonth.getMonth(), i + 1);
|
|
335
|
+
const isToday = this.dateConfig.today.getDate() === nextMonthDay.getDate()
|
|
336
|
+
&& this.dateConfig.today.getMonth() === nextMonthDay.getMonth()
|
|
337
|
+
&& this.dateConfig.today.getFullYear() === nextMonthDay.getFullYear();
|
|
338
|
+
const isSelected = new Date(`${this.fieldDate}T00:00`).getTime()
|
|
339
|
+
=== nextMonthDay.getTime();
|
|
340
|
+
/* 3 */
|
|
341
|
+
return html ` <td>
|
|
342
|
+
<button
|
|
343
|
+
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
344
|
+
datetime="${Cre8Calendar.dateToString(nextMonthDay)}"
|
|
345
|
+
?data-today="${isToday}"
|
|
346
|
+
?data-selected="${isSelected}"
|
|
347
|
+
tabindex="-1"
|
|
348
|
+
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
349
|
+
weekday: 'long',
|
|
350
|
+
year: 'numeric',
|
|
351
|
+
month: 'long',
|
|
352
|
+
day: 'numeric',
|
|
353
|
+
}).format(new Date(`${Cre8Calendar.dateToString(nextMonthDay)}T00:00`))}"
|
|
354
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(nextMonthDay))}"
|
|
355
|
+
>
|
|
356
|
+
${new Intl.NumberFormat(this.locale).format(nextMonthDay.getDate())}
|
|
357
|
+
</button>
|
|
358
|
+
</td>`;
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
render() {
|
|
362
|
+
const componentClassNames = this.componentClassNames('cre8-c-calendar', {});
|
|
363
|
+
return html ` <div class="${componentClassNames}">
|
|
364
|
+
${this._activeModal === CalendarModal.Month
|
|
365
|
+
? html `<cre8-calendar-month-modal
|
|
366
|
+
currentMonth="${this.getMonth()}"
|
|
367
|
+
@changeMonth="${(e) => this.changeMonthFromNav(e.detail.month)}"
|
|
368
|
+
></cre8-calendar-month-modal>`
|
|
369
|
+
: nothing}
|
|
370
|
+
${this._activeModal === CalendarModal.Year
|
|
371
|
+
? html `<cre8-calendar-year-modal
|
|
372
|
+
currentYear="${this.getYear()}"
|
|
373
|
+
@changeYear="${(e) => this.changeYearFromNav(e.detail.year)}"
|
|
374
|
+
></cre8-calendar-year-modal>`
|
|
375
|
+
: nothing}
|
|
376
|
+
${this._activeModal === CalendarModal.None
|
|
377
|
+
? html ` ${this.hasShortcuts
|
|
378
|
+
? html `<div class="cre8-c-calendar__header-shortcuts">
|
|
379
|
+
<cre8-button
|
|
380
|
+
text="Today"
|
|
381
|
+
variant="secondary"
|
|
382
|
+
size="sm"
|
|
383
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(this.dateConfig.today))}"
|
|
384
|
+
></cre8-button>
|
|
385
|
+
<cre8-button
|
|
386
|
+
text="Tomorrow"
|
|
387
|
+
variant="secondary"
|
|
388
|
+
size="sm"
|
|
389
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(new Date(this.dateConfig.today.setDate(this.dateConfig.today.getDate() + 1))))}"
|
|
390
|
+
></cre8-button>
|
|
391
|
+
<cre8-button
|
|
392
|
+
text="In 2 days"
|
|
393
|
+
variant="secondary"
|
|
394
|
+
size="sm"
|
|
395
|
+
@click="${() => this.emitSelectedDate(Cre8Calendar.dateToString(new Date(this.dateConfig.today.setDate(this.dateConfig.today.getDate() + 2))))}"
|
|
396
|
+
></cre8-button>
|
|
397
|
+
</div>`
|
|
398
|
+
: nothing}
|
|
399
|
+
<cre8-calendar-navigation
|
|
400
|
+
monthName="${this.getMonthName()}"
|
|
401
|
+
year="${this.getYear()}"
|
|
402
|
+
@activateModal="${(e) => this.activateModal(e.detail.modal)}"
|
|
403
|
+
@changeMonth="${(e) => this.changeMonth(this.getMonth() + e.detail.addend)}"
|
|
404
|
+
@changeYear="${(e) => this.changeYear(this.getYear() + e.detail.addend)}"
|
|
405
|
+
>
|
|
406
|
+
</cre8-calendar-navigation>
|
|
407
|
+
<table>
|
|
408
|
+
<thead>
|
|
409
|
+
<tr>
|
|
410
|
+
${this.getDaysOfWeekAbbreviations()}
|
|
411
|
+
</tr>
|
|
412
|
+
</thead>
|
|
413
|
+
<tbody>
|
|
414
|
+
<tr @keydown=${this._handleCalendarKeyDown}>
|
|
415
|
+
${this.getPreviousMonthDayButtons()}
|
|
416
|
+
${this.getCurrentMonthDayButtons()}
|
|
417
|
+
${this.getNextMonthDayButtons()}
|
|
418
|
+
</tr>
|
|
419
|
+
</tbody>
|
|
420
|
+
</table>`
|
|
421
|
+
: nothing}
|
|
422
|
+
</div>`;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
Cre8Calendar.styles = [styles];
|
|
426
|
+
__decorate([
|
|
427
|
+
query('.cre8-c-calendar__navigation-wrapper')
|
|
428
|
+
], Cre8Calendar.prototype, "_navWrapper", void 0);
|
|
429
|
+
__decorate([
|
|
430
|
+
property({ type: Boolean, reflect: true })
|
|
431
|
+
], Cre8Calendar.prototype, "hasShortcuts", void 0);
|
|
432
|
+
__decorate([
|
|
433
|
+
state()
|
|
434
|
+
], Cre8Calendar.prototype, "_activeModal", void 0);
|
|
435
|
+
__decorate([
|
|
436
|
+
property({ reflect: true, type: String })
|
|
437
|
+
], Cre8Calendar.prototype, "activeModal", null);
|
|
438
|
+
__decorate([
|
|
439
|
+
state()
|
|
440
|
+
], Cre8Calendar.prototype, "_fieldDate", void 0);
|
|
441
|
+
__decorate([
|
|
442
|
+
property({ reflect: true, type: Date })
|
|
443
|
+
], Cre8Calendar.prototype, "fieldDate", null);
|
|
444
|
+
__decorate([
|
|
445
|
+
state()
|
|
446
|
+
], Cre8Calendar.prototype, "_currentDate", void 0);
|
|
447
|
+
__decorate([
|
|
448
|
+
property({ reflect: true, type: Date })
|
|
449
|
+
], Cre8Calendar.prototype, "currentDate", null);
|
|
450
|
+
__decorate([
|
|
451
|
+
state()
|
|
452
|
+
], Cre8Calendar.prototype, "locale", void 0);
|
|
453
|
+
__decorate([
|
|
454
|
+
state()
|
|
455
|
+
], Cre8Calendar.prototype, "weekDays", void 0);
|
|
456
|
+
__decorate([
|
|
457
|
+
state()
|
|
458
|
+
], Cre8Calendar.prototype, "dateConfig", void 0);
|
|
459
|
+
__decorate([
|
|
460
|
+
state()
|
|
461
|
+
], Cre8Calendar.prototype, "dateFormatOptions", void 0);
|
|
462
|
+
if (customElements.get('cre8-calendar') === undefined) {
|
|
463
|
+
customElements.define('cre8-calendar', Cre8Calendar);
|
|
464
|
+
}
|
|
465
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../components/date-picker/calendar/calendar.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,2BAA2B;AAC3B,0CAA0C;;;;;;;AAE1C,sDAAsD;AACtD,OAAO,EACU,IAAI,EAAE,OAAO,GAC7B,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,iBAAiB,CAAC;AACzB,OAAO,8CAA8C,CAAC;AACtD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,qBAAqB,CAAC;AAkB7B,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,8BAAa,CAAA;IACb,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,OAAO,YAAa,SAAQ,WAAW;IAgB3C,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lit/no-template-arrow */\n\n/* TODO: remove eslint disable on no-template-arrow */\nimport {\n TemplateResult, html, nothing,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport styles from './calendar.styles.js';\nimport { Cre8Element } from '../../cre8-element';\n\nimport '../../icon/icon';\nimport '../calendar-month-modal/calendar-month-modal';\nimport '../calendar-year-modal/calendar-year-modal';\nimport '../calendar-navigation/calendar-navigation';\nimport '../../button/button';\n\nexport interface DateConfig {\n locale: string;\n today: Date;\n weekInfo: {\n firstDay: number;\n weekend: Array<number>;\n };\n}\n\nexport interface DateFormatOptions {\n weekday: string;\n year: string;\n month: string;\n day: string;\n}\n\nexport enum CalendarModal {\n Month = 'month',\n Year = 'year',\n None = 'none',\n}\n\nexport class Cre8Calendar extends Cre8Element {\n static styles = [styles];\n\n\n /**\n * Query the navigation wrapper\n */\n @query('.cre8-c-calendar__navigation-wrapper')\n _navWrapper: HTMLElement;\n\n @property({ type: Boolean, reflect: true })\n hasShortcuts?: boolean;\n\n @state() _activeModal?: CalendarModal = CalendarModal.None;\n\n @property({ reflect: true, type: String })\n get activeModal() {\n return this._activeModal;\n }\n\n set activeModal(activeModal: CalendarModal) {\n this._activeModal = activeModal;\n }\n\n @state() _fieldDate?: string;\n\n @property({ reflect: true, type: Date })\n get fieldDate() {\n return this._fieldDate;\n }\n\n set fieldDate(newFieldDate: string) {\n const oldDate = this._fieldDate;\n this.requestUpdate('fieldDate', oldDate);\n const isNewDateValid = !!(\n newFieldDate && new Date(`${newFieldDate}T00:00`).getTime()\n );\n this.currentDate = isNewDateValid\n ? new Date(`${newFieldDate}T00:00`)\n : new Date();\n this._fieldDate = isNewDateValid ? newFieldDate : '';\n }\n\n @state() _currentDate?: Date;\n\n @property({ reflect: true, type: Date })\n get currentDate() {\n return this._currentDate;\n }\n\n set currentDate(newDate: Date) {\n const oldDate = this._currentDate;\n this._currentDate = newDate;\n this.requestUpdate('currentDate', oldDate);\n }\n\n @state() locale: string;\n\n @state() weekDays: Array<string>;\n\n @state() dateConfig: DateConfig;\n\n @state() dateFormatOptions: DateFormatOptions;\n\n constructor() {\n super();\n this._handleOnClickOutside = this._handleOnClickOutside.bind(this);\n this.currentDate = (this.fieldDate && new Date(`${this.fieldDate}T00:00`)) ?? new Date();\n\n this.locale = document.documentElement.getAttribute('lang') || 'en-US';\n this.dateConfig = {\n locale: this.locale,\n today: new Date(),\n weekInfo: {\n firstDay: 7,\n weekend: [6, 7],\n },\n };\n this.weekDays = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ];\n this.dateFormatOptions = {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('click', this._handleOnClickOutside, false);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener('click', this._handleOnClickOutside, false);\n }\n\n /* Click Event Functions */\n private _handleOnClickOutside(event: MouseEvent) {\n if (!this.shadowRoot?.host) {\n throw Error(\n 'Could not determine navigation context during click handler'\n );\n }\n\n const didClickInside = event.composedPath().includes(this.shadowRoot.host);\n\n if (!didClickInside) {\n const outsideClickEvent = new CustomEvent('outsideClick', {\n detail: {\n composedPath: event.composedPath(),\n },\n });\n this.dispatchEvent(outsideClickEvent);\n }\n }\n\n private emitSelectedDate(date: string) {\n const event = new CustomEvent('dateSelect', {\n detail: {\n date,\n },\n });\n this.currentDate = new Date(`${date}T00:00`);\n this.dispatchEvent(event);\n }\n\n private changeYear(year: number) {\n const oldDate = this.currentDate;\n const newDate = new Date(oldDate.setFullYear(year));\n this.currentDate = newDate;\n this.activeModal = CalendarModal.None;\n }\n\n private changeMonth(month: number) {\n const oldDate = this.currentDate;\n const newDate = new Date(oldDate.setMonth(month));\n this.currentDate = newDate;\n this.activeModal = CalendarModal.None;\n }\n\n private activateModal(modal: CalendarModal): void {\n this.activeModal = modal;\n }\n\n /* Helper/Get Functions */\n static formatMonthOrDayIndex(val: number): string {\n return (val + 1).toString().padStart(2, '0');\n }\n\n static formatDate(val: number): string {\n return val.toString().padStart(2, '0');\n }\n\n private numberOfDaysinMonth(): number {\n return new Date(this.getYear(), this.getMonth() + 1, 0).getDate();\n }\n\n private getMonth(): number {\n return this.currentDate.getMonth();\n }\n\n private getMonthName(): string {\n const monthName = new Intl.DateTimeFormat(this.locale, {\n month: 'long',\n }).format(this.currentDate);\n return monthName;\n }\n\n private getYear(): number {\n return this.currentDate.getFullYear();\n }\n\n static dateToString(date: Date): string {\n return `${date.getFullYear()}-${Cre8Calendar.formatMonthOrDayIndex(\n date.getMonth()\n )}-${Cre8Calendar.formatDate(date.getDate())}`;\n }\n\n private async updateFocusForKeydown(newDate: Date): Promise<void> {\n this.currentDate = newDate;\n await this.updateComplete;\n\n const newFocus = this.shadowRoot?.querySelector<HTMLButtonElement>(\n `button[datetime=\"${Cre8Calendar.dateToString(newDate)}\"]`\n );\n newFocus.setAttribute('tabindex', '0');\n newFocus.focus();\n }\n\n private _handleCalendarKeyDown(e: KeyboardEvent) {\n const oldFocus = this.shadowRoot?.querySelector<HTMLButtonElement>(\n `button[datetime=\"${Cre8Calendar.dateToString(this.currentDate)}\"]`\n );\n if (e.key === 'ArrowUp') {\n const newDate = new Date(\n this.getYear(),\n this.getMonth(),\n this.currentDate.getDate() - 7\n );\n this.updateFocusForKeydown(newDate);\n oldFocus.setAttribute('tabindex', '-1');\n }\n if (e.key === 'ArrowDown') {\n const newDate = new Date(\n this.getYear(),\n this.getMonth(),\n this.currentDate.getDate() + 7\n );\n this.updateFocusForKeydown(newDate);\n oldFocus.setAttribute('tabindex', '-1');\n }\n if (e.key === 'ArrowLeft') {\n const newDate = new Date(\n this.getYear(),\n this.getMonth(),\n this.currentDate.getDate() - 1\n );\n this.updateFocusForKeydown(newDate);\n oldFocus.setAttribute('tabindex', '-1');\n }\n if (e.key === 'ArrowRight') {\n const newDate = new Date(\n this.getYear(),\n this.getMonth(),\n this.currentDate.getDate() + 1\n );\n this.updateFocusForKeydown(newDate);\n oldFocus.setAttribute('tabindex', '-1');\n }\n if (e.key === 'Tab' && !e.shiftKey) {\n const outsideClickEvent = new CustomEvent('outsideClick', {\n detail: {\n composedPath: [],\n },\n });\n // This allows the tab off to happen before the calendar closes\n setTimeout(() => { this.dispatchEvent(outsideClickEvent); }, 20);\n }\n }\n\n private async changeMonthFromNav(month: number): Promise<void> {\n this.changeMonth(month);\n await this.updateComplete;\n\n const nav = this.shadowRoot?.querySelector(\n 'cre8-calendar-navigation'\n );\n const monthPickerButton = nav.shadowRoot?.querySelector(\n '.cre8-c-calendar-navigation__month-modal-button'\n );\n await this.updateComplete;\n\n const button = monthPickerButton.shadowRoot.querySelector<HTMLButtonElement>('button');\n button.focus();\n }\n\n private async changeYearFromNav(year: number) {\n this.changeYear(year);\n await this.updateComplete;\n\n const nav = this.shadowRoot?.querySelector(\n 'cre8-calendar-navigation'\n );\n const yearPickerButton = nav.shadowRoot?.querySelector(\n '.cre8-c-calendar-navigation__year-modal-button'\n );\n await this.updateComplete;\n\n const button = yearPickerButton.shadowRoot.querySelector<HTMLButtonElement>('button');\n button.focus();\n }\n\n /* Template Map Functions */\n private getDaysOfWeekAbbreviations(): TemplateResult[] {\n return this.weekDays.map(\n (day) => html` <td>\n <span aria-label=\"${day}\">${day[0]}</span>\n </td>`\n );\n }\n\n /**\n * Create array of Day Buttons to fill in excess calendar space at the beginning of the month.\n *\n * 1. Map from empty array of length equal to the amount of access calendar \"slots\" in the beginning of the month.\n * (i.e. if the month starts on Wednesday (getDay = 3), there are 3 days prior that week from last month.)\n *\n * 2. Based on the indice of array, get the given day button's date, where the date is\n * the last day of last month minus the max of the array plus the indice plus one -> x = lastday - (max - (i + 1))\n * (Note: (max - (i + 1) equals the keys of the array in reverse order:\n * [max - i + 1] -> [3-1, 3-2, 3-3] -> [2,1,0] for an array of [3])\n * (i.e. if the calendar is starting on Wednesday June 1st, the access days on the calendar will be\n * Sunday May 29th (31 - (2)), Monday May 30th (31 - (1)), Tuesday May 31st (31 - (0)))\n *\n * 3. Build out day button with necessary props\n * */\n private getPreviousMonthDayButtons(): TemplateResult[] {\n /* 1 */\n return [\n ...Array(new Date(this.getYear(), this.getMonth(), 1).getDay()).keys(),\n ].map((i) => {\n const priorMonthArrayLength = new Date(\n this.getYear(),\n this.getMonth(),\n 1\n ).getDay();\n\n const finalDayLastMonth = new Date(this.getYear(), this.getMonth(), 0);\n const numberOfDaysinLastMonth = finalDayLastMonth.getDate();\n\n /* 2 */\n const priorMonthDay = new Date(\n finalDayLastMonth.getFullYear(),\n finalDayLastMonth.getMonth(),\n numberOfDaysinLastMonth - priorMonthArrayLength + (i + 1)\n );\n\n const isToday = this.dateConfig.today.getDate() === priorMonthDay.getDate()\n && this.dateConfig.today.getMonth() === priorMonthDay.getMonth()\n && this.dateConfig.today.getFullYear() === priorMonthDay.getFullYear();\n\n const isSelected = new Date(`${this.fieldDate}T00:00`).getTime()\n === priorMonthDay.getTime();\n\n /* 3 */\n return html` <td>\n <button\n class=\"cre8-c-calendar__day-button cre8-c-calendar__different-month\"\n datetime=\"${Cre8Calendar.dateToString(priorMonthDay)}\"\n ?data-today=\"${isToday}\"\n ?data-selected=\"${isSelected}\"\n tabindex=\"-1\"\n aria-label=\"${new Intl.DateTimeFormat(this.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(\n new Date(`${Cre8Calendar.dateToString(priorMonthDay)}T00:00`)\n )}\"\n @click=\"${() => this.emitSelectedDate(Cre8Calendar.dateToString(priorMonthDay))}\"\n >\n ${new Intl.NumberFormat(this.locale).format(priorMonthDay.getDate())}\n </button>\n </td>`;\n });\n }\n\n /**\n * Create array of Day Buttons to fill out current month\n *\n * 1. Map from empty array of length equal to the amount days in this month\n *\n * 2. Get the date of the current month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)\n *\n * 3. Build out day button with necessary props\n * */\n private getCurrentMonthDayButtons(): TemplateResult[] {\n /* 1 */\n return [...Array(this.numberOfDaysinMonth()).keys()].map((i) => {\n const dayOfTheMonth = i + 1;\n /* 2 */\n const current = new Date(this.getYear(), this.getMonth(), dayOfTheMonth);\n\n const isToday = this.dateConfig.today.getDate() === dayOfTheMonth\n && this.dateConfig.today.getMonth() === this.getMonth()\n && this.dateConfig.today.getFullYear() === this.getYear();\n\n const isSelected = new Date(`${this.fieldDate}T00:00`).getTime() === current.getTime();\n\n /* 3 */\n return html` <td>\n <button\n class=\"cre8-c-calendar__day-button\"\n datetime=\"${Cre8Calendar.dateToString(current)}\"\n ?data-today=\"${isToday}\"\n ?data-selected=\"${isSelected}\"\n tabindex=\"${dayOfTheMonth === this.currentDate.getDate()\n ? '0'\n : '-1'}\"\n aria-label=\"${new Intl.DateTimeFormat(this.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(new Date(`${Cre8Calendar.dateToString(current)}T00:00`))}\"\n @click=\"${() => this.emitSelectedDate(Cre8Calendar.dateToString(current))}\"\n >\n ${new Intl.NumberFormat(this.locale).format(i + 1)}\n </button>\n </td>`;\n });\n }\n\n /**\n * Create array of Day Buttons to fill in excess calendar space at the end of the month.\n *\n * 1. Map from empty array of length equal to the amount of access calendar \"slots\" at the end of the month.\n * The array have an amount of slots equal to the number of days in a week minus how many days have already past\n * and since getDay returns the index of the day of the week (Sunday = 0, Monday = 1 ...) our equations is\n * x = 7 - (getDay() + 1)\n * Note: (we need to add 1 because indexing starts at 0)\n * so if the month ends on Monday (getDay() = 1), 5 = 7 - (1 + 1), there are 5 days that week from the new month\n *\n * 2. Get the date from the next month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)\n *\n * 3. Build out day button with necessary props\n * */\n private getNextMonthDayButtons(): TemplateResult[] {\n /* 1 */\n return [\n ...Array(\n 6\n - new Date(\n this.getYear(),\n this.getMonth(),\n this.numberOfDaysinMonth()\n ).getDay()\n ).keys(),\n ].map((i) => {\n const lastDayThisMonth = new Date(\n this.getYear(),\n this.getMonth(),\n this.numberOfDaysinMonth()\n );\n const firstDayNextMonth = new Date(\n lastDayThisMonth.setDate(lastDayThisMonth.getDate() + 1)\n );\n\n /* 2 */\n const nextMonthDay = new Date(\n firstDayNextMonth.getFullYear(),\n firstDayNextMonth.getMonth(),\n i + 1\n );\n\n const isToday = this.dateConfig.today.getDate() === nextMonthDay.getDate()\n && this.dateConfig.today.getMonth() === nextMonthDay.getMonth()\n && this.dateConfig.today.getFullYear() === nextMonthDay.getFullYear();\n\n const isSelected = new Date(`${this.fieldDate}T00:00`).getTime()\n === nextMonthDay.getTime();\n\n /* 3 */\n return html` <td>\n <button\n class=\"cre8-c-calendar__day-button cre8-c-calendar__different-month\"\n datetime=\"${Cre8Calendar.dateToString(nextMonthDay)}\"\n ?data-today=\"${isToday}\"\n ?data-selected=\"${isSelected}\"\n tabindex=\"-1\"\n aria-label=\"${new Intl.DateTimeFormat(this.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(\n new Date(`${Cre8Calendar.dateToString(nextMonthDay)}T00:00`)\n )}\"\n @click=\"${() => this.emitSelectedDate(Cre8Calendar.dateToString(nextMonthDay))}\"\n >\n ${new Intl.NumberFormat(this.locale).format(nextMonthDay.getDate())}\n </button>\n </td>`;\n });\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-calendar', {});\n\n return html` <div class=\"${componentClassNames}\">\n ${this._activeModal === CalendarModal.Month\n ? html`<cre8-calendar-month-modal\n currentMonth=\"${this.getMonth()}\"\n @changeMonth=\"${(e: CustomEvent) => this.changeMonthFromNav(e.detail.month)}\"\n ></cre8-calendar-month-modal>`\n : nothing}\n ${this._activeModal === CalendarModal.Year\n ? html`<cre8-calendar-year-modal\n currentYear=\"${this.getYear()}\"\n @changeYear=\"${(e: CustomEvent) => this.changeYearFromNav(e.detail.year)}\"\n ></cre8-calendar-year-modal>`\n : nothing}\n ${this._activeModal === CalendarModal.None\n ? html` ${this.hasShortcuts\n ? html`<div class=\"cre8-c-calendar__header-shortcuts\">\n <cre8-button\n text=\"Today\"\n variant=\"secondary\"\n size=\"sm\"\n @click=\"${() => this.emitSelectedDate(\n Cre8Calendar.dateToString(this.dateConfig.today)\n )}\"\n ></cre8-button>\n <cre8-button\n text=\"Tomorrow\"\n variant=\"secondary\"\n size=\"sm\"\n @click=\"${() => this.emitSelectedDate(\n Cre8Calendar.dateToString(\n new Date(\n this.dateConfig.today.setDate(\n this.dateConfig.today.getDate() + 1\n )\n )\n )\n )}\"\n ></cre8-button>\n <cre8-button\n text=\"In 2 days\"\n variant=\"secondary\"\n size=\"sm\"\n @click=\"${() => this.emitSelectedDate(\n Cre8Calendar.dateToString(\n new Date(\n this.dateConfig.today.setDate(\n this.dateConfig.today.getDate() + 2\n )\n )\n )\n )}\"\n ></cre8-button>\n </div>`\n : nothing}\n <cre8-calendar-navigation\n monthName=\"${this.getMonthName()}\"\n year=\"${this.getYear()}\"\n @activateModal=\"${(e: CustomEvent) => this.activateModal(e.detail.modal)}\"\n @changeMonth=\"${(e: CustomEvent) => this.changeMonth(this.getMonth() + e.detail.addend)}\"\n @changeYear=\"${(e: CustomEvent) => this.changeYear(this.getYear() + e.detail.addend)}\"\n >\n </cre8-calendar-navigation>\n <table>\n <thead>\n <tr>\n ${this.getDaysOfWeekAbbreviations()}\n </tr>\n </thead>\n <tbody>\n <tr @keydown=${this._handleCalendarKeyDown}>\n ${this.getPreviousMonthDayButtons()}\n ${this.getCurrentMonthDayButtons()}\n ${this.getNextMonthDayButtons()}\n </tr>\n </tbody>\n </table>`\n : nothing}\n </div>`;\n }\n}\n\nif (customElements.get('cre8-calendar') === undefined) {\n customElements.define('cre8-calendar', Cre8Calendar);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-calendar': Cre8Calendar;\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const styles = css `*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-calendar{min-width:340px;border:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default);margin-top:0.25rem;background-color:var(--cre8-color-bg-default);position:absolute}.cre8-c-calendar__header-shortcuts{display:inline-flex;justify-content:center;width:100%;padding-top:1rem;padding-bottom:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button+cre8-button{padding-left:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button{max-height:32px}table{width:100%}tr{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);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(7, 1fr);list-style:none;margin:unset;padding:unset;position:relative}td{align-items:center;display:flex;height:48px;justify-content:center;width:48px}.cre8-c-calendar :is(thead,tbody) :is(span,button){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);align-items:center;block-size:2em;border-radius:var(--cre8-border-radius-brand);display:flex;inline-size:2em;justify-content:center;margin-block:var(0, 0 0.33em);user-select:none}.cre8-c-calendar__day-button{border:none;background:none;margin:0;padding:0}.cre8-c-calendar__day-button:hover,.cre8-c-calendar__day-button:focus{background:var(--cre8-color-bg-default-hover)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month{color:var(--cre8-color-content-subtle)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month:hover,.cre8-c-calendar__day-button.cre8-c-calendar__different-month:focus{background:var(--cre8-color-bg-subtle)}.cre8-c-calendar__day-button[data-today]{color:var(--cre8-color-content-brand);border-color:var(--cre8-color-border-brand);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default)}.cre8-c-calendar__day-button[data-selected]{background:var(--cre8-color-bg-brand-strong);color:var(--cre8-color-content-knockout)}.cre8-c-calendar__day-button[data-selected]:hover,.cre8-c-calendar__day-button[data-selected]:focus{background:var(--cre8-color-bg-brand-strong-hover)}`;
|
|
3
|
+
export default styles;
|
|
4
|
+
//# sourceMappingURL=calendar.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.styles.js","sourceRoot":"","sources":["../../../../components/date-picker/calendar/calendar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA,o7IAAo7I,CAAC;AACv8I,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}.cre8-c-calendar{min-width:340px;border:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default);margin-top:0.25rem;background-color:var(--cre8-color-bg-default);position:absolute}.cre8-c-calendar__header-shortcuts{display:inline-flex;justify-content:center;width:100%;padding-top:1rem;padding-bottom:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button+cre8-button{padding-left:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button{max-height:32px}table{width:100%}tr{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);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(7, 1fr);list-style:none;margin:unset;padding:unset;position:relative}td{align-items:center;display:flex;height:48px;justify-content:center;width:48px}.cre8-c-calendar :is(thead,tbody) :is(span,button){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);align-items:center;block-size:2em;border-radius:var(--cre8-border-radius-brand);display:flex;inline-size:2em;justify-content:center;margin-block:var(0, 0 0.33em);user-select:none}.cre8-c-calendar__day-button{border:none;background:none;margin:0;padding:0}.cre8-c-calendar__day-button:hover,.cre8-c-calendar__day-button:focus{background:var(--cre8-color-bg-default-hover)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month{color:var(--cre8-color-content-subtle)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month:hover,.cre8-c-calendar__day-button.cre8-c-calendar__different-month:focus{background:var(--cre8-color-bg-subtle)}.cre8-c-calendar__day-button[data-today]{color:var(--cre8-color-content-brand);border-color:var(--cre8-color-border-brand);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default)}.cre8-c-calendar__day-button[data-selected]{background:var(--cre8-color-bg-brand-strong);color:var(--cre8-color-content-knockout)}.cre8-c-calendar__day-button[data-selected]:hover,.cre8-c-calendar__day-button[data-selected]:focus{background:var(--cre8-color-bg-brand-strong-hover)}`;\nexport default styles;\n"]}
|