@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,58 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import classnames from 'classnames';
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* A base element.
|
|
5
|
+
*/
|
|
6
|
+
export class Cre8Element extends LitElement {
|
|
7
|
+
/**
|
|
8
|
+
* Abstraction of `classnames` that automatically includes any style modifier
|
|
9
|
+
* as well as any set variants.
|
|
10
|
+
*
|
|
11
|
+
* It is expected that `variant` would be overridden in a subclass with more
|
|
12
|
+
* specific types, `@property() variant?: 'foo' | 'bar'`
|
|
13
|
+
*
|
|
14
|
+
* @param baseClassName
|
|
15
|
+
*/
|
|
16
|
+
componentClassNames(baseClassName, additionalClassNames = {}) {
|
|
17
|
+
return classnames(baseClassName, additionalClassNames);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if a slot is empty
|
|
21
|
+
*
|
|
22
|
+
* @param slotName
|
|
23
|
+
*/
|
|
24
|
+
slotEmpty(slotName) {
|
|
25
|
+
return !this.querySelector(`[slot="${slotName}"]`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if a slot is not empty
|
|
29
|
+
*
|
|
30
|
+
* @param slotName
|
|
31
|
+
*/
|
|
32
|
+
slotNotEmpty(slotName) {
|
|
33
|
+
if (!this.slotEmpty(slotName) !== false) {
|
|
34
|
+
return !this.slotEmpty(slotName);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Dispatch a custom event.
|
|
12
40
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return this.slotEmpty(t) ? null : !this.slotEmpty(t);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Dispatch a custom event.
|
|
34
|
-
*/
|
|
35
|
-
dispatch({
|
|
36
|
-
e: t,
|
|
37
|
-
eventName: e,
|
|
38
|
-
detailObj: r = {},
|
|
39
|
-
optionsObj: n = {}
|
|
40
|
-
}) {
|
|
41
|
-
const o = {
|
|
42
|
-
bubbles: !0,
|
|
43
|
-
composed: !0,
|
|
44
|
-
...n,
|
|
45
|
-
detail: { ...t && { originalEvent: t }, ...r }
|
|
46
|
-
}, s = new CustomEvent(e, o);
|
|
47
|
-
return this.dispatchEvent(s), s;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Example render, should not be used
|
|
51
|
-
*/
|
|
52
|
-
render() {
|
|
53
|
-
return i`<slot></slot>`;
|
|
54
|
-
}
|
|
41
|
+
dispatch({ e, eventName, detailObj = {}, optionsObj = {}, }) {
|
|
42
|
+
const options = {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
composed: true,
|
|
45
|
+
...optionsObj,
|
|
46
|
+
detail: { ...(e && { originalEvent: e }), ...detailObj },
|
|
47
|
+
};
|
|
48
|
+
const event = new CustomEvent(eventName, options);
|
|
49
|
+
this.dispatchEvent(event);
|
|
50
|
+
return event;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Example render, should not be used
|
|
54
|
+
*/
|
|
55
|
+
render() {
|
|
56
|
+
return html `<slot></slot>`;
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
|
-
|
|
57
|
-
c as Cre8Element
|
|
58
|
-
};
|
|
59
|
+
//# sourceMappingURL=cre8-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cre8-element.js","sourceRoot":"","sources":["../../components/cre8-element.ts"],"names":[],"mappings":"A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from 'lit';\n\nexport interface DetailObj {\n [key: string]: unknown;\n}\n\nexport interface Cre8DispatchProps {\n e?: Event;\n eventName: string;\n detailObj?: DetailObj;\n optionsObj?: { [key: string]: unknown };\n}\n\nexport interface Cre8Event extends Event {\n detail: {\n originalEvent: Event;\n detailObj: DetailObj;\n };\n}\n\n/**\n * A base element.\n */\nexport class Cre8Element extends LitElement {\n /**\n * Abstraction of `classnames` that automatically includes any style modifier\n * as well as any set variants.\n *\n * It is expected that `variant` would be overridden in a subclass with more\n * specific types, `@property() variant?: 'foo' | 'bar'`\n *\n * @param baseClassName\n */\n componentClassNames(baseClassName: string, additionalClassNames = {}) {\n return classnames(baseClassName, additionalClassNames);\n }\n\n /**\n * Check if a slot is empty\n *\n * @param slotName\n */\n slotEmpty(slotName: string) {\n return !this.querySelector(`[slot=\"${slotName}\"]`);\n }\n\n /**\n * Check if a slot is not empty\n *\n * @param slotName\n */\n slotNotEmpty(slotName: string) {\n if (!this.slotEmpty(slotName) !== false) {\n return !this.slotEmpty(slotName);\n }\n return null;\n }\n\n /**\n * Dispatch a custom event.\n */\n dispatch({\n e, eventName, detailObj = {}, optionsObj = {},\n }: Cre8DispatchProps): CustomEvent {\n const options = {\n bubbles: true,\n composed: true,\n ...optionsObj,\n detail: { ...(e && { originalEvent: e }), ...detailObj },\n };\n const event = new CustomEvent(eventName, options);\n this.dispatchEvent(event);\n return event;\n }\n\n /**\n * Example render, should not be used\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n"]}
|
|
@@ -1,246 +1,214 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
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;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
7
|
+
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { provide } from '@lit/context';
|
|
9
|
+
import { Cre8Element } from './cre8-element';
|
|
10
|
+
import { formInternalsContext, formStateContext } from './contexts/form-internals-context';
|
|
11
|
+
/**
|
|
12
|
+
* Base class for form-associated custom elements.
|
|
13
|
+
* Provides ElementInternals context to descendant components.
|
|
14
|
+
*/
|
|
15
|
+
export class Cre8FormElement extends Cre8Element {
|
|
16
|
+
/**
|
|
17
|
+
* The value of the form field.
|
|
18
|
+
*/
|
|
19
|
+
get value() {
|
|
20
|
+
return this.internalValue;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sets the value of the form field.
|
|
24
|
+
* 1. Stores the new value so it can be retrieved by the getter.
|
|
25
|
+
* 2. Sets the current value of the control via ElementInternals.
|
|
26
|
+
* 3. Updates the actual field element.
|
|
27
|
+
* 4. Updates the form state context.
|
|
28
|
+
* 5. Triggers a re-render.
|
|
29
|
+
*/
|
|
30
|
+
set value(newValue) {
|
|
31
|
+
const oldValue = this.value;
|
|
32
|
+
this.internalValue = newValue;
|
|
33
|
+
// Update form value for non-checkbox/radio types
|
|
34
|
+
if (this.type !== 'checkbox' && this.type !== 'radio') {
|
|
35
|
+
this._internals?.setFormValue(newValue);
|
|
36
|
+
}
|
|
37
|
+
this.updateField();
|
|
38
|
+
this.updateFormState();
|
|
39
|
+
this.requestUpdate('value', oldValue);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Updates the form state context for descendant consumption
|
|
43
|
+
*/
|
|
44
|
+
updateFormState() {
|
|
45
|
+
this._formState = {
|
|
46
|
+
value: this.internalValue,
|
|
47
|
+
disabled: this.disabled ?? false,
|
|
48
|
+
required: this.required ?? false,
|
|
49
|
+
isError: this.isError ?? false,
|
|
50
|
+
isSuccess: this.isSuccess ?? false,
|
|
51
|
+
name: this.name,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Updates the actual field element's value
|
|
56
|
+
*/
|
|
57
|
+
updateField() {
|
|
58
|
+
if (this.field && this.internalValue !== undefined) {
|
|
59
|
+
this.field.value = this.internalValue ?? '';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Lifecycle hook called after first render
|
|
64
|
+
*/
|
|
65
|
+
firstUpdated() {
|
|
66
|
+
if (this.type !== 'checkbox' && this.type !== 'radio') {
|
|
67
|
+
this.defaultValue = this.value || this.getAttribute('value') || '';
|
|
68
|
+
}
|
|
69
|
+
this.updateField();
|
|
70
|
+
this.updateFormState();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Called when properties change
|
|
74
|
+
*/
|
|
75
|
+
updated(changedProperties) {
|
|
76
|
+
super.updated(changedProperties);
|
|
77
|
+
// Update form state context when relevant properties change
|
|
78
|
+
if (changedProperties.has('disabled') ||
|
|
79
|
+
changedProperties.has('required') ||
|
|
80
|
+
changedProperties.has('isError') ||
|
|
81
|
+
changedProperties.has('isSuccess') ||
|
|
82
|
+
changedProperties.has('name')) {
|
|
83
|
+
this.updateFormState();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Form lifecycle callback - called when the form is reset
|
|
88
|
+
*/
|
|
89
|
+
formResetCallback() {
|
|
90
|
+
this.value = this.defaultValue;
|
|
91
|
+
this.updateField();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Form lifecycle callback - called when the element is disabled via fieldset
|
|
95
|
+
*/
|
|
96
|
+
formDisabledCallback(disabled) {
|
|
97
|
+
this.disabled = disabled;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Form lifecycle callback - called when form state is restored
|
|
101
|
+
*/
|
|
102
|
+
formStateRestoreCallback(state, _mode) {
|
|
103
|
+
if (typeof state === 'string') {
|
|
104
|
+
this.value = state;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Gets the form associated with this element
|
|
109
|
+
*/
|
|
110
|
+
get form() {
|
|
111
|
+
return this._internals?.form ?? null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Gets the validation message
|
|
115
|
+
*/
|
|
116
|
+
get validationMessage() {
|
|
117
|
+
return this._internals?.validationMessage ?? '';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the validity state
|
|
121
|
+
*/
|
|
122
|
+
get validity() {
|
|
123
|
+
return this._internals?.validity;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets whether the element will be validated
|
|
127
|
+
*/
|
|
128
|
+
get willValidate() {
|
|
129
|
+
return this._internals?.willValidate ?? false;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Checks validity and reports to the user
|
|
133
|
+
*/
|
|
134
|
+
reportValidity() {
|
|
135
|
+
return this._internals?.reportValidity() ?? true;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Checks validity without reporting
|
|
139
|
+
*/
|
|
140
|
+
checkValidity() {
|
|
141
|
+
return this._internals?.checkValidity() ?? true;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Sets a custom validity message
|
|
145
|
+
*/
|
|
146
|
+
setCustomValidity(message) {
|
|
147
|
+
if (this._internals && this.field) {
|
|
148
|
+
if (message) {
|
|
149
|
+
this._internals.setValidity({ customError: true }, message, this.field);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this._internals.setValidity({});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
constructor() {
|
|
157
|
+
super();
|
|
158
|
+
/**
|
|
159
|
+
* @protected
|
|
160
|
+
* @internal
|
|
161
|
+
* Stores the value for the `value` getter and setter.
|
|
162
|
+
*/
|
|
163
|
+
this.internalValue = '';
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
* Stores the initial value for form reset functionality
|
|
167
|
+
*/
|
|
168
|
+
this.defaultValue = '';
|
|
169
|
+
/**
|
|
170
|
+
* Provides form element state to descendants via context.
|
|
171
|
+
* Useful for nested components that need to react to form state.
|
|
172
|
+
*/
|
|
173
|
+
this._formState = {
|
|
174
|
+
value: '',
|
|
175
|
+
disabled: false,
|
|
176
|
+
required: false,
|
|
177
|
+
isError: false,
|
|
178
|
+
isSuccess: false,
|
|
179
|
+
};
|
|
180
|
+
this._internals = this.attachInternals();
|
|
181
|
+
}
|
|
93
182
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* Updates the form state context for descendant consumption
|
|
127
|
-
*/
|
|
128
|
-
updateFormState() {
|
|
129
|
-
this._formState = {
|
|
130
|
-
value: this.internalValue,
|
|
131
|
-
disabled: this.disabled ?? !1,
|
|
132
|
-
required: this.required ?? !1,
|
|
133
|
-
isError: this.isError ?? !1,
|
|
134
|
-
isSuccess: this.isSuccess ?? !1,
|
|
135
|
-
name: this.name
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Updates the actual field element's value
|
|
140
|
-
*/
|
|
141
|
-
updateField() {
|
|
142
|
-
this.field && this.internalValue !== void 0 && (this.field.value = this.internalValue ?? "");
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Lifecycle hook called after first render
|
|
146
|
-
*/
|
|
147
|
-
firstUpdated() {
|
|
148
|
-
this.type !== "checkbox" && this.type !== "radio" && (this.defaultValue = this.value || this.getAttribute("value") || ""), this.updateField(), this.updateFormState();
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Called when properties change
|
|
152
|
-
*/
|
|
153
|
-
updated(t) {
|
|
154
|
-
super.updated(t), (t.has("disabled") || t.has("required") || t.has("isError") || t.has("isSuccess") || t.has("name")) && this.updateFormState();
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Form lifecycle callback - called when the form is reset
|
|
158
|
-
*/
|
|
159
|
-
formResetCallback() {
|
|
160
|
-
this.value = this.defaultValue, this.updateField();
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Form lifecycle callback - called when the element is disabled via fieldset
|
|
164
|
-
*/
|
|
165
|
-
formDisabledCallback(t) {
|
|
166
|
-
this.disabled = t;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Form lifecycle callback - called when form state is restored
|
|
170
|
-
*/
|
|
171
|
-
formStateRestoreCallback(t, s) {
|
|
172
|
-
typeof t == "string" && (this.value = t);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Gets the form associated with this element
|
|
176
|
-
*/
|
|
177
|
-
get form() {
|
|
178
|
-
return this._internals?.form ?? null;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Gets the validation message
|
|
182
|
-
*/
|
|
183
|
-
get validationMessage() {
|
|
184
|
-
return this._internals?.validationMessage ?? "";
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Gets the validity state
|
|
188
|
-
*/
|
|
189
|
-
get validity() {
|
|
190
|
-
return this._internals?.validity;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Gets whether the element will be validated
|
|
194
|
-
*/
|
|
195
|
-
get willValidate() {
|
|
196
|
-
return this._internals?.willValidate ?? !1;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Checks validity and reports to the user
|
|
200
|
-
*/
|
|
201
|
-
reportValidity() {
|
|
202
|
-
return this._internals?.reportValidity() ?? !0;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Checks validity without reporting
|
|
206
|
-
*/
|
|
207
|
-
checkValidity() {
|
|
208
|
-
return this._internals?.checkValidity() ?? !0;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Sets a custom validity message
|
|
212
|
-
*/
|
|
213
|
-
setCustomValidity(t) {
|
|
214
|
-
this._internals && this.field && (t ? this._internals.setValidity({ customError: !0 }, t, this.field) : this._internals.setValidity({}));
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
c.formAssociated = !0;
|
|
218
|
-
let o = c;
|
|
219
|
-
u([
|
|
220
|
-
p({ context: m })
|
|
221
|
-
], o.prototype, "_internals", 2);
|
|
222
|
-
u([
|
|
223
|
-
p({ context: y })
|
|
224
|
-
], o.prototype, "_formState", 2);
|
|
225
|
-
u([
|
|
226
|
-
h()
|
|
227
|
-
], o.prototype, "name", 2);
|
|
228
|
-
u([
|
|
229
|
-
h({ type: Boolean, reflect: !0 })
|
|
230
|
-
], o.prototype, "disabled", 2);
|
|
231
|
-
u([
|
|
232
|
-
h({ type: Boolean, reflect: !0 })
|
|
233
|
-
], o.prototype, "required", 2);
|
|
234
|
-
u([
|
|
235
|
-
h({ type: Boolean, reflect: !0 })
|
|
236
|
-
], o.prototype, "isError", 2);
|
|
237
|
-
u([
|
|
238
|
-
h({ type: Boolean, reflect: !0 })
|
|
239
|
-
], o.prototype, "isSuccess", 2);
|
|
240
|
-
u([
|
|
241
|
-
h()
|
|
242
|
-
], o.prototype, "value", 1);
|
|
243
|
-
export {
|
|
244
|
-
o as Cre8FormElement,
|
|
245
|
-
o as default
|
|
246
|
-
};
|
|
183
|
+
/**
|
|
184
|
+
* @internal
|
|
185
|
+
* Tells the browser to treat the element like a form field.
|
|
186
|
+
* Ties the element to the HTML form it is in.
|
|
187
|
+
*/
|
|
188
|
+
Cre8FormElement.formAssociated = true;
|
|
189
|
+
__decorate([
|
|
190
|
+
provide({ context: formInternalsContext })
|
|
191
|
+
], Cre8FormElement.prototype, "_internals", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
provide({ context: formStateContext })
|
|
194
|
+
], Cre8FormElement.prototype, "_formState", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
property()
|
|
197
|
+
], Cre8FormElement.prototype, "name", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
property({ type: Boolean, reflect: true })
|
|
200
|
+
], Cre8FormElement.prototype, "disabled", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
property({ type: Boolean, reflect: true })
|
|
203
|
+
], Cre8FormElement.prototype, "required", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
property({ type: Boolean, reflect: true })
|
|
206
|
+
], Cre8FormElement.prototype, "isError", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: Boolean, reflect: true })
|
|
209
|
+
], Cre8FormElement.prototype, "isSuccess", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property()
|
|
212
|
+
], Cre8FormElement.prototype, "value", null);
|
|
213
|
+
export default Cre8FormElement;
|
|
214
|
+
//# sourceMappingURL=cre8-form-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cre8-form-element.js","sourceRoot":"","sources":["../../components/cre8-form-element.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAGnB,MAAM,mCAAmC,CAAC;AAI3C;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,WAAW;IAkFrD;;OAEG;IAEH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,KAAK,CAAC,QAAgB;QACtB,MAAM,QAAQ,GAAG,I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AAC;iDACxB;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACxB;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACzB;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACvB;AAMpB;IADC,QAAQ,EAAE;4CAGV;AAiKL,eAAe,eAAe,CAAC","sourcesContent":["import { property } from 'lit/decorators.js';\nimport { provide } from '@lit/context';\nimport { Cre8Element } from './cre8-element';\nimport {\n formInternalsContext,\n formStateContext,\n type Cre8ElementInternals,\n type FormElementState\n} from './contexts/form-internals-context';\n\nexport { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context';\n\n/**\n * Base class for form-associated custom elements.\n * Provides ElementInternals context to descendant components.\n */\nexport abstract class Cre8FormElement extends Cre8Element {\n /**\n * @internal\n * Tells the browser to treat the element like a form field.\n * Ties the element to the HTML form it is in.\n */\n static formAssociated = true;\n\n /**\n * The type of form control (text, checkbox, radio, etc.)\n */\n abstract type: string;\n\n /**\n * @protected\n * @internal\n * Stores the value for the `value` getter and setter.\n */\n protected internalValue: string = '';\n\n /**\n * The underlying HTML form field element.\n * Should be implemented with `@query` in extending classes.\n */\n protected field?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement;\n\n /**\n * @internal\n * Stores the initial value for form reset functionality\n */\n protected defaultValue: string | boolean = '';\n\n /**\n * Provides ElementInternals to descendant components via context.\n * Descendants can consume this to access form participation APIs.\n */\n @provide({ context: formInternalsContext })\n _internals: Cre8ElementInternals;\n\n /**\n * Provides form element state to descendants via context.\n * Useful for nested components that need to react to form state.\n */\n @provide({ context: formStateContext })\n _formState: FormElementState = {\n value: '',\n disabled: false,\n required: false,\n isError: false,\n isSuccess: false,\n };\n\n /**\n * The name of the form field\n */\n @property()\n name?: string;\n\n /**\n * Whether the field is disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled?: boolean;\n\n /**\n * Whether the field is required\n */\n @property({ type: Boolean, reflect: true })\n required?: boolean;\n\n /**\n * Whether the field is in an error state\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * Whether the field is in a success state\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * The value of the form field.\n */\n @property()\n get value(): string {\n return this.internalValue;\n }\n\n /**\n * Sets the value of the form field.\n * 1. Stores the new value so it can be retrieved by the getter.\n * 2. Sets the current value of the control via ElementInternals.\n * 3. Updates the actual field element.\n * 4. Updates the form state context.\n * 5. Triggers a re-render.\n */\n set value(newValue: string) {\n const oldValue = this.value;\n this.internalValue = newValue;\n\n // Update form value for non-checkbox/radio types\n if (this.type !== 'checkbox' && this.type !== 'radio') {\n this._internals?.setFormValue(newValue);\n }\n\n this.updateField();\n this.updateFormState();\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Updates the form state context for descendant consumption\n */\n protected updateFormState(): void {\n this._formState = {\n value: this.internalValue,\n disabled: this.disabled ?? false,\n required: this.required ?? false,\n isError: this.isError ?? false,\n isSuccess: this.isSuccess ?? false,\n name: this.name,\n };\n }\n\n /**\n * Updates the actual field element's value\n */\n protected updateField(): void {\n if (this.field && this.internalValue !== undefined) {\n this.field.value = this.internalValue ?? '';\n }\n }\n\n /**\n * Lifecycle hook called after first render\n */\n protected firstUpdated(): void {\n if (this.type !== 'checkbox' && this.type !== 'radio') {\n this.defaultValue = this.value || this.getAttribute('value') || '';\n }\n this.updateField();\n this.updateFormState();\n }\n\n /**\n * Called when properties change\n */\n protected updated(changedProperties: Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n\n // Update form state context when relevant properties change\n if (\n changedProperties.has('disabled') ||\n changedProperties.has('required') ||\n changedProperties.has('isError') ||\n changedProperties.has('isSuccess') ||\n changedProperties.has('name')\n ) {\n this.updateFormState();\n }\n }\n\n /**\n * Form lifecycle callback - called when the form is reset\n */\n formResetCallback(): void {\n this.value = this.defaultValue as string;\n this.updateField();\n }\n\n /**\n * Form lifecycle callback - called when the element is disabled via fieldset\n */\n formDisabledCallback(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Form lifecycle callback - called when form state is restored\n */\n formStateRestoreCallback(state: string | FormData | null, _mode: 'restore' | 'autocomplete'): void {\n if (typeof state === 'string') {\n this.value = state;\n }\n }\n\n /**\n * Gets the form associated with this element\n */\n get form(): HTMLFormElement | null {\n return this._internals?.form ?? null;\n }\n\n /**\n * Gets the validation message\n */\n get validationMessage(): string {\n return this._internals?.validationMessage ?? '';\n }\n\n /**\n * Gets the validity state\n */\n get validity(): ValidityState | undefined {\n return this._internals?.validity;\n }\n\n /**\n * Gets whether the element will be validated\n */\n get willValidate(): boolean {\n return this._internals?.willValidate ?? false;\n }\n\n /**\n * Checks validity and reports to the user\n */\n reportValidity(): boolean {\n return this._internals?.reportValidity() ?? true;\n }\n\n /**\n * Checks validity without reporting\n */\n checkValidity(): boolean {\n return this._internals?.checkValidity() ?? true;\n }\n\n /**\n * Sets a custom validity message\n */\n setCustomValidity(message: string): void {\n if (this._internals && this.field) {\n if (message) {\n this._internals.setValidity({ customError: true }, message, this.field);\n } else {\n this._internals.setValidity({});\n }\n }\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals() as Cre8ElementInternals;\n }\n}\n\nexport default Cre8FormElement;\n"]}
|