@tmorrow/cre8-wc 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cre8-wc.esm.js +1 -1
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1 -1
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.js +129 -0
- package/lib/cdn-entry.js.map +1 -0
- package/lib/components/accordion/accordion.js +58 -40
- package/lib/components/accordion/accordion.js.map +1 -0
- package/lib/components/accordion/accordion.styles.js +4 -0
- package/lib/components/accordion/accordion.styles.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.js +187 -98
- package/lib/components/accordion-item/accordion-item.js.map +1 -0
- package/lib/components/accordion-item/accordion-item.styles.js +4 -0
- package/lib/components/accordion-item/accordion-item.styles.js.map +1 -0
- package/lib/components/alert/alert.js +146 -107
- package/lib/components/alert/alert.js.map +1 -0
- package/lib/components/alert/alert.styles.js +4 -0
- package/lib/components/alert/alert.styles.js.map +1 -0
- package/lib/components/badge/badge.js +73 -50
- package/lib/components/badge/badge.js.map +1 -0
- package/lib/components/badge/badge.styles.js +4 -0
- package/lib/components/badge/badge.styles.js.map +1 -0
- package/lib/components/band/band.js +34 -31
- package/lib/components/band/band.js.map +1 -0
- package/lib/components/band/band.styles.js +4 -0
- package/lib/components/band/band.styles.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +52 -28
- package/lib/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js +4 -0
- package/lib/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +28 -27
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js.map +1 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js +4 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.js.map +1 -0
- package/lib/components/button/button.js +297 -1040
- package/lib/components/button/button.js.map +1 -0
- package/lib/components/button/button.styles.js +885 -0
- package/lib/components/button/button.styles.js.map +1 -0
- package/lib/components/button-group/button-group.js +30 -27
- package/lib/components/button-group/button-group.js.map +1 -0
- package/lib/components/button-group/button-group.styles.js +4 -0
- package/lib/components/button-group/button-group.styles.js.map +1 -0
- package/lib/components/card/card.js +57 -35
- package/lib/components/card/card.js.map +1 -0
- package/lib/components/card/card.styles.js +4 -0
- package/lib/components/card/card.styles.js.map +1 -0
- package/lib/components/chart/chart.js +528 -354
- package/lib/components/chart/chart.js.map +1 -0
- package/lib/components/chart/chart.styles.js +4 -0
- package/lib/components/chart/chart.styles.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.js +66 -53
- package/lib/components/checkbox-field/checkbox-field.js.map +1 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js +4 -0
- package/lib/components/checkbox-field/checkbox-field.styles.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.js +252 -183
- package/lib/components/checkbox-field-item/checkbox-field-item.js.map +1 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js +4 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.js.map +1 -0
- package/lib/components/contexts/form-internals-context.js +9 -0
- package/lib/components/contexts/form-internals-context.js.map +1 -0
- package/lib/components/cre8-element.js +57 -56
- package/lib/components/cre8-element.js.map +1 -0
- package/lib/components/cre8-form-element.js +212 -244
- package/lib/components/cre8-form-element.js.map +1 -0
- package/lib/components/danger-button/danger-button.js +274 -147
- package/lib/components/danger-button/danger-button.js.map +1 -0
- package/lib/components/danger-button/danger-button.styles.js +4 -0
- package/lib/components/danger-button/danger-button.styles.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.js +465 -0
- package/lib/components/date-picker/calendar/calendar.js.map +1 -0
- package/lib/components/date-picker/calendar/calendar.styles.js +4 -0
- package/lib/components/date-picker/calendar/calendar.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js +76 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js +110 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.js.map +1 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js +4 -0
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js +116 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.js.map +1 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js +4 -0
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.js.map +1 -0
- package/lib/components/date-picker/date-picker.js +91 -784
- package/lib/components/date-picker/date-picker.js.map +1 -0
- package/lib/components/date-picker/date-picker.styles.js +4 -0
- package/lib/components/date-picker/date-picker.styles.js.map +1 -0
- package/lib/components/divider/divider.js +45 -35
- package/lib/components/divider/divider.js.map +1 -0
- package/lib/components/divider/divider.styles.js +4 -0
- package/lib/components/divider/divider.styles.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +97 -63
- package/lib/components/dropdown/dropdown.js.map +1 -0
- package/lib/components/dropdown/dropdown.styles.js +4 -0
- package/lib/components/dropdown/dropdown.styles.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.js +38 -31
- package/lib/components/dropdown-item/dropdown-item.js.map +1 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js +4 -0
- package/lib/components/dropdown-item/dropdown-item.styles.js.map +1 -0
- package/lib/components/feature/feature.js +40 -35
- package/lib/components/feature/feature.js.map +1 -0
- package/lib/components/feature/feature.styles.js +4 -0
- package/lib/components/feature/feature.styles.js.map +1 -0
- package/lib/components/field/field.js +218 -153
- package/lib/components/field/field.js.map +1 -0
- package/lib/components/field/field.styles.js +4 -0
- package/lib/components/field/field.styles.js.map +1 -0
- package/lib/components/field-note/field-note.js +58 -45
- package/lib/components/field-note/field-note.js.map +1 -0
- package/lib/components/field-note/field-note.styles.js +4 -0
- package/lib/components/field-note/field-note.styles.js.map +1 -0
- package/lib/components/footer/footer.js +25 -18
- package/lib/components/footer/footer.js.map +1 -0
- package/lib/components/footer/footer.styles.js +4 -0
- package/lib/components/footer/footer.styles.js.map +1 -0
- package/lib/components/global-nav/global-nav.js +44 -37
- package/lib/components/global-nav/global-nav.js.map +1 -0
- package/lib/components/global-nav/global-nav.styles.js +4 -0
- package/lib/components/global-nav/global-nav.styles.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.js +149 -112
- package/lib/components/global-nav-item/global-nav-item.js.map +1 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js +4 -0
- package/lib/components/global-nav-item/global-nav-item.styles.js.map +1 -0
- package/lib/components/grid/grid.js +48 -45
- package/lib/components/grid/grid.js.map +1 -0
- package/lib/components/grid/grid.styles.js +4 -0
- package/lib/components/grid/grid.styles.js.map +1 -0
- package/lib/components/grid-item/grid-item.js +19 -16
- package/lib/components/grid-item/grid-item.js.map +1 -0
- package/lib/components/grid-item/grid-item.styles.js +4 -0
- package/lib/components/grid-item/grid-item.styles.js.map +1 -0
- package/lib/components/header/header.js +34 -29
- package/lib/components/header/header.js.map +1 -0
- package/lib/components/header/header.styles.js +4 -0
- package/lib/components/header/header.styles.js.map +1 -0
- package/lib/components/heading/heading.js +113 -76
- package/lib/components/heading/heading.js.map +1 -0
- package/lib/components/heading/heading.styles.js +4 -0
- package/lib/components/heading/heading.styles.js.map +1 -0
- package/lib/components/hero/hero.js +43 -40
- package/lib/components/hero/hero.js.map +1 -0
- package/lib/components/hero/hero.styles.js +4 -0
- package/lib/components/hero/hero.styles.js.map +1 -0
- package/lib/components/icon/icon.js +232 -9
- package/lib/components/icon/icon.js.map +1 -0
- package/lib/components/icon/icon.styles.js +4 -0
- package/lib/components/icon/icon.styles.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.js +114 -87
- package/lib/components/inline-alert/inline-alert.js.map +1 -0
- package/lib/components/inline-alert/inline-alert.styles.js +4 -0
- package/lib/components/inline-alert/inline-alert.styles.js.map +1 -0
- package/lib/components/layout/layout.js +30 -27
- package/lib/components/layout/layout.js.map +1 -0
- package/lib/components/layout/layout.styles.js +4 -0
- package/lib/components/layout/layout.styles.js.map +1 -0
- package/lib/components/layout-container/layout-container.js +30 -27
- package/lib/components/layout-container/layout-container.js.map +1 -0
- package/lib/components/layout-container/layout-container.styles.js +4 -0
- package/lib/components/layout-container/layout-container.styles.js.map +1 -0
- package/lib/components/layout-section/layout-section.js +41 -33
- package/lib/components/layout-section/layout-section.js.map +1 -0
- package/lib/components/layout-section/layout-section.styles.js +4 -0
- package/lib/components/layout-section/layout-section.styles.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.js +19 -16
- package/lib/components/linelength-container/linelength-container.js.map +1 -0
- package/lib/components/linelength-container/linelength-container.styles.js +4 -0
- package/lib/components/linelength-container/linelength-container.styles.js.map +1 -0
- package/lib/components/link/link.js +125 -87
- package/lib/components/link/link.js.map +1 -0
- package/lib/components/link/link.styles.js +4 -0
- package/lib/components/link/link.styles.js.map +1 -0
- package/lib/components/link-list/link-list.js +48 -45
- package/lib/components/link-list/link-list.js.map +1 -0
- package/lib/components/link-list/link-list.styles.js +4 -0
- package/lib/components/link-list/link-list.styles.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.js +40 -37
- package/lib/components/link-list-item/link-list-item.js.map +1 -0
- package/lib/components/link-list-item/link-list-item.styles.js +4 -0
- package/lib/components/link-list-item/link-list-item.styles.js.map +1 -0
- package/lib/components/list/list.js +35 -32
- package/lib/components/list/list.js.map +1 -0
- package/lib/components/list/list.styles.js +4 -0
- package/lib/components/list/list.styles.js.map +1 -0
- package/lib/components/list-item/list-item.js +25 -21
- package/lib/components/list-item/list-item.js.map +1 -0
- package/lib/components/list-item/list-item.styles.js +4 -0
- package/lib/components/list-item/list-item.styles.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.js +126 -71
- package/lib/components/loading-spinner/loading-spinner.js.map +1 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js +4 -0
- package/lib/components/loading-spinner/loading-spinner.styles.js.map +1 -0
- package/lib/components/logo/logo.js +28 -25
- package/lib/components/logo/logo.js.map +1 -0
- package/lib/components/logo/logo.styles.js +4 -0
- package/lib/components/logo/logo.styles.js.map +1 -0
- package/lib/components/main/main.js +29 -26
- package/lib/components/main/main.js.map +1 -0
- package/lib/components/main/main.styles.js +4 -0
- package/lib/components/main/main.styles.js.map +1 -0
- package/lib/components/modal/modal.js +174 -125
- package/lib/components/modal/modal.js.map +1 -0
- package/lib/components/modal/modal.styles.js +4 -0
- package/lib/components/modal/modal.styles.js.map +1 -0
- package/lib/components/multi-select/multi-select.js +300 -211
- package/lib/components/multi-select/multi-select.js.map +1 -0
- package/lib/components/multi-select/multi-select.styles.js +4 -0
- package/lib/components/multi-select/multi-select.styles.js.map +1 -0
- package/lib/components/nav-container/nav-container.js +19 -16
- package/lib/components/nav-container/nav-container.js.map +1 -0
- package/lib/components/nav-container/nav-container.styles.js +4 -0
- package/lib/components/nav-container/nav-container.styles.js.map +1 -0
- package/lib/components/page-header/page-header.js +36 -29
- package/lib/components/page-header/page-header.js.map +1 -0
- package/lib/components/page-header/page-header.styles.js +4 -0
- package/lib/components/page-header/page-header.styles.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.js +67 -0
- package/lib/components/pagination/page-counter/page-counter.js.map +1 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js +4 -0
- package/lib/components/pagination/page-counter/page-counter.styles.js.map +1 -0
- package/lib/components/pagination/pagination.js +282 -237
- package/lib/components/pagination/pagination.js.map +1 -0
- package/lib/components/pagination/pagination.styles.js +4 -0
- package/lib/components/pagination/pagination.styles.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.js +56 -48
- package/lib/components/percent-bar/percent-bar.js.map +1 -0
- package/lib/components/percent-bar/percent-bar.styles.js +4 -0
- package/lib/components/percent-bar/percent-bar.styles.js.map +1 -0
- package/lib/components/popover/popover.js +304 -179
- package/lib/components/popover/popover.js.map +1 -0
- package/lib/components/popover/popover.styles.js +4 -0
- package/lib/components/popover/popover.styles.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.js +44 -37
- package/lib/components/primary-nav/primary-nav.js.map +1 -0
- package/lib/components/primary-nav/primary-nav.styles.js +4 -0
- package/lib/components/primary-nav/primary-nav.styles.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.js +151 -113
- package/lib/components/primary-nav-item/primary-nav-item.js.map +1 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js +4 -0
- package/lib/components/primary-nav-item/primary-nav-item.styles.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.js +74 -57
- package/lib/components/progress-meter/progress-meter.js.map +1 -0
- package/lib/components/progress-meter/progress-meter.styles.js +4 -0
- package/lib/components/progress-meter/progress-meter.styles.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.js +19 -0
- package/lib/components/progress-steps/progress-steps.js.map +1 -0
- package/lib/components/progress-steps/progress-steps.styles.js +4 -0
- package/lib/components/progress-steps/progress-steps.styles.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.js +52 -40
- package/lib/components/progress-steps-item/progress-steps-item.js.map +1 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js +4 -0
- package/lib/components/progress-steps-item/progress-steps-item.styles.js.map +1 -0
- package/lib/components/radio-field/radio-field.js +59 -49
- package/lib/components/radio-field/radio-field.js.map +1 -0
- package/lib/components/radio-field/radio-field.styles.js +4 -0
- package/lib/components/radio-field/radio-field.styles.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.js +222 -179
- package/lib/components/radio-field-item/radio-field-item.js.map +1 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js +4 -0
- package/lib/components/radio-field-item/radio-field-item.styles.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.js +89 -60
- package/lib/components/remove-tag/remove-tag.js.map +1 -0
- package/lib/components/remove-tag/remove-tag.styles.js +4 -0
- package/lib/components/remove-tag/remove-tag.styles.js.map +1 -0
- package/lib/components/section/section.js +46 -27
- package/lib/components/section/section.js.map +1 -0
- package/lib/components/section/section.styles.js +4 -0
- package/lib/components/section/section.styles.js.map +1 -0
- package/lib/components/select/select.js +243 -158
- package/lib/components/select/select.js.map +1 -0
- package/lib/components/select/select.styles.js +4 -0
- package/lib/components/select/select.styles.js.map +1 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js +60 -0
- package/lib/components/select-tile/select-tile-checkbox-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile-radio-controller.js +167 -0
- package/lib/components/select-tile/select-tile-radio-controller.js.map +1 -0
- package/lib/components/select-tile/select-tile.js +228 -223
- package/lib/components/select-tile/select-tile.js.map +1 -0
- package/lib/components/select-tile/select-tile.styles.js +4 -0
- package/lib/components/select-tile/select-tile.styles.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.js +76 -62
- package/lib/components/select-tile-list/select-tile-list.js.map +1 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js +4 -0
- package/lib/components/select-tile-list/select-tile-list.styles.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.js +68 -39
- package/lib/components/skeleton-loader/skeleton-loader.js.map +1 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js +4 -0
- package/lib/components/skeleton-loader/skeleton-loader.styles.js.map +1 -0
- package/lib/components/split-button/split-button.js +51 -46
- package/lib/components/split-button/split-button.js.map +1 -0
- package/lib/components/split-button/split-button.styles.js +4 -0
- package/lib/components/split-button/split-button.styles.js.map +1 -0
- package/lib/components/submenu/submenu.js +19 -16
- package/lib/components/submenu/submenu.js.map +1 -0
- package/lib/components/submenu/submenu.styles.js +4 -0
- package/lib/components/submenu/submenu.styles.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.js +32 -26
- package/lib/components/submenu-item/submenu-item.js.map +1 -0
- package/lib/components/submenu-item/submenu-item.styles.js +4 -0
- package/lib/components/submenu-item/submenu-item.styles.js.map +1 -0
- package/lib/components/tab/tab.js +74 -63
- package/lib/components/tab/tab.js.map +1 -0
- package/lib/components/tab/tab.styles.js +4 -0
- package/lib/components/tab/tab.styles.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.js +49 -43
- package/lib/components/tab-panel/tab-panel.js.map +1 -0
- package/lib/components/tab-panel/tab-panel.styles.js +4 -0
- package/lib/components/tab-panel/tab-panel.styles.js.map +1 -0
- package/lib/components/table/table.js +46 -41
- package/lib/components/table/table.js.map +1 -0
- package/lib/components/table/table.styles.js +4 -0
- package/lib/components/table/table.styles.js.map +1 -0
- package/lib/components/table-body/table-body.js +20 -17
- package/lib/components/table-body/table-body.js.map +1 -0
- package/lib/components/table-body/table-body.styles.js +4 -0
- package/lib/components/table-body/table-body.styles.js.map +1 -0
- package/lib/components/table-cell/table-cell.js +39 -36
- package/lib/components/table-cell/table-cell.js.map +1 -0
- package/lib/components/table-cell/table-cell.styles.js +4 -0
- package/lib/components/table-cell/table-cell.styles.js.map +1 -0
- package/lib/components/table-header/table-header.js +20 -17
- package/lib/components/table-header/table-header.js.map +1 -0
- package/lib/components/table-header/table-header.styles.js +4 -0
- package/lib/components/table-header/table-header.styles.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.js +35 -32
- package/lib/components/table-header-cell/table-header-cell.js.map +1 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js +4 -0
- package/lib/components/table-header-cell/table-header-cell.styles.js.map +1 -0
- package/lib/components/table-object/table-object.js +21 -18
- package/lib/components/table-object/table-object.js.map +1 -0
- package/lib/components/table-object/table-object.styles.js +4 -0
- package/lib/components/table-object/table-object.styles.js.map +1 -0
- package/lib/components/table-row/table-row.js +76 -55
- package/lib/components/table-row/table-row.js.map +1 -0
- package/lib/components/table-row/table-row.styles.js +4 -0
- package/lib/components/table-row/table-row.styles.js.map +1 -0
- package/lib/components/tabs/tabs.js +452 -303
- package/lib/components/tabs/tabs.js.map +1 -0
- package/lib/components/tabs/tabs.styles.js +4 -0
- package/lib/components/tabs/tabs.styles.js.map +1 -0
- package/lib/components/tag/tag.js +236 -167
- package/lib/components/tag/tag.js.map +1 -0
- package/lib/components/tag/tag.styles.js +4 -0
- package/lib/components/tag/tag.styles.js.map +1 -0
- package/lib/components/tag-list/tag-list.js +40 -35
- package/lib/components/tag-list/tag-list.js.map +1 -0
- package/lib/components/tag-list/tag-list.styles.js +4 -0
- package/lib/components/tag-list/tag-list.styles.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.js +40 -33
- package/lib/components/tertiary-nav/tertiary-nav.js.map +1 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js +4 -0
- package/lib/components/tertiary-nav/tertiary-nav.styles.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +52 -43
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js.map +1 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js +4 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.js.map +1 -0
- package/lib/components/text-link/text-link.js +45 -41
- package/lib/components/text-link/text-link.js.map +1 -0
- package/lib/components/text-link/text-link.styles.js +4 -0
- package/lib/components/text-link/text-link.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.js +145 -0
- package/lib/components/text-passage/text-passage-light-dom.js.map +1 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js +4 -0
- package/lib/components/text-passage/text-passage-light-dom.styles.js.map +1 -0
- package/lib/components/text-passage/text-passage.js +72 -44
- package/lib/components/text-passage/text-passage.js.map +1 -0
- package/lib/components/text-passage/text-passage.styles.js +4 -0
- package/lib/components/text-passage/text-passage.styles.js.map +1 -0
- package/lib/components/tooltip/tooltip.js +278 -173
- package/lib/components/tooltip/tooltip.js.map +1 -0
- package/lib/components/tooltip/tooltip.styles.js +4 -0
- package/lib/components/tooltip/tooltip.styles.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.js +40 -33
- package/lib/components/utility-nav/utility-nav.js.map +1 -0
- package/lib/components/utility-nav/utility-nav.styles.js +4 -0
- package/lib/components/utility-nav/utility-nav.styles.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.js +70 -49
- package/lib/components/utility-nav-item/utility-nav-item.js.map +1 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js +4 -0
- package/lib/components/utility-nav-item/utility-nav-item.styles.js.map +1 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js +737 -0
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js +756 -0
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.js.map +1 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js +771 -0
- package/lib/design-tokens/brands/cre8/css/tokens_cre8.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js +772 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.js.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js +737 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js +983 -0
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.js.map +1 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js +737 -0
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.js.map +1 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js +736 -0
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.js.map +1 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js +737 -0
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.js.map +1 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js +771 -0
- package/lib/design-tokens/brands/prisma/tokens_prisma.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js +552 -0
- package/lib/design-tokens/brands/starbucks/tokens.module.js.map +1 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js +776 -0
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.js.map +1 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js +253 -0
- package/lib/design-tokens/brands copy/blue/css/tokens_blue.module.js.map +1 -0
- package/lib/design-tokens/core/scss/theming/head.module.js +6 -0
- package/lib/design-tokens/core/scss/theming/head.module.js.map +1 -0
- package/lib/design-tokens/tokens_netflix.theme.js +806 -0
- package/lib/design-tokens/tokens_netflix.theme.js.map +1 -0
- package/lib/directives/if-truthy.js +24 -0
- package/lib/directives/if-truthy.js.map +1 -0
- package/lib/directives/spread.js +29 -0
- package/lib/directives/spread.js.map +1 -0
- package/lib/index.js +84 -168
- package/lib/index.js.map +1 -0
- package/lib/scripts/convert-scss-to-ts.js +25 -0
- package/lib/scripts/convert-scss-to-ts.js.map +1 -0
- package/lib/scripts/extract-tokens.js +120 -0
- package/lib/scripts/extract-tokens.js.map +1 -0
- package/lib/scripts/generate-react-wrappers.js +229 -0
- package/lib/scripts/generate-react-wrappers.js.map +1 -0
- package/lib/scripts/generateWesparkleThemes.js +52 -0
- package/lib/scripts/generateWesparkleThemes.js.map +1 -0
- package/lib/toBeAccessible.js +18 -0
- package/lib/toBeAccessible.js.map +1 -0
- package/lib/utilities/is-mobile.js +10 -0
- package/lib/utilities/is-mobile.js.map +1 -0
- package/lib/utilities/story-helpers.js +14 -0
- package/lib/utilities/story-helpers.js.map +1 -0
- package/lib/vite.config.cdn.js +85 -0
- package/lib/vite.config.cdn.js.map +1 -0
- package/lib/vite.config.js +156 -0
- package/lib/vite.config.js.map +1 -0
- package/package.json +8 -9
|
@@ -1,781 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../../icon-D22g8aWB.js";
|
|
7
|
-
import "../button/button.js";
|
|
8
|
-
const I = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:block}.cre8-c-date-picker__label{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform);display:block;margin-bottom:0.5rem}.cre8-c-date-picker__body{position:relative;display:flex;align-items:center}input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}.cre8-c-date-picker__calendar-icon-button{position:absolute;right:0.5rem;background:var(--cre8-color-bg-default);border:none;border-radius:0;--cre8-icon-height: size(3);--cre8-icon-width: size(3)}.cre8-c-date-picker--disabled .cre8-c-date-picker__calendar-icon-button,.cre8-c-date-picker--read-only .cre8-c-date-picker__calendar-icon-button{background:var(--cre8-color-bg-disabled)}.cre8-c-date-picker__input{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);outline:var(--cre8-border-width-focus) solid rgba(0,0,0,0);outline-offset:0.125rem;-webkit-appearance:none;width:100%;border-width:var(--cre8-border-width-default);border-style:solid;border-color:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.75rem 0.5rem;color:var(--cre8-color-content-default);background-color:var(--cre8-color-bg-default);transition:outline-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),border-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),background-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),color var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-date-picker__input:hover:not(:disabled),.cre8-c-date-picker__input:focus:not(:disabled),.cre8-c-date-picker__input:active:not(:disabled),.cre8-c-date-picker__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:disabled{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed}.cre8-c-date-picker__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-date-picker__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-date-picker__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input{border-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:read-only{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);cursor:default}`, z = v`*,::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)}`, F = v`*,::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-month-modal{padding:0.5rem}ol{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(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}`;
|
|
9
|
-
var S = Object.defineProperty, O = (d, e, t, a) => {
|
|
10
|
-
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
11
|
-
(n = d[i]) && (r = n(e, t, r) || r);
|
|
12
|
-
return r && S(e, t, r), r;
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
6
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
async focusOnCurrentMonth() {
|
|
35
|
-
await this.updateComplete, (this.shadowRoot?.querySelector(
|
|
36
|
-
"li[data-current-month]"
|
|
37
|
-
).children[0].shadowRoot?.querySelector("button")).focus();
|
|
38
|
-
}
|
|
39
|
-
emitMonth(e) {
|
|
40
|
-
const t = new CustomEvent("changeMonth", {
|
|
41
|
-
detail: {
|
|
42
|
-
month: e
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
this.dispatchEvent(t);
|
|
46
|
-
}
|
|
47
|
-
getMonthListItems() {
|
|
48
|
-
return this.monthNames.map(
|
|
49
|
-
(e, t) => s` <li ?data-current-month="${t === this.currentMonth}" >
|
|
50
|
-
<cre8-button text="${e}" variant="tertiary" size="sm"
|
|
51
|
-
@click="${() => this.emitMonth(t)}"></cre8-button>
|
|
52
|
-
</li>`
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
const e = this.componentClassNames("cre8-c-calendar-month-modal", {});
|
|
57
|
-
return s` <div class="${e}">
|
|
58
|
-
<ol aria-label="choose a month">
|
|
59
|
-
${this.getMonthListItems()}
|
|
60
|
-
</ol>
|
|
61
|
-
</div> `;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
_.styles = [F];
|
|
65
|
-
let f = _;
|
|
66
|
-
O([
|
|
67
|
-
l()
|
|
68
|
-
], f.prototype, "monthNames");
|
|
69
|
-
O([
|
|
70
|
-
p({ reflect: !0, type: Number })
|
|
71
|
-
], f.prototype, "currentMonth");
|
|
72
|
-
customElements.get("cre8-calendar-month-modal") === void 0 && customElements.define("cre8-calendar-month-modal", f);
|
|
73
|
-
const N = v`*,::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-year-modal{display:flex;justify-content:space-around;align-items:center;padding:0.5rem}ol{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(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}cre8-button{height:fit-content}`;
|
|
74
|
-
var X = Object.defineProperty, E = Object.getOwnPropertyDescriptor, x = (d, e, t, a) => {
|
|
75
|
-
for (var r = a > 1 ? void 0 : a ? E(e, t) : e, i = d.length - 1, n; i >= 0; i--)
|
|
76
|
-
(n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
|
|
77
|
-
return a && r && X(e, t, r), r;
|
|
78
|
-
};
|
|
79
|
-
const D = class D extends w {
|
|
80
|
-
get currentYear() {
|
|
81
|
-
return this._currentYear;
|
|
82
|
-
}
|
|
83
|
-
set currentYear(e) {
|
|
84
|
-
const t = this._currentYear;
|
|
85
|
-
this._currentYear = e, this.modalAnchorYear = e, this.requestUpdate("currentDate", t), this.createYearArray(this.currentYear);
|
|
86
|
-
}
|
|
87
|
-
constructor() {
|
|
88
|
-
super(), this.yearNumbers = [];
|
|
89
|
-
}
|
|
90
|
-
emitYear(e) {
|
|
91
|
-
const t = new CustomEvent("changeYear", {
|
|
92
|
-
detail: {
|
|
93
|
-
year: e
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
this.dispatchEvent(t);
|
|
97
|
-
}
|
|
98
|
-
createYearArray(e) {
|
|
99
|
-
const t = Array.from(Array(12).keys());
|
|
100
|
-
this.yearNumbers = t.map((a) => a + (e - 7));
|
|
101
|
-
}
|
|
102
|
-
getYearListItems() {
|
|
103
|
-
return this.yearNumbers.map(
|
|
104
|
-
((e) => s` <li
|
|
105
|
-
?data-current-year="${e === this.currentYear}"
|
|
106
|
-
>
|
|
107
|
-
<cre8-button
|
|
108
|
-
text="${e}"
|
|
109
|
-
variant="tertiary"
|
|
110
|
-
size="sm"
|
|
111
|
-
@click="${() => this.emitYear(e)}"
|
|
112
|
-
></cre8-button>
|
|
113
|
-
</li>`)
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
firstUpdated() {
|
|
117
|
-
this.focusOnCurrentYear();
|
|
118
|
-
}
|
|
119
|
-
async focusOnCurrentYear() {
|
|
120
|
-
await this.updateComplete, (this.shadowRoot?.querySelector(
|
|
121
|
-
"li[data-current-year]"
|
|
122
|
-
).children[0].shadowRoot?.querySelector("button")).focus();
|
|
123
|
-
}
|
|
124
|
-
previousYearArray() {
|
|
125
|
-
this.modalAnchorYear -= 12, this.createYearArray(this.modalAnchorYear);
|
|
126
|
-
}
|
|
127
|
-
nextYearArray() {
|
|
128
|
-
this.modalAnchorYear += 12, this.createYearArray(this.modalAnchorYear);
|
|
129
|
-
}
|
|
130
|
-
render() {
|
|
131
|
-
const e = this.componentClassNames(
|
|
132
|
-
"cre8-c-calendar-year-modal",
|
|
133
|
-
{}
|
|
134
|
-
);
|
|
135
|
-
return s`
|
|
136
|
-
<div class="${e}">
|
|
137
|
-
<cre8-button
|
|
138
|
-
class="cre8-c-calendar-year-modal__nav-button"
|
|
139
|
-
@click="${this.previousYearArray}"
|
|
140
|
-
variant="tertiary"
|
|
141
|
-
text="Previous 12 years"
|
|
142
|
-
?hideText=${!0}
|
|
143
|
-
iconName="keyboard-arrow-left"
|
|
144
|
-
></cre8-button>
|
|
145
|
-
<ol aria-label="choose a year">
|
|
146
|
-
${this.getYearListItems()}
|
|
147
|
-
</ol>
|
|
148
|
-
<cre8-button
|
|
149
|
-
class="cre8-c-calendar-year-modal__nav-button"
|
|
150
|
-
@click="${this.nextYearArray}"
|
|
151
|
-
variant="tertiary"
|
|
152
|
-
text="Next 12 years"
|
|
153
|
-
?hideText=${!0}
|
|
154
|
-
iconName="keyboard-arrow-right"
|
|
155
|
-
></cre8-button>
|
|
156
|
-
</div>
|
|
157
|
-
`;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
D.styles = [N];
|
|
161
|
-
let m = D;
|
|
162
|
-
x([
|
|
163
|
-
l()
|
|
164
|
-
], m.prototype, "yearNumbers", 2);
|
|
165
|
-
x([
|
|
166
|
-
l()
|
|
167
|
-
], m.prototype, "_currentYear", 2);
|
|
168
|
-
x([
|
|
169
|
-
l()
|
|
170
|
-
], m.prototype, "modalAnchorYear", 2);
|
|
171
|
-
x([
|
|
172
|
-
p({ reflect: !0, type: Number })
|
|
173
|
-
], m.prototype, "currentYear", 1);
|
|
174
|
-
customElements.get("cre8-calendar-year-modal") === void 0 && customElements.define("cre8-calendar-year-modal", m);
|
|
175
|
-
const A = v`*,::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-navigation{align-items:center;display:flex;height:60px;justify-content:center}.cre8-c-calendar-navigation__inner-buttons{display:flex;min-width:188px;justify-content:space-around}`;
|
|
176
|
-
var q = Object.defineProperty, T = (d, e, t, a) => {
|
|
177
|
-
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
178
|
-
(n = d[i]) && (r = n(e, t, r) || r);
|
|
179
|
-
return r && q(e, t, r), r;
|
|
180
|
-
};
|
|
181
|
-
const $ = class $ extends w {
|
|
182
|
-
activateModal(e) {
|
|
183
|
-
const t = new CustomEvent("activateModal", {
|
|
184
|
-
detail: {
|
|
185
|
-
modal: e
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
this.dispatchEvent(t);
|
|
189
|
-
}
|
|
190
|
-
changeMonth(e) {
|
|
191
|
-
const t = new CustomEvent("changeMonth", {
|
|
192
|
-
detail: {
|
|
193
|
-
addend: e
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
this.dispatchEvent(t);
|
|
197
|
-
}
|
|
198
|
-
changeYear(e) {
|
|
199
|
-
const t = new CustomEvent("changeYear", {
|
|
200
|
-
detail: {
|
|
201
|
-
addend: e
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
this.dispatchEvent(t);
|
|
205
|
-
}
|
|
206
|
-
render() {
|
|
207
|
-
const e = this.componentClassNames(
|
|
208
|
-
"cre8-c-calendar-navigation",
|
|
209
|
-
{}
|
|
210
|
-
);
|
|
211
|
-
return s`
|
|
212
|
-
<div class="${e}">
|
|
213
|
-
<cre8-button
|
|
214
|
-
variant="tertiary"
|
|
215
|
-
text="Previous year"
|
|
216
|
-
?hideText=${!0}
|
|
217
|
-
iconName="caret-double-left"
|
|
218
|
-
@click="${() => this.changeYear(-1)}"
|
|
219
|
-
></cre8-button>
|
|
220
|
-
|
|
221
|
-
<cre8-button
|
|
222
|
-
variant="tertiary"
|
|
223
|
-
text="Previous month"
|
|
224
|
-
?hideText=${!0}
|
|
225
|
-
iconName="keyboard-arrow-left"
|
|
226
|
-
@click="${() => this.changeMonth(-1)}"
|
|
227
|
-
></cre8-button>
|
|
228
|
-
|
|
229
|
-
<div class="cre8-c-calendar-navigation__inner-buttons">
|
|
230
|
-
<cre8-button
|
|
231
|
-
class="cre8-c-calendar-navigation__month-modal-button"
|
|
232
|
-
variant="tertiary"
|
|
233
|
-
text="${this.monthName}"
|
|
234
|
-
aria-label="${this.monthName}, month picker modal"
|
|
235
|
-
size="sm"
|
|
236
|
-
@click="${() => this.activateModal("month")}"
|
|
237
|
-
></cre8-button>
|
|
238
|
-
|
|
239
|
-
<cre8-button
|
|
240
|
-
class="cre8-c-calendar-navigation__year-modal-button"
|
|
241
|
-
variant="tertiary"
|
|
242
|
-
text="${this.year}"
|
|
243
|
-
aria-label="${this.year}, year picker modal"
|
|
244
|
-
size="sm"
|
|
245
|
-
@click="${() => this.activateModal("year")}"
|
|
246
|
-
></cre8-button>
|
|
247
|
-
</div>
|
|
248
|
-
|
|
249
|
-
<cre8-button
|
|
250
|
-
variant="tertiary"
|
|
251
|
-
text="Next month"
|
|
252
|
-
?hideText=${!0}
|
|
253
|
-
iconName="keyboard-arrow-right"
|
|
254
|
-
@click="${() => this.changeMonth(1)}"
|
|
255
|
-
></cre8-button>
|
|
256
|
-
|
|
257
|
-
<cre8-button
|
|
258
|
-
variant="tertiary"
|
|
259
|
-
text="Next year"
|
|
260
|
-
?hideText=${!0}
|
|
261
|
-
iconName="caret-double-right"
|
|
262
|
-
@click="${() => this.changeYear(1)}"
|
|
263
|
-
></cre8-button>
|
|
264
|
-
</div>
|
|
265
|
-
`;
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
$.styles = [A];
|
|
269
|
-
let b = $;
|
|
270
|
-
T([
|
|
271
|
-
p({ type: String, reflect: !0 })
|
|
272
|
-
], b.prototype, "monthName");
|
|
273
|
-
T([
|
|
274
|
-
p({ type: String, reflect: !0 })
|
|
275
|
-
], b.prototype, "year");
|
|
276
|
-
customElements.get("cre8-calendar-navigation") === void 0 && customElements.define("cre8-calendar-navigation", b);
|
|
277
|
-
var P = Object.defineProperty, j = Object.getOwnPropertyDescriptor, h = (d, e, t, a) => {
|
|
278
|
-
for (var r = a > 1 ? void 0 : a ? j(e, t) : e, i = d.length - 1, n; i >= 0; i--)
|
|
279
|
-
(n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
|
|
280
|
-
return a && r && P(e, t, r), r;
|
|
281
|
-
}, o;
|
|
282
|
-
const c = (o = class extends w {
|
|
283
|
-
constructor() {
|
|
284
|
-
super(), this._activeModal = "none", this._handleOnClickOutside = this._handleOnClickOutside.bind(this), this.currentDate = (this.fieldDate && /* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)) ?? /* @__PURE__ */ new Date(), this.locale = document.documentElement.getAttribute("lang") || "en-US", this.dateConfig = {
|
|
285
|
-
locale: this.locale,
|
|
286
|
-
today: /* @__PURE__ */ new Date(),
|
|
287
|
-
weekInfo: {
|
|
288
|
-
firstDay: 7,
|
|
289
|
-
weekend: [6, 7]
|
|
290
|
-
}
|
|
291
|
-
}, this.weekDays = [
|
|
292
|
-
"Sunday",
|
|
293
|
-
"Monday",
|
|
294
|
-
"Tuesday",
|
|
295
|
-
"Wednesday",
|
|
296
|
-
"Thursday",
|
|
297
|
-
"Friday",
|
|
298
|
-
"Saturday"
|
|
299
|
-
], this.dateFormatOptions = {
|
|
300
|
-
weekday: "long",
|
|
301
|
-
year: "numeric",
|
|
302
|
-
month: "long",
|
|
303
|
-
day: "numeric"
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
get activeModal() {
|
|
307
|
-
return this._activeModal;
|
|
308
|
-
}
|
|
309
|
-
set activeModal(e) {
|
|
310
|
-
this._activeModal = e;
|
|
311
|
-
}
|
|
312
|
-
get fieldDate() {
|
|
313
|
-
return this._fieldDate;
|
|
314
|
-
}
|
|
315
|
-
set fieldDate(e) {
|
|
316
|
-
const t = this._fieldDate;
|
|
317
|
-
this.requestUpdate("fieldDate", t);
|
|
318
|
-
const a = !!(e && (/* @__PURE__ */ new Date(`${e}T00:00`)).getTime());
|
|
319
|
-
this.currentDate = a ? /* @__PURE__ */ new Date(`${e}T00:00`) : /* @__PURE__ */ new Date(), this._fieldDate = a ? e : "";
|
|
320
|
-
}
|
|
321
|
-
get currentDate() {
|
|
322
|
-
return this._currentDate;
|
|
323
|
-
}
|
|
324
|
-
set currentDate(e) {
|
|
325
|
-
const t = this._currentDate;
|
|
326
|
-
this._currentDate = e, this.requestUpdate("currentDate", t);
|
|
327
|
-
}
|
|
328
|
-
connectedCallback() {
|
|
329
|
-
super.connectedCallback(), window.addEventListener("click", this._handleOnClickOutside, !1);
|
|
330
|
-
}
|
|
331
|
-
disconnectedCallback() {
|
|
332
|
-
super.disconnectedCallback(), window.removeEventListener("click", this._handleOnClickOutside, !1);
|
|
333
|
-
}
|
|
334
|
-
/* Click Event Functions */
|
|
335
|
-
_handleOnClickOutside(e) {
|
|
336
|
-
if (!this.shadowRoot?.host)
|
|
337
|
-
throw Error(
|
|
338
|
-
"Could not determine navigation context during click handler"
|
|
339
|
-
);
|
|
340
|
-
if (!e.composedPath().includes(this.shadowRoot.host)) {
|
|
341
|
-
const a = new CustomEvent("outsideClick", {
|
|
342
|
-
detail: {
|
|
343
|
-
composedPath: e.composedPath()
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
this.dispatchEvent(a);
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
9
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
10
|
+
import styles from './date-picker.styles';
|
|
11
|
+
import { Cre8Field } from '../field/field';
|
|
12
|
+
import './calendar/calendar';
|
|
13
|
+
/**
|
|
14
|
+
* The Date Picker component renders a form group with label, control, help text and validation styling much
|
|
15
|
+
* like the Field component but exclusively for type=date.
|
|
16
|
+
* Cre8DatePicker inherits the Cre8Field component.
|
|
17
|
+
*/
|
|
18
|
+
export class Cre8DatePicker extends Cre8Field {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/**
|
|
22
|
+
* The type of the form field.
|
|
23
|
+
* For Date Picker, this is always 'date'.
|
|
24
|
+
*/
|
|
25
|
+
this.type = 'date';
|
|
26
|
+
this.showCalendar = false;
|
|
347
27
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const t = this.currentDate, a = new Date(t.setFullYear(e));
|
|
359
|
-
this.currentDate = a, this.activeModal = "none";
|
|
360
|
-
}
|
|
361
|
-
changeMonth(e) {
|
|
362
|
-
const t = this.currentDate, a = new Date(t.setMonth(e));
|
|
363
|
-
this.currentDate = a, this.activeModal = "none";
|
|
364
|
-
}
|
|
365
|
-
activateModal(e) {
|
|
366
|
-
this.activeModal = e;
|
|
367
|
-
}
|
|
368
|
-
/* Helper/Get Functions */
|
|
369
|
-
static formatMonthOrDayIndex(e) {
|
|
370
|
-
return (e + 1).toString().padStart(2, "0");
|
|
371
|
-
}
|
|
372
|
-
static formatDate(e) {
|
|
373
|
-
return e.toString().padStart(2, "0");
|
|
374
|
-
}
|
|
375
|
-
numberOfDaysinMonth() {
|
|
376
|
-
return new Date(this.getYear(), this.getMonth() + 1, 0).getDate();
|
|
377
|
-
}
|
|
378
|
-
getMonth() {
|
|
379
|
-
return this.currentDate.getMonth();
|
|
380
|
-
}
|
|
381
|
-
getMonthName() {
|
|
382
|
-
return new Intl.DateTimeFormat(this.locale, {
|
|
383
|
-
month: "long"
|
|
384
|
-
}).format(this.currentDate);
|
|
385
|
-
}
|
|
386
|
-
getYear() {
|
|
387
|
-
return this.currentDate.getFullYear();
|
|
388
|
-
}
|
|
389
|
-
static dateToString(e) {
|
|
390
|
-
return `${e.getFullYear()}-${o.formatMonthOrDayIndex(
|
|
391
|
-
e.getMonth()
|
|
392
|
-
)}-${o.formatDate(e.getDate())}`;
|
|
393
|
-
}
|
|
394
|
-
async updateFocusForKeydown(e) {
|
|
395
|
-
this.currentDate = e, await this.updateComplete;
|
|
396
|
-
const t = this.shadowRoot?.querySelector(
|
|
397
|
-
`button[datetime="${o.dateToString(e)}"]`
|
|
398
|
-
);
|
|
399
|
-
t.setAttribute("tabindex", "0"), t.focus();
|
|
400
|
-
}
|
|
401
|
-
_handleCalendarKeyDown(e) {
|
|
402
|
-
const t = this.shadowRoot?.querySelector(
|
|
403
|
-
`button[datetime="${o.dateToString(this.currentDate)}"]`
|
|
404
|
-
);
|
|
405
|
-
if (e.key === "ArrowUp") {
|
|
406
|
-
const a = new Date(
|
|
407
|
-
this.getYear(),
|
|
408
|
-
this.getMonth(),
|
|
409
|
-
this.currentDate.getDate() - 7
|
|
410
|
-
);
|
|
411
|
-
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
28
|
+
/**
|
|
29
|
+
* Handle Date On Input
|
|
30
|
+
* 1) Set the input's value equal to the event.target.value when the input is changed.
|
|
31
|
+
* 2) Set the internal form value of the input to the updated value
|
|
32
|
+
*/
|
|
33
|
+
handleDateOnInput(e) {
|
|
34
|
+
/* 1 */
|
|
35
|
+
this.value = e.target.value;
|
|
36
|
+
/* 2 */
|
|
37
|
+
this._internals.setFormValue(this.value);
|
|
412
38
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
this.
|
|
416
|
-
this.
|
|
417
|
-
this.currentDate.getDate() + 7
|
|
418
|
-
);
|
|
419
|
-
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
39
|
+
handleCalendarSelect(e) {
|
|
40
|
+
this.value = e.detail.date;
|
|
41
|
+
this._internals.setFormValue(this.value);
|
|
42
|
+
this.showCalendar = false;
|
|
420
43
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
this.
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
);
|
|
427
|
-
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
428
|
-
}
|
|
429
|
-
if (e.key === "ArrowRight") {
|
|
430
|
-
const a = new Date(
|
|
431
|
-
this.getYear(),
|
|
432
|
-
this.getMonth(),
|
|
433
|
-
this.currentDate.getDate() + 1
|
|
434
|
-
);
|
|
435
|
-
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
44
|
+
handleOutsideClick(e) {
|
|
45
|
+
const calendarIcon = this.renderRoot.querySelector('.cre8-c-date-picker');
|
|
46
|
+
if (this.showCalendar && !e.detail.composedPath.includes(calendarIcon)) {
|
|
47
|
+
this.showCalendar = false;
|
|
48
|
+
}
|
|
436
49
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
composedPath: []
|
|
50
|
+
toggleCalendar() {
|
|
51
|
+
if (!this.disabled && !this.readonly) {
|
|
52
|
+
this.showCalendar = !this.showCalendar;
|
|
441
53
|
}
|
|
442
|
-
});
|
|
443
|
-
setTimeout(() => {
|
|
444
|
-
this.dispatchEvent(a);
|
|
445
|
-
}, 20);
|
|
446
54
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
async changeYearFromNav(e) {
|
|
458
|
-
this.changeYear(e), await this.updateComplete;
|
|
459
|
-
const a = (this.shadowRoot?.querySelector(
|
|
460
|
-
"cre8-calendar-navigation"
|
|
461
|
-
)).shadowRoot?.querySelector(
|
|
462
|
-
".cre8-c-calendar-navigation__year-modal-button"
|
|
463
|
-
);
|
|
464
|
-
await this.updateComplete, a.shadowRoot.querySelector("button").focus();
|
|
465
|
-
}
|
|
466
|
-
/* Template Map Functions */
|
|
467
|
-
getDaysOfWeekAbbreviations() {
|
|
468
|
-
return this.weekDays.map(
|
|
469
|
-
(e) => s` <td>
|
|
470
|
-
<span aria-label="${e}">${e[0]}</span>
|
|
471
|
-
</td>`
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Create array of Day Buttons to fill in excess calendar space at the beginning of the month.
|
|
476
|
-
*
|
|
477
|
-
* 1. Map from empty array of length equal to the amount of access calendar "slots" in the beginning of the month.
|
|
478
|
-
* (i.e. if the month starts on Wednesday (getDay = 3), there are 3 days prior that week from last month.)
|
|
479
|
-
*
|
|
480
|
-
* 2. Based on the indice of array, get the given day button's date, where the date is
|
|
481
|
-
* the last day of last month minus the max of the array plus the indice plus one -> x = lastday - (max - (i + 1))
|
|
482
|
-
* (Note: (max - (i + 1) equals the keys of the array in reverse order:
|
|
483
|
-
* [max - i + 1] -> [3-1, 3-2, 3-3] -> [2,1,0] for an array of [3])
|
|
484
|
-
* (i.e. if the calendar is starting on Wednesday June 1st, the access days on the calendar will be
|
|
485
|
-
* Sunday May 29th (31 - (2)), Monday May 30th (31 - (1)), Tuesday May 31st (31 - (0)))
|
|
486
|
-
*
|
|
487
|
-
* 3. Build out day button with necessary props
|
|
488
|
-
* */
|
|
489
|
-
getPreviousMonthDayButtons() {
|
|
490
|
-
return [
|
|
491
|
-
...Array(new Date(this.getYear(), this.getMonth(), 1).getDay()).keys()
|
|
492
|
-
].map((e) => {
|
|
493
|
-
const t = new Date(
|
|
494
|
-
this.getYear(),
|
|
495
|
-
this.getMonth(),
|
|
496
|
-
1
|
|
497
|
-
).getDay(), a = new Date(this.getYear(), this.getMonth(), 0), r = a.getDate(), i = new Date(
|
|
498
|
-
a.getFullYear(),
|
|
499
|
-
a.getMonth(),
|
|
500
|
-
r - t + (e + 1)
|
|
501
|
-
), n = this.dateConfig.today.getDate() === i.getDate() && this.dateConfig.today.getMonth() === i.getMonth() && this.dateConfig.today.getFullYear() === i.getFullYear(), Y = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === i.getTime();
|
|
502
|
-
return s` <td>
|
|
503
|
-
<button
|
|
504
|
-
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
505
|
-
datetime="${o.dateToString(i)}"
|
|
506
|
-
?data-today="${n}"
|
|
507
|
-
?data-selected="${Y}"
|
|
508
|
-
tabindex="-1"
|
|
509
|
-
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
510
|
-
weekday: "long",
|
|
511
|
-
year: "numeric",
|
|
512
|
-
month: "long",
|
|
513
|
-
day: "numeric"
|
|
514
|
-
}).format(
|
|
515
|
-
/* @__PURE__ */ new Date(`${o.dateToString(i)}T00:00`)
|
|
516
|
-
)}"
|
|
517
|
-
@click="${() => this.emitSelectedDate(o.dateToString(i))}"
|
|
518
|
-
>
|
|
519
|
-
${new Intl.NumberFormat(this.locale).format(i.getDate())}
|
|
520
|
-
</button>
|
|
521
|
-
</td>`;
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Create array of Day Buttons to fill out current month
|
|
526
|
-
*
|
|
527
|
-
* 1. Map from empty array of length equal to the amount days in this month
|
|
528
|
-
*
|
|
529
|
-
* 2. Get the date of the current month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
|
|
530
|
-
*
|
|
531
|
-
* 3. Build out day button with necessary props
|
|
532
|
-
* */
|
|
533
|
-
getCurrentMonthDayButtons() {
|
|
534
|
-
return [...Array(this.numberOfDaysinMonth()).keys()].map((e) => {
|
|
535
|
-
const t = e + 1, a = new Date(this.getYear(), this.getMonth(), t), r = this.dateConfig.today.getDate() === t && this.dateConfig.today.getMonth() === this.getMonth() && this.dateConfig.today.getFullYear() === this.getYear(), i = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === a.getTime();
|
|
536
|
-
return s` <td>
|
|
537
|
-
<button
|
|
538
|
-
class="cre8-c-calendar__day-button"
|
|
539
|
-
datetime="${o.dateToString(a)}"
|
|
540
|
-
?data-today="${r}"
|
|
541
|
-
?data-selected="${i}"
|
|
542
|
-
tabindex="${t === this.currentDate.getDate() ? "0" : "-1"}"
|
|
543
|
-
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
544
|
-
weekday: "long",
|
|
545
|
-
year: "numeric",
|
|
546
|
-
month: "long",
|
|
547
|
-
day: "numeric"
|
|
548
|
-
}).format(/* @__PURE__ */ new Date(`${o.dateToString(a)}T00:00`))}"
|
|
549
|
-
@click="${() => this.emitSelectedDate(o.dateToString(a))}"
|
|
550
|
-
>
|
|
551
|
-
${new Intl.NumberFormat(this.locale).format(e + 1)}
|
|
552
|
-
</button>
|
|
553
|
-
</td>`;
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Create array of Day Buttons to fill in excess calendar space at the end of the month.
|
|
558
|
-
*
|
|
559
|
-
* 1. Map from empty array of length equal to the amount of access calendar "slots" at the end of the month.
|
|
560
|
-
* The array have an amount of slots equal to the number of days in a week minus how many days have already past
|
|
561
|
-
* and since getDay returns the index of the day of the week (Sunday = 0, Monday = 1 ...) our equations is
|
|
562
|
-
* x = 7 - (getDay() + 1)
|
|
563
|
-
* Note: (we need to add 1 because indexing starts at 0)
|
|
564
|
-
* so if the month ends on Monday (getDay() = 1), 5 = 7 - (1 + 1), there are 5 days that week from the new month
|
|
565
|
-
*
|
|
566
|
-
* 2. Get the date from the next month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...)
|
|
567
|
-
*
|
|
568
|
-
* 3. Build out day button with necessary props
|
|
569
|
-
* */
|
|
570
|
-
getNextMonthDayButtons() {
|
|
571
|
-
return [
|
|
572
|
-
...Array(
|
|
573
|
-
6 - new Date(
|
|
574
|
-
this.getYear(),
|
|
575
|
-
this.getMonth(),
|
|
576
|
-
this.numberOfDaysinMonth()
|
|
577
|
-
).getDay()
|
|
578
|
-
).keys()
|
|
579
|
-
].map((e) => {
|
|
580
|
-
const t = new Date(
|
|
581
|
-
this.getYear(),
|
|
582
|
-
this.getMonth(),
|
|
583
|
-
this.numberOfDaysinMonth()
|
|
584
|
-
), a = new Date(
|
|
585
|
-
t.setDate(t.getDate() + 1)
|
|
586
|
-
), r = new Date(
|
|
587
|
-
a.getFullYear(),
|
|
588
|
-
a.getMonth(),
|
|
589
|
-
e + 1
|
|
590
|
-
), i = this.dateConfig.today.getDate() === r.getDate() && this.dateConfig.today.getMonth() === r.getMonth() && this.dateConfig.today.getFullYear() === r.getFullYear(), n = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === r.getTime();
|
|
591
|
-
return s` <td>
|
|
592
|
-
<button
|
|
593
|
-
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
594
|
-
datetime="${o.dateToString(r)}"
|
|
595
|
-
?data-today="${i}"
|
|
596
|
-
?data-selected="${n}"
|
|
597
|
-
tabindex="-1"
|
|
598
|
-
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
599
|
-
weekday: "long",
|
|
600
|
-
year: "numeric",
|
|
601
|
-
month: "long",
|
|
602
|
-
day: "numeric"
|
|
603
|
-
}).format(
|
|
604
|
-
/* @__PURE__ */ new Date(`${o.dateToString(r)}T00:00`)
|
|
605
|
-
)}"
|
|
606
|
-
@click="${() => this.emitSelectedDate(o.dateToString(r))}"
|
|
607
|
-
>
|
|
608
|
-
${new Intl.NumberFormat(this.locale).format(r.getDate())}
|
|
609
|
-
</button>
|
|
610
|
-
</td>`;
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
render() {
|
|
614
|
-
const e = this.componentClassNames("cre8-c-calendar", {});
|
|
615
|
-
return s` <div class="${e}">
|
|
616
|
-
${this._activeModal === "month" ? s`<cre8-calendar-month-modal
|
|
617
|
-
currentMonth="${this.getMonth()}"
|
|
618
|
-
@changeMonth="${(t) => this.changeMonthFromNav(t.detail.month)}"
|
|
619
|
-
></cre8-calendar-month-modal>` : y}
|
|
620
|
-
${this._activeModal === "year" ? s`<cre8-calendar-year-modal
|
|
621
|
-
currentYear="${this.getYear()}"
|
|
622
|
-
@changeYear="${(t) => this.changeYearFromNav(t.detail.year)}"
|
|
623
|
-
></cre8-calendar-year-modal>` : y}
|
|
624
|
-
${this._activeModal === "none" ? s` ${this.hasShortcuts ? s`<div class="cre8-c-calendar__header-shortcuts">
|
|
625
|
-
<cre8-button
|
|
626
|
-
text="Today"
|
|
627
|
-
variant="secondary"
|
|
628
|
-
size="sm"
|
|
629
|
-
@click="${() => this.emitSelectedDate(
|
|
630
|
-
o.dateToString(this.dateConfig.today)
|
|
631
|
-
)}"
|
|
632
|
-
></cre8-button>
|
|
633
|
-
<cre8-button
|
|
634
|
-
text="Tomorrow"
|
|
635
|
-
variant="secondary"
|
|
636
|
-
size="sm"
|
|
637
|
-
@click="${() => this.emitSelectedDate(
|
|
638
|
-
o.dateToString(
|
|
639
|
-
new Date(
|
|
640
|
-
this.dateConfig.today.setDate(
|
|
641
|
-
this.dateConfig.today.getDate() + 1
|
|
642
|
-
)
|
|
643
|
-
)
|
|
644
|
-
)
|
|
645
|
-
)}"
|
|
646
|
-
></cre8-button>
|
|
647
|
-
<cre8-button
|
|
648
|
-
text="In 2 days"
|
|
649
|
-
variant="secondary"
|
|
650
|
-
size="sm"
|
|
651
|
-
@click="${() => this.emitSelectedDate(
|
|
652
|
-
o.dateToString(
|
|
653
|
-
new Date(
|
|
654
|
-
this.dateConfig.today.setDate(
|
|
655
|
-
this.dateConfig.today.getDate() + 2
|
|
656
|
-
)
|
|
657
|
-
)
|
|
658
|
-
)
|
|
659
|
-
)}"
|
|
660
|
-
></cre8-button>
|
|
661
|
-
</div>` : y}
|
|
662
|
-
<cre8-calendar-navigation
|
|
663
|
-
monthName="${this.getMonthName()}"
|
|
664
|
-
year="${this.getYear()}"
|
|
665
|
-
@activateModal="${(t) => this.activateModal(t.detail.modal)}"
|
|
666
|
-
@changeMonth="${(t) => this.changeMonth(this.getMonth() + t.detail.addend)}"
|
|
667
|
-
@changeYear="${(t) => this.changeYear(this.getYear() + t.detail.addend)}"
|
|
668
|
-
>
|
|
669
|
-
</cre8-calendar-navigation>
|
|
670
|
-
<table>
|
|
671
|
-
<thead>
|
|
672
|
-
<tr>
|
|
673
|
-
${this.getDaysOfWeekAbbreviations()}
|
|
674
|
-
</tr>
|
|
675
|
-
</thead>
|
|
676
|
-
<tbody>
|
|
677
|
-
<tr @keydown=${this._handleCalendarKeyDown}>
|
|
678
|
-
${this.getPreviousMonthDayButtons()}
|
|
679
|
-
${this.getCurrentMonthDayButtons()}
|
|
680
|
-
${this.getNextMonthDayButtons()}
|
|
681
|
-
</tr>
|
|
682
|
-
</tbody>
|
|
683
|
-
</table>` : y}
|
|
684
|
-
</div>`;
|
|
685
|
-
}
|
|
686
|
-
}, o.styles = [z], o);
|
|
687
|
-
h([
|
|
688
|
-
C(".cre8-c-calendar__navigation-wrapper")
|
|
689
|
-
], c.prototype, "_navWrapper", 2);
|
|
690
|
-
h([
|
|
691
|
-
p({ type: Boolean, reflect: !0 })
|
|
692
|
-
], c.prototype, "hasShortcuts", 2);
|
|
693
|
-
h([
|
|
694
|
-
l()
|
|
695
|
-
], c.prototype, "_activeModal", 2);
|
|
696
|
-
h([
|
|
697
|
-
p({ reflect: !0, type: String })
|
|
698
|
-
], c.prototype, "activeModal", 1);
|
|
699
|
-
h([
|
|
700
|
-
l()
|
|
701
|
-
], c.prototype, "_fieldDate", 2);
|
|
702
|
-
h([
|
|
703
|
-
p({ reflect: !0, type: Date })
|
|
704
|
-
], c.prototype, "fieldDate", 1);
|
|
705
|
-
h([
|
|
706
|
-
l()
|
|
707
|
-
], c.prototype, "_currentDate", 2);
|
|
708
|
-
h([
|
|
709
|
-
p({ reflect: !0, type: Date })
|
|
710
|
-
], c.prototype, "currentDate", 1);
|
|
711
|
-
h([
|
|
712
|
-
l()
|
|
713
|
-
], c.prototype, "locale", 2);
|
|
714
|
-
h([
|
|
715
|
-
l()
|
|
716
|
-
], c.prototype, "weekDays", 2);
|
|
717
|
-
h([
|
|
718
|
-
l()
|
|
719
|
-
], c.prototype, "dateConfig", 2);
|
|
720
|
-
h([
|
|
721
|
-
l()
|
|
722
|
-
], c.prototype, "dateFormatOptions", 2);
|
|
723
|
-
let B = c;
|
|
724
|
-
customElements.get("cre8-calendar") === void 0 && customElements.define("cre8-calendar", B);
|
|
725
|
-
var U = Object.defineProperty, k = (d, e, t, a) => {
|
|
726
|
-
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
727
|
-
(n = d[i]) && (r = n(e, t, r) || r);
|
|
728
|
-
return r && U(e, t, r), r;
|
|
729
|
-
};
|
|
730
|
-
const M = class M extends R {
|
|
731
|
-
constructor() {
|
|
732
|
-
super(...arguments), this.type = "date", this.showCalendar = !1;
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Handle Date On Input
|
|
736
|
-
* 1) Set the input's value equal to the event.target.value when the input is changed.
|
|
737
|
-
* 2) Set the internal form value of the input to the updated value
|
|
738
|
-
*/
|
|
739
|
-
handleDateOnInput(e) {
|
|
740
|
-
this.value = e.target.value, this._internals.setFormValue(this.value);
|
|
741
|
-
}
|
|
742
|
-
handleCalendarSelect(e) {
|
|
743
|
-
this.value = e.detail.date, this._internals.setFormValue(this.value), this.showCalendar = !1;
|
|
744
|
-
}
|
|
745
|
-
handleOutsideClick(e) {
|
|
746
|
-
const t = this.renderRoot.querySelector(".cre8-c-date-picker");
|
|
747
|
-
this.showCalendar && !e.detail.composedPath.includes(t) && (this.showCalendar = !1);
|
|
748
|
-
}
|
|
749
|
-
toggleCalendar() {
|
|
750
|
-
!this.disabled && !this.readonly && (this.showCalendar = !this.showCalendar);
|
|
751
|
-
}
|
|
752
|
-
render() {
|
|
753
|
-
const e = this.componentClassNames("cre8-c-date-picker", {
|
|
754
|
-
"cre8-is-error": this.isError,
|
|
755
|
-
"cre8-is-success": this.isSuccess,
|
|
756
|
-
"cre8-c-date-picker--disabled": this.disabled,
|
|
757
|
-
"cre8-c-date-picker--read-only": this.readonly
|
|
758
|
-
});
|
|
759
|
-
return this.type = "date", s`
|
|
760
|
-
<div class="${e}">
|
|
55
|
+
render() {
|
|
56
|
+
const componentClassNames = this.componentClassNames('cre8-c-date-picker', {
|
|
57
|
+
'cre8-is-error': this.isError,
|
|
58
|
+
'cre8-is-success': this.isSuccess,
|
|
59
|
+
'cre8-c-date-picker--disabled': this.disabled,
|
|
60
|
+
'cre8-c-date-picker--read-only': this.readonly,
|
|
61
|
+
});
|
|
62
|
+
this.type = 'date';
|
|
63
|
+
return html `
|
|
64
|
+
<div class="${componentClassNames}">
|
|
761
65
|
<label class="cre8-c-date-picker__label" for="${this.fieldId}"
|
|
762
66
|
>${this.label}</label
|
|
763
67
|
>
|
|
764
68
|
<div class="cre8-c-date-picker__body">
|
|
765
69
|
<input
|
|
766
70
|
class="cre8-c-date-picker__input"
|
|
767
|
-
autocomplete=${
|
|
71
|
+
autocomplete=${ifDefined(this.autocomplete)}
|
|
768
72
|
type="${this.type}"
|
|
769
73
|
id="${this.fieldId}"
|
|
770
|
-
name="${
|
|
771
|
-
max=${
|
|
772
|
-
min=${
|
|
773
|
-
value="${
|
|
74
|
+
name="${ifDefined(this.name)}"
|
|
75
|
+
max=${ifDefined(this.max)}
|
|
76
|
+
min=${ifDefined(this.min)}
|
|
77
|
+
value="${ifDefined(this.value)}"
|
|
774
78
|
?readonly=${this.readonly}
|
|
775
79
|
?required=${this.required}
|
|
776
80
|
?disabled="${this.disabled}"
|
|
777
|
-
aria-describedby="${
|
|
778
|
-
placeholder="${
|
|
81
|
+
aria-describedby="${ifDefined(this.fieldNoteAria())}"
|
|
82
|
+
placeholder="${ifDefined(this.placeholder)}"
|
|
779
83
|
@input=${this.handleDateOnInput}
|
|
780
84
|
@click=${this.toggleCalendar}
|
|
781
85
|
/>
|
|
@@ -784,41 +88,44 @@ const M = class M extends R {
|
|
|
784
88
|
aria-expanded="${this.showCalendar}"
|
|
785
89
|
aria-label="Show Calendar"
|
|
786
90
|
?disabled="${this.disabled || this.readonly}"
|
|
787
|
-
?hideText=${
|
|
91
|
+
?hideText=${true}
|
|
788
92
|
iconName="calendar-datepicker"
|
|
789
93
|
variant="tertiary"
|
|
790
94
|
@click="${this.toggleCalendar}"
|
|
791
95
|
></cre8-button>
|
|
792
96
|
</div>
|
|
793
|
-
${this.showCalendar
|
|
794
|
-
|
|
97
|
+
${this.showCalendar
|
|
98
|
+
? html `<cre8-calendar
|
|
99
|
+
fieldDate="${ifDefined(this.value)}"
|
|
795
100
|
?hasShortcuts=${this.hasShortcuts}
|
|
796
101
|
@dateSelect="${this.handleCalendarSelect}"
|
|
797
102
|
@outsideClick="${this.handleOutsideClick}"
|
|
798
|
-
></cre8-calendar>`
|
|
799
|
-
|
|
103
|
+
></cre8-calendar>`
|
|
104
|
+
: nothing}
|
|
105
|
+
${this.fieldNote || this.slotNotEmpty('fieldNote')
|
|
106
|
+
? html `<cre8-field-note
|
|
800
107
|
id=${this.ariaDescribedBy}
|
|
801
108
|
class="cre8-c-date-picker__field-note"
|
|
802
109
|
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note
|
|
803
|
-
>`
|
|
110
|
+
>`
|
|
111
|
+
: nothing}
|
|
804
112
|
${this.renderSuccessErrorFieldNote()}
|
|
805
113
|
</div>
|
|
806
114
|
`;
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
customElements.
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
Cre8DatePicker.styles = [styles];
|
|
118
|
+
__decorate([
|
|
119
|
+
query('input[type="date"]')
|
|
120
|
+
], Cre8DatePicker.prototype, "field", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
state()
|
|
123
|
+
], Cre8DatePicker.prototype, "showCalendar", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: Boolean, reflect: true })
|
|
126
|
+
], Cre8DatePicker.prototype, "hasShortcuts", void 0);
|
|
127
|
+
if (customElements.get('cre8-date-picker') === undefined) {
|
|
128
|
+
customElements.define('cre8-date-picker', Cre8DatePicker);
|
|
129
|
+
}
|
|
130
|
+
export default Cre8DatePicker;
|
|
131
|
+
//# sourceMappingURL=date-picker.js.map
|