@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.8
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/README.md +1 -1
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-32L2QYWQ.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/chunk-55PUDL7D.js +109 -0
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-AH2SKZ7T.js} +14 -1
- package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
- package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
- package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
- package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-LD35BFNK.js} +18 -17
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
- package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
- package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +6 -6
- package/dist/cdn/components/eun-badge.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +2 -2
- package/dist/cdn/components/eun-card.js +4 -4
- package/dist/cdn/components/eun-carousel.js +26 -22
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +11 -8
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +74 -69
- package/dist/cdn/components/eun-counter.js +16 -14
- package/dist/cdn/components/eun-date-picker.js +67 -63
- package/dist/cdn/components/eun-description-list.js +2 -2
- package/dist/cdn/components/eun-divider.js +3 -3
- package/dist/cdn/components/eun-drawer.js +21 -22
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +2 -2
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +10 -10
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +21 -21
- package/dist/cdn/components/eun-input-phone.js +16 -12
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +33 -23
- package/dist/cdn/components/eun-pagination.js +16 -16
- package/dist/cdn/components/eun-password-strength.js +14 -10
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +11 -8
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +276 -0
- package/dist/cdn/components/eun-scheduler-event-editor.js +11 -11
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +28 -28
- package/dist/cdn/components/eun-search.js +36 -32
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +73 -26
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +3 -3
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +5 -4
- package/dist/cdn/components/eun-stepper.js +30 -30
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +4 -4
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +36 -28
- package/dist/cdn/components/eun-time-picker.js +31 -28
- package/dist/cdn/components/eun-toast.js +24 -15
- package/dist/cdn/components/eun-toggle-group.js +75 -37
- package/dist/cdn/components/eun-toggle-item.js +9 -9
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +22 -22
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +4 -3
- package/dist/components/action/button/button.js +6 -9
- package/dist/components/action/button/button.styles.js +13 -8
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +16 -13
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +18 -3
- package/dist/components/action/toggle/toggle-group.styles.js +58 -20
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/alert/alert/alert.d.ts +9 -7
- package/dist/components/alert/alert/alert.js +11 -14
- package/dist/components/alert/alert/alert.styles.js +9 -2
- package/dist/components/alert/drawer/drawer.d.ts +30 -5
- package/dist/components/alert/drawer/drawer.js +48 -13
- package/dist/components/alert/drawer/drawer.styles.js +7 -7
- package/dist/components/alert/modal/modal.d.ts +35 -10
- package/dist/components/alert/modal/modal.js +55 -28
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +12 -15
- package/dist/components/alert/toast/toast.styles.js +18 -9
- package/dist/components/content/badge/badge.js +2 -2
- package/dist/components/content/card/card.js +1 -1
- package/dist/components/content/card/card.styles.js +2 -2
- package/dist/components/content/chip/chip.d.ts +4 -4
- package/dist/components/content/chip/chip.js +11 -10
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/description-list/description-list.js +3 -3
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.js +3 -0
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -0
- package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
- package/dist/components/content/image-carousel/image-carousel.js +29 -28
- package/dist/components/content/password-strength/password-strength.d.ts +21 -6
- package/dist/components/content/password-strength/password-strength.js +37 -16
- package/dist/components/content/password-strength/password-strength.styles.js +4 -0
- package/dist/components/content/tag/tag.js +2 -2
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +31 -15
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/checkbox/check-card.d.ts +1 -0
- package/dist/components/form/checkbox/check-card.js +1 -0
- package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
- package/dist/components/form/checkbox/checkbox-list.js +39 -10
- package/dist/components/form/checkbox/checkbox.d.ts +1 -0
- package/dist/components/form/checkbox/checkbox.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +3 -2
- package/dist/components/form/color-picker/color-picker.d.ts +47 -28
- package/dist/components/form/color-picker/color-picker.js +73 -51
- package/dist/components/form/color-picker/color-picker.styles.js +14 -1
- package/dist/components/form/counter/counter.d.ts +24 -18
- package/dist/components/form/counter/counter.js +61 -61
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +33 -7
- package/dist/components/form/date-picker/date-picker.js +82 -56
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +43 -39
- package/dist/components/form/input/input.js +91 -110
- package/dist/components/form/input-file/input-file.d.ts +26 -13
- package/dist/components/form/input-file/input-file.js +35 -35
- package/dist/components/form/input-file/input-file.styles.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +28 -5
- package/dist/components/form/input-phone/input-phone.js +47 -13
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/radio/radio-card.d.ts +1 -0
- package/dist/components/form/radio/radio-card.js +1 -0
- package/dist/components/form/radio/radio-list.d.ts +23 -7
- package/dist/components/form/radio/radio-list.js +47 -22
- package/dist/components/form/radio/radio.d.ts +1 -0
- package/dist/components/form/radio/radio.js +1 -0
- package/dist/components/form/rating/rating.d.ts +349 -0
- package/dist/components/form/rating/rating.js +665 -0
- package/dist/components/form/rating/rating.styles.d.ts +1 -0
- package/dist/components/form/rating/rating.styles.js +213 -0
- package/dist/components/form/search/search.d.ts +72 -18
- package/dist/components/form/search/search.js +135 -72
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +29 -10
- package/dist/components/form/select/select.js +65 -41
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +15 -1
- package/dist/components/form/slider/slider.d.ts +7 -8
- package/dist/components/form/slider/slider.js +9 -12
- package/dist/components/form/switch/switch.d.ts +1 -0
- package/dist/components/form/switch/switch.js +1 -0
- package/dist/components/form/textarea/textarea.d.ts +90 -23
- package/dist/components/form/textarea/textarea.js +194 -44
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
- package/dist/components/form/time-picker/time-picker-columns.js +8 -8
- package/dist/components/form/time-picker/time-picker.d.ts +30 -9
- package/dist/components/form/time-picker/time-picker.js +66 -40
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +3 -2
- package/dist/components/layout/animate/animate.styles.js +2 -2
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.styles.js +1 -1
- package/dist/components/loader/loader/loader.js +2 -2
- package/dist/components/loader/loader/loader.styles.js +14 -12
- package/dist/components/loader/skeleton/skeleton.js +1 -1
- package/dist/components/navigation/carousel/carousel.d.ts +32 -9
- package/dist/components/navigation/carousel/carousel.js +88 -41
- package/dist/components/navigation/carousel/carousel.styles.js +10 -6
- package/dist/components/navigation/pagination/pagination.d.ts +23 -21
- package/dist/components/navigation/pagination/pagination.js +30 -53
- package/dist/components/navigation/sidebar/sidebar.d.ts +113 -65
- package/dist/components/navigation/sidebar/sidebar.js +161 -118
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +74 -24
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +15 -26
- package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
- package/dist/components/navigation/toolbar/toolbar.d.ts +23 -13
- package/dist/components/navigation/toolbar/toolbar.js +28 -35
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/calendar/calendar.js +1 -1
- package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
- package/dist/features/scheduler/scheduler/scheduler.js +15 -24
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +7 -8
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/i18n/en.d.ts +68 -0
- package/dist/i18n/en.js +68 -0
- package/dist/i18n/fr.js +68 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +9 -6
- package/dist/mixins/check.mixin.js +11 -10
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/disabled.mixin.d.ts +5 -0
- package/dist/mixins/disabled.mixin.js +21 -1
- package/dist/mixins/editable.mixin.js +28 -5
- package/dist/mixins/field-appearance.mixin.js +3 -2
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/form.mixin.d.ts +4 -0
- package/dist/mixins/form.mixin.js +87 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -1
- package/dist/mixins/localizable.mixin.js +1 -1
- package/dist/mixins/radio.mixin.js +11 -10
- package/dist/mixins/readonly.mixin.d.ts +2 -1
- package/dist/mixins/readonly.mixin.js +10 -3
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/alert-ssr.css +187 -0
- package/dist/ssr/badge-ssr.css +67 -0
- package/dist/ssr/breadcrumb-ssr.css +41 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +247 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +250 -0
- package/dist/ssr/collapse-ssr.css +180 -0
- package/dist/ssr/field-ssr.css +202 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +34 -0
- package/dist/ssr/links-ssr.css +44 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +102 -3
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +233 -0
- package/dist/ssr/toolbar-ssr.css +81 -2
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +26 -7
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
- package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
- package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
- package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
- package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
- package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
- package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
|
+
import { EunomiaDialogInitialFocus } from "../../../mixins/dialog-surface.mixin.js";
|
|
2
3
|
import { ButtonColor } from "../../../mixins/button.mixin.js";
|
|
3
4
|
import { EunomiaModalConfirmColor } from "../../../types/variant.type.js";
|
|
4
5
|
/**
|
|
5
6
|
* Tag name of the modal component.
|
|
6
7
|
*/
|
|
7
8
|
export declare const EunomiaModalTagName = "eun-modal";
|
|
8
|
-
declare const EunomiaModal_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & typeof LitElement;
|
|
9
|
+
declare const EunomiaModal_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
9
10
|
/**
|
|
10
11
|
* A generic, reusable dialog template. Arbitrary content is passed through
|
|
11
12
|
* the default slot. Confirm and cancel are exposed as public methods and
|
|
@@ -31,12 +32,13 @@ declare const EunomiaModal_base: import("../../../utils/constructor.type.js").Co
|
|
|
31
32
|
* @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the dialog requests a close, subject to the dirty gate
|
|
32
33
|
* @prop {boolean} [dirty=false] - Marks the modal as having unsaved changes, requiring confirmation before any close attempt succeeds
|
|
33
34
|
* @prop {boolean} [hideActions=false] - Hides the default confirm and cancel footer entirely, for fully custom content-driven dialogs
|
|
35
|
+
* @prop {'auto' | 'first-field'} [initialFocus='auto'] - Where focus lands on open. First-field focuses the first focusable element of the body when the modal was opened from the keyboard, and behaves like auto after a click or a touch, so a mobile virtual keyboard doesn't pop up on its own. A slotted autofocus element always wins
|
|
34
36
|
* @prop {boolean} [closeable=true] - Shows the close button in the top right corner
|
|
35
|
-
* @prop {string} [cancelLabel
|
|
36
|
-
* @prop {string} [confirmLabel
|
|
37
|
+
* @prop {string} [cancelLabel] - The label of the default cancel button. Defaults to the localized string for the current locale (English: "Cancel")
|
|
38
|
+
* @prop {string} [confirmLabel] - The label of the default confirm button. Defaults to the localized string for the current locale (English: "Confirm")
|
|
37
39
|
* @prop {'primary' | 'critical'} [confirmColor='primary'] - The color of the default confirm button
|
|
38
40
|
* @prop {'primary' | 'secondary' | 'critical' | 'success' | 'warning'} cancelColor - The color of the default cancel button. Left unset, it renders as a neutral gray ghost button
|
|
39
|
-
* @prop {string}
|
|
41
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
40
42
|
* @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
41
43
|
* @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
42
44
|
* @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
|
|
@@ -53,6 +55,7 @@ declare const EunomiaModal_base: import("../../../utils/constructor.type.js").Co
|
|
|
53
55
|
* @cssprop [--modal-padding] - Sets the padding of the dialog panel
|
|
54
56
|
* @cssprop [--modal-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
55
57
|
* @cssprop [--modal-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
58
|
+
* @cssprop [--modal-close-offset] - Sets the distance from the top and inline-end edges of the dialog panel to the close button, aligned on the panel padding by default
|
|
56
59
|
* @cssprop [--modal-gap] - Sets the gap between the heading, body, and actions blocks
|
|
57
60
|
* @cssprop [--modal-border-radius] - Sets the corner radius of the dialog panel
|
|
58
61
|
* @cssprop [--modal-background] - Sets the background color of the dialog panel
|
|
@@ -108,6 +111,21 @@ export declare class EunomiaModal extends EunomiaModal_base {
|
|
|
108
111
|
* @default false
|
|
109
112
|
*/
|
|
110
113
|
hideActions: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Where focus lands on open. `auto` keeps the default target described
|
|
116
|
+
* on {@link focusInitialElement}. `first-field` focuses the first
|
|
117
|
+
* focusable element of the body when the modal was opened from the
|
|
118
|
+
* keyboard, and behaves like `auto` after a click or a touch, so a
|
|
119
|
+
* mobile virtual keyboard doesn't pop up on its own. A slotted
|
|
120
|
+
* `[autofocus]` element always wins.
|
|
121
|
+
* @default auto
|
|
122
|
+
*/
|
|
123
|
+
initialFocus: EunomiaDialogInitialFocus;
|
|
124
|
+
/**
|
|
125
|
+
* The body wrapping the default slot, searched by `initial-focus="first-field"`.
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
private readonly bodyEl?;
|
|
111
129
|
/**
|
|
112
130
|
* Shows the top-right close (X) button.
|
|
113
131
|
* @default true
|
|
@@ -115,14 +133,14 @@ export declare class EunomiaModal extends EunomiaModal_base {
|
|
|
115
133
|
closeable: boolean;
|
|
116
134
|
/**
|
|
117
135
|
* Label of the default cancel button.
|
|
118
|
-
*
|
|
136
|
+
* Falls back to the localized string for the current locale when unset.
|
|
119
137
|
*/
|
|
120
|
-
cancelLabel
|
|
138
|
+
cancelLabel?: string;
|
|
121
139
|
/**
|
|
122
140
|
* Label of the default confirm button.
|
|
123
|
-
*
|
|
141
|
+
* Falls back to the localized string for the current locale when unset.
|
|
124
142
|
*/
|
|
125
|
-
confirmLabel
|
|
143
|
+
confirmLabel?: string;
|
|
126
144
|
/**
|
|
127
145
|
* Color of the default confirm button.
|
|
128
146
|
* @default primary
|
|
@@ -136,9 +154,9 @@ export declare class EunomiaModal extends EunomiaModal_base {
|
|
|
136
154
|
cancelColor?: ButtonColor;
|
|
137
155
|
/**
|
|
138
156
|
* Aria label of the close (X) button.
|
|
139
|
-
*
|
|
157
|
+
* Falls back to the localized string for the current locale when unset.
|
|
140
158
|
*/
|
|
141
|
-
|
|
159
|
+
closeLabel?: string;
|
|
142
160
|
/**
|
|
143
161
|
* Heading of the internal discard-confirmation dialog.
|
|
144
162
|
* @default Discard changes?
|
|
@@ -305,6 +323,13 @@ export declare class EunomiaModal extends EunomiaModal_base {
|
|
|
305
323
|
* @private
|
|
306
324
|
*/
|
|
307
325
|
private readonly stopDialogPropagation;
|
|
326
|
+
/**
|
|
327
|
+
* Focuses the body's first focusable element when `initialFocus` is
|
|
328
|
+
* `first-field` and the latest interaction came from the keyboard.
|
|
329
|
+
* @returns whether an element was focused.
|
|
330
|
+
* @private
|
|
331
|
+
*/
|
|
332
|
+
private focusFirstField;
|
|
308
333
|
/**
|
|
309
334
|
* Focuses the `[autofocus]` slotted element if present, otherwise the
|
|
310
335
|
* cancel button, otherwise the dialog surface itself.
|
|
@@ -11,8 +11,12 @@ import { ConfirmEvent } from "../../../events/confirm.event.js";
|
|
|
11
11
|
import { DialogCancelEvent } from "../../../events/dialog-cancel.event.js";
|
|
12
12
|
import { DirtyCloseEvent } from "../../../events/dirty-close.event.js";
|
|
13
13
|
import { handleDialogCommand } from "../../../utils/command.utils.js";
|
|
14
|
-
import { DialogSurfaceMixin } from "../../../mixins/dialog-surface.mixin.js";
|
|
14
|
+
import { DialogSurfaceMixin, } from "../../../mixins/dialog-surface.mixin.js";
|
|
15
|
+
import { getFocusableElements } from "../../../utils/focusable-elements.utils.js";
|
|
16
|
+
import { isKeyboardModality, trackInputModality, } from "../../../utils/input-modality.utils.js";
|
|
15
17
|
import { modalStyles } from "./modal.styles.js";
|
|
18
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
19
|
+
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
16
20
|
/**
|
|
17
21
|
* Tag name of the modal component.
|
|
18
22
|
*/
|
|
@@ -42,12 +46,13 @@ export const EunomiaModalTagName = "eun-modal";
|
|
|
42
46
|
* @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the dialog requests a close, subject to the dirty gate
|
|
43
47
|
* @prop {boolean} [dirty=false] - Marks the modal as having unsaved changes, requiring confirmation before any close attempt succeeds
|
|
44
48
|
* @prop {boolean} [hideActions=false] - Hides the default confirm and cancel footer entirely, for fully custom content-driven dialogs
|
|
49
|
+
* @prop {'auto' | 'first-field'} [initialFocus='auto'] - Where focus lands on open. First-field focuses the first focusable element of the body when the modal was opened from the keyboard, and behaves like auto after a click or a touch, so a mobile virtual keyboard doesn't pop up on its own. A slotted autofocus element always wins
|
|
45
50
|
* @prop {boolean} [closeable=true] - Shows the close button in the top right corner
|
|
46
|
-
* @prop {string} [cancelLabel
|
|
47
|
-
* @prop {string} [confirmLabel
|
|
51
|
+
* @prop {string} [cancelLabel] - The label of the default cancel button. Defaults to the localized string for the current locale (English: "Cancel")
|
|
52
|
+
* @prop {string} [confirmLabel] - The label of the default confirm button. Defaults to the localized string for the current locale (English: "Confirm")
|
|
48
53
|
* @prop {'primary' | 'critical'} [confirmColor='primary'] - The color of the default confirm button
|
|
49
54
|
* @prop {'primary' | 'secondary' | 'critical' | 'success' | 'warning'} cancelColor - The color of the default cancel button. Left unset, it renders as a neutral gray ghost button
|
|
50
|
-
* @prop {string}
|
|
55
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
51
56
|
* @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
52
57
|
* @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
53
58
|
* @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
|
|
@@ -64,6 +69,7 @@ export const EunomiaModalTagName = "eun-modal";
|
|
|
64
69
|
* @cssprop [--modal-padding] - Sets the padding of the dialog panel
|
|
65
70
|
* @cssprop [--modal-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
66
71
|
* @cssprop [--modal-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
72
|
+
* @cssprop [--modal-close-offset] - Sets the distance from the top and inline-end edges of the dialog panel to the close button, aligned on the panel padding by default
|
|
67
73
|
* @cssprop [--modal-gap] - Sets the gap between the heading, body, and actions blocks
|
|
68
74
|
* @cssprop [--modal-border-radius] - Sets the corner radius of the dialog panel
|
|
69
75
|
* @cssprop [--modal-background] - Sets the background color of the dialog panel
|
|
@@ -73,7 +79,7 @@ export const EunomiaModalTagName = "eun-modal";
|
|
|
73
79
|
* @cssprop [--modal-search-top] - For the search kind only, sets the fixed distance from the top of the viewport to the dialog, since a search dialog never vertically centers and its top edge shouldn't drift as content grows or shrinks
|
|
74
80
|
* @element eun-modal
|
|
75
81
|
*/
|
|
76
|
-
let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
82
|
+
let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LocalizableMixin(LitElement)) {
|
|
77
83
|
constructor() {
|
|
78
84
|
super(...arguments);
|
|
79
85
|
/**
|
|
@@ -106,31 +112,26 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
106
112
|
* @default false
|
|
107
113
|
*/
|
|
108
114
|
this.hideActions = false;
|
|
115
|
+
/**
|
|
116
|
+
* Where focus lands on open. `auto` keeps the default target described
|
|
117
|
+
* on {@link focusInitialElement}. `first-field` focuses the first
|
|
118
|
+
* focusable element of the body when the modal was opened from the
|
|
119
|
+
* keyboard, and behaves like `auto` after a click or a touch, so a
|
|
120
|
+
* mobile virtual keyboard doesn't pop up on its own. A slotted
|
|
121
|
+
* `[autofocus]` element always wins.
|
|
122
|
+
* @default auto
|
|
123
|
+
*/
|
|
124
|
+
this.initialFocus = "auto";
|
|
109
125
|
/**
|
|
110
126
|
* Shows the top-right close (X) button.
|
|
111
127
|
* @default true
|
|
112
128
|
*/
|
|
113
129
|
this.closeable = true;
|
|
114
|
-
/**
|
|
115
|
-
* Label of the default cancel button.
|
|
116
|
-
* @default Cancel
|
|
117
|
-
*/
|
|
118
|
-
this.cancelLabel = "Cancel";
|
|
119
|
-
/**
|
|
120
|
-
* Label of the default confirm button.
|
|
121
|
-
* @default Confirm
|
|
122
|
-
*/
|
|
123
|
-
this.confirmLabel = "Confirm";
|
|
124
130
|
/**
|
|
125
131
|
* Color of the default confirm button.
|
|
126
132
|
* @default primary
|
|
127
133
|
*/
|
|
128
134
|
this.confirmColor = "primary";
|
|
129
|
-
/**
|
|
130
|
-
* Aria label of the close (X) button.
|
|
131
|
-
* @default Close
|
|
132
|
-
*/
|
|
133
|
-
this.ariaLabelClose = "Close";
|
|
134
135
|
/**
|
|
135
136
|
* Heading of the internal discard-confirmation dialog.
|
|
136
137
|
* @default Discard changes?
|
|
@@ -262,6 +263,7 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
262
263
|
*/
|
|
263
264
|
connectedCallback() {
|
|
264
265
|
super.connectedCallback?.();
|
|
266
|
+
trackInputModality();
|
|
265
267
|
this.addEventListener("command", this.handleCommandEvent);
|
|
266
268
|
}
|
|
267
269
|
/**
|
|
@@ -365,6 +367,20 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
365
367
|
this.dirty = false;
|
|
366
368
|
this.cancel();
|
|
367
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Focuses the body's first focusable element when `initialFocus` is
|
|
372
|
+
* `first-field` and the latest interaction came from the keyboard.
|
|
373
|
+
* @returns whether an element was focused.
|
|
374
|
+
* @private
|
|
375
|
+
*/
|
|
376
|
+
focusFirstField() {
|
|
377
|
+
if (this.initialFocus !== "first-field" || !isKeyboardModality()) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
const [first] = this.bodyEl ? getFocusableElements(this.bodyEl) : [];
|
|
381
|
+
first?.focus();
|
|
382
|
+
return first !== undefined;
|
|
383
|
+
}
|
|
368
384
|
/**
|
|
369
385
|
* Focuses the `[autofocus]` slotted element if present, otherwise the
|
|
370
386
|
* cancel button, otherwise the dialog surface itself.
|
|
@@ -376,6 +392,9 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
376
392
|
autofocusTarget.focus();
|
|
377
393
|
return;
|
|
378
394
|
}
|
|
395
|
+
if (this.focusFirstField()) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
379
398
|
if (!this.hideActions) {
|
|
380
399
|
this.cancelButtonEl?.focus();
|
|
381
400
|
return;
|
|
@@ -449,7 +468,7 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
449
468
|
appearance="ghost"
|
|
450
469
|
rounded
|
|
451
470
|
size="xs"
|
|
452
|
-
aria-label=${this.
|
|
471
|
+
aria-label=${this.closeLabel ?? this.dictionary.common.close}
|
|
453
472
|
@click=${() => this.requestClose()}
|
|
454
473
|
>
|
|
455
474
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -469,12 +488,14 @@ let EunomiaModal = class EunomiaModal extends DialogSurfaceMixin(LitElement) {
|
|
|
469
488
|
appearance="ghost"
|
|
470
489
|
color=${ifDefined(this.cancelColor)}
|
|
471
490
|
@click=${() => this.requestClose()}
|
|
472
|
-
>${this.cancelLabel
|
|
491
|
+
>${this.cancelLabel ??
|
|
492
|
+
this.dictionary.common.cancel}</eun-button
|
|
473
493
|
>
|
|
474
494
|
<eun-button
|
|
475
495
|
color=${this.confirmColor}
|
|
476
496
|
@click=${() => this.confirm()}
|
|
477
|
-
>${this.confirmLabel
|
|
497
|
+
>${this.confirmLabel ??
|
|
498
|
+
this.dictionary.common.confirm}</eun-button
|
|
478
499
|
>
|
|
479
500
|
</slot>
|
|
480
501
|
</div>
|
|
@@ -502,10 +523,10 @@ __decorate([
|
|
|
502
523
|
property()
|
|
503
524
|
], EunomiaModal.prototype, "description", void 0);
|
|
504
525
|
__decorate([
|
|
505
|
-
property({ reflect: true })
|
|
526
|
+
property({ reflect: true, useDefault: true })
|
|
506
527
|
], EunomiaModal.prototype, "kind", void 0);
|
|
507
528
|
__decorate([
|
|
508
|
-
property({
|
|
529
|
+
property({ converter: defaultTrueConverter, attribute: "close-on-backdrop" })
|
|
509
530
|
], EunomiaModal.prototype, "closeOnBackdrop", void 0);
|
|
510
531
|
__decorate([
|
|
511
532
|
property({ type: Boolean, reflect: true })
|
|
@@ -514,7 +535,13 @@ __decorate([
|
|
|
514
535
|
property({ type: Boolean, attribute: "hide-actions" })
|
|
515
536
|
], EunomiaModal.prototype, "hideActions", void 0);
|
|
516
537
|
__decorate([
|
|
517
|
-
property({
|
|
538
|
+
property({ attribute: "initial-focus", reflect: true, useDefault: true })
|
|
539
|
+
], EunomiaModal.prototype, "initialFocus", void 0);
|
|
540
|
+
__decorate([
|
|
541
|
+
query("#body")
|
|
542
|
+
], EunomiaModal.prototype, "bodyEl", void 0);
|
|
543
|
+
__decorate([
|
|
544
|
+
property({ converter: defaultTrueConverter, reflect: true })
|
|
518
545
|
], EunomiaModal.prototype, "closeable", void 0);
|
|
519
546
|
__decorate([
|
|
520
547
|
property({ attribute: "cancel-label" })
|
|
@@ -529,8 +556,8 @@ __decorate([
|
|
|
529
556
|
property({ attribute: "cancel-color" })
|
|
530
557
|
], EunomiaModal.prototype, "cancelColor", void 0);
|
|
531
558
|
__decorate([
|
|
532
|
-
property({ attribute: "
|
|
533
|
-
], EunomiaModal.prototype, "
|
|
559
|
+
property({ attribute: "close-label" })
|
|
560
|
+
], EunomiaModal.prototype, "closeLabel", void 0);
|
|
534
561
|
__decorate([
|
|
535
562
|
property({ attribute: "confirm-close-heading" })
|
|
536
563
|
], EunomiaModal.prototype, "confirmCloseHeading", void 0);
|
|
@@ -8,6 +8,7 @@ import { css } from "lit";
|
|
|
8
8
|
* [--modal-padding] - Set a custom padding to the dialog panel
|
|
9
9
|
* [--modal-padding-block] - Set a custom vertical padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
10
10
|
* [--modal-padding-inline] - Set a custom horizontal padding, as one length applied to both sides. Ignored when --modal-padding is set
|
|
11
|
+
* [--modal-close-offset] - Set a custom distance from the top and inline-end edges of the dialog panel to the close button
|
|
11
12
|
* [--modal-gap] - Set a custom gap between the heading/body/actions blocks
|
|
12
13
|
* [--modal-border-radius] - Set a custom border radius to the dialog panel
|
|
13
14
|
* [--modal-background] - Set a custom background color to the dialog panel
|
|
@@ -19,6 +20,8 @@ import { css } from "lit";
|
|
|
19
20
|
const base = css `
|
|
20
21
|
:host {
|
|
21
22
|
display: contents;
|
|
23
|
+
/* Rendered width of the size="xs" close button. */
|
|
24
|
+
--_closeButtonSize: 26px;
|
|
22
25
|
}
|
|
23
26
|
#surface {
|
|
24
27
|
position: fixed;
|
|
@@ -34,10 +37,8 @@ const base = css `
|
|
|
34
37
|
);
|
|
35
38
|
padding: var(
|
|
36
39
|
--modal-padding,
|
|
37
|
-
var(--modal-padding-block, var(--eun-space-
|
|
40
|
+
var(--modal-padding-block, var(--eun-space-m, 16px))
|
|
38
41
|
var(--modal-padding-inline, var(--eun-space-m, 16px))
|
|
39
|
-
var(--modal-padding-block, var(--eun-space-m, 16px))
|
|
40
|
-
var(--modal-padding-inline, var(--eun-space-l, 32px))
|
|
41
42
|
);
|
|
42
43
|
box-sizing: border-box;
|
|
43
44
|
display: flex;
|
|
@@ -112,8 +113,8 @@ const base = css `
|
|
|
112
113
|
}
|
|
113
114
|
#close-button {
|
|
114
115
|
position: absolute;
|
|
115
|
-
top: var(--eun-space-
|
|
116
|
-
|
|
116
|
+
top: var(--modal-close-offset, var(--eun-space-m, 16px));
|
|
117
|
+
inset-inline-end: var(--modal-close-offset, var(--eun-space-m, 16px));
|
|
117
118
|
z-index: 10;
|
|
118
119
|
}
|
|
119
120
|
#body {
|
|
@@ -133,7 +134,17 @@ const base = css `
|
|
|
133
134
|
}
|
|
134
135
|
#heading {
|
|
135
136
|
margin: 0;
|
|
136
|
-
padding-inline-end:
|
|
137
|
+
padding-inline-end: max(
|
|
138
|
+
0px,
|
|
139
|
+
calc(
|
|
140
|
+
var(--modal-close-offset, var(--eun-space-m, 16px)) +
|
|
141
|
+
var(--_closeButtonSize) +
|
|
142
|
+
var(--eun-space-s, 8px) - var(
|
|
143
|
+
--modal-padding-inline,
|
|
144
|
+
var(--eun-space-m, 16px)
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
);
|
|
137
148
|
font-size: var(--eun-font-size-l, 18px);
|
|
138
149
|
font-weight: var(--eun-font-weight-l, 700);
|
|
139
150
|
color: var(--eun-text-color, #071621);
|
|
@@ -25,6 +25,7 @@ export type EunomiaToastPosition = "top-left" | "top-center" | "top-right" | "ri
|
|
|
25
25
|
* sides) and ignores this.
|
|
26
26
|
*/
|
|
27
27
|
export type EunomiaToastSlide = "vertical" | "horizontal";
|
|
28
|
+
declare const EunomiaToast_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
28
29
|
/**
|
|
29
30
|
* A self-dismissing notification anchored to a screen corner or edge,
|
|
30
31
|
* reporting something that just happened without requiring the user's
|
|
@@ -65,8 +66,8 @@ export type EunomiaToastSlide = "vertical" | "horizontal";
|
|
|
65
66
|
* @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
|
|
66
67
|
* @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
|
|
67
68
|
* @prop {boolean} [closeable=true] - Shows a close button. Always shown when severity is critical, so an error toast is never left with no way to dismiss it
|
|
68
|
-
* @prop {string} [
|
|
69
|
-
* @attr {string} [
|
|
69
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
70
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
70
71
|
* @prop {number} [duration=5000] - Milliseconds before the toast auto-dismisses. Zero, or a critical severity regardless of this value, disables auto-dismiss entirely, requiring a manual close
|
|
71
72
|
* @prop {boolean} [open=true] - Whether the toast is currently shown. Set it to false upfront, or hide it right after inserting, to insert a toast that's already closed
|
|
72
73
|
* @cssprop [--toast-z-index] - Sets the stacking order of the toast
|
|
@@ -90,7 +91,7 @@ export type EunomiaToastSlide = "vertical" | "horizontal";
|
|
|
90
91
|
* @cssprop [--toast-focus-outline-color] - Sets the focus outline color of the close button
|
|
91
92
|
* @element eun-toast
|
|
92
93
|
*/
|
|
93
|
-
export declare class EunomiaToast extends
|
|
94
|
+
export declare class EunomiaToast extends EunomiaToast_base {
|
|
94
95
|
/**
|
|
95
96
|
* Styles to import to the component.
|
|
96
97
|
*
|
|
@@ -152,9 +153,9 @@ export declare class EunomiaToast extends LitElement {
|
|
|
152
153
|
closeable: boolean;
|
|
153
154
|
/**
|
|
154
155
|
* Accessible label of the close button.
|
|
155
|
-
*
|
|
156
|
+
* Falls back to the localized string for the current locale when unset.
|
|
156
157
|
*/
|
|
157
|
-
|
|
158
|
+
closeLabel?: string;
|
|
158
159
|
/**
|
|
159
160
|
* Milliseconds before the toast auto-dismisses. `0` disables auto-dismiss
|
|
160
161
|
* entirely, same as `severity="critical"` regardless of this value.
|
|
@@ -425,3 +426,4 @@ declare global {
|
|
|
425
426
|
[EunomiaToastTagName]: EunomiaToast;
|
|
426
427
|
}
|
|
427
428
|
}
|
|
429
|
+
export {};
|
|
@@ -13,6 +13,8 @@ import { formatRichText } from "../../../utils/rich-text.utils.js";
|
|
|
13
13
|
import { popToast, pushToast } from "../../../utils/toast-stack.utils.js";
|
|
14
14
|
import { resolveIcon } from "../../../utils/severity-icon.utils.js";
|
|
15
15
|
import { toastStyles } from "./toast.styles.js";
|
|
16
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
17
|
+
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
16
18
|
/**
|
|
17
19
|
* Tag name of the toast component.
|
|
18
20
|
*/
|
|
@@ -64,8 +66,8 @@ const EXIT_FALLBACK_MS = 600;
|
|
|
64
66
|
* @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
|
|
65
67
|
* @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
|
|
66
68
|
* @prop {boolean} [closeable=true] - Shows a close button. Always shown when severity is critical, so an error toast is never left with no way to dismiss it
|
|
67
|
-
* @prop {string} [
|
|
68
|
-
* @attr {string} [
|
|
69
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
70
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
69
71
|
* @prop {number} [duration=5000] - Milliseconds before the toast auto-dismisses. Zero, or a critical severity regardless of this value, disables auto-dismiss entirely, requiring a manual close
|
|
70
72
|
* @prop {boolean} [open=true] - Whether the toast is currently shown. Set it to false upfront, or hide it right after inserting, to insert a toast that's already closed
|
|
71
73
|
* @cssprop [--toast-z-index] - Sets the stacking order of the toast
|
|
@@ -89,7 +91,7 @@ const EXIT_FALLBACK_MS = 600;
|
|
|
89
91
|
* @cssprop [--toast-focus-outline-color] - Sets the focus outline color of the close button
|
|
90
92
|
* @element eun-toast
|
|
91
93
|
*/
|
|
92
|
-
let EunomiaToast = class EunomiaToast extends LitElement {
|
|
94
|
+
let EunomiaToast = class EunomiaToast extends LocalizableMixin(LitElement) {
|
|
93
95
|
constructor() {
|
|
94
96
|
super(...arguments);
|
|
95
97
|
/**
|
|
@@ -113,11 +115,6 @@ let EunomiaToast = class EunomiaToast extends LitElement {
|
|
|
113
115
|
* @default true
|
|
114
116
|
*/
|
|
115
117
|
this.closeable = true;
|
|
116
|
-
/**
|
|
117
|
-
* Accessible label of the close button.
|
|
118
|
-
* @default Close
|
|
119
|
-
*/
|
|
120
|
-
this.ariaLabelClose = "Close";
|
|
121
118
|
/**
|
|
122
119
|
* Milliseconds before the toast auto-dismisses. `0` disables auto-dismiss
|
|
123
120
|
* entirely, same as `severity="critical"` regardless of this value.
|
|
@@ -503,7 +500,7 @@ let EunomiaToast = class EunomiaToast extends LitElement {
|
|
|
503
500
|
appearance="ghost"
|
|
504
501
|
rounded
|
|
505
502
|
size="xs"
|
|
506
|
-
aria-label=${this.
|
|
503
|
+
aria-label=${this.closeLabel ?? this.dictionary.common.close}
|
|
507
504
|
@click=${this.handleCloseClick}
|
|
508
505
|
>
|
|
509
506
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -553,10 +550,10 @@ __decorate([
|
|
|
553
550
|
property({ reflect: true })
|
|
554
551
|
], EunomiaToast.prototype, "severity", void 0);
|
|
555
552
|
__decorate([
|
|
556
|
-
property({ reflect: true })
|
|
553
|
+
property({ reflect: true, useDefault: true })
|
|
557
554
|
], EunomiaToast.prototype, "appearance", void 0);
|
|
558
555
|
__decorate([
|
|
559
|
-
property({ reflect: true })
|
|
556
|
+
property({ reflect: true, useDefault: true })
|
|
560
557
|
], EunomiaToast.prototype, "position", void 0);
|
|
561
558
|
__decorate([
|
|
562
559
|
property({ reflect: true })
|
|
@@ -574,16 +571,16 @@ __decorate([
|
|
|
574
571
|
property({ attribute: "rich-text" })
|
|
575
572
|
], EunomiaToast.prototype, "richText", void 0);
|
|
576
573
|
__decorate([
|
|
577
|
-
property({
|
|
574
|
+
property({ converter: defaultTrueConverter, reflect: true })
|
|
578
575
|
], EunomiaToast.prototype, "closeable", void 0);
|
|
579
576
|
__decorate([
|
|
580
|
-
property({ attribute: "
|
|
581
|
-
], EunomiaToast.prototype, "
|
|
577
|
+
property({ attribute: "close-label" })
|
|
578
|
+
], EunomiaToast.prototype, "closeLabel", void 0);
|
|
582
579
|
__decorate([
|
|
583
580
|
property({ type: Number })
|
|
584
581
|
], EunomiaToast.prototype, "duration", void 0);
|
|
585
582
|
__decorate([
|
|
586
|
-
property({
|
|
583
|
+
property({ converter: defaultTrueConverter, reflect: true })
|
|
587
584
|
], EunomiaToast.prototype, "open", void 0);
|
|
588
585
|
__decorate([
|
|
589
586
|
queryAssignedElements({ slot: "description" })
|
|
@@ -49,7 +49,7 @@ const base = css `
|
|
|
49
49
|
visibility 0s linear var(--_transitionDuration);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
:host([open]) {
|
|
52
|
+
:host([open]:not([open="false"])) {
|
|
53
53
|
visibility: visible;
|
|
54
54
|
opacity: 1;
|
|
55
55
|
--_baseX: 0px;
|
|
@@ -60,7 +60,7 @@ const base = css `
|
|
|
60
60
|
visibility 0s linear 0s;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
:host([open][entering]) {
|
|
63
|
+
:host([open]:not([open="false"])[entering]) {
|
|
64
64
|
visibility: hidden;
|
|
65
65
|
opacity: 0;
|
|
66
66
|
--_baseX: var(--_enterX, 0px);
|
|
@@ -81,7 +81,7 @@ const base = css `
|
|
|
81
81
|
--_stackSign: 1;
|
|
82
82
|
--_enterY: -24px;
|
|
83
83
|
}
|
|
84
|
-
:host([position="top-right"]) {
|
|
84
|
+
:host(:is([position="top-right"], :not([position]))) {
|
|
85
85
|
top: var(--_gapEdge);
|
|
86
86
|
right: var(--_gapEdge);
|
|
87
87
|
--_stackSign: 1;
|
|
@@ -126,7 +126,7 @@ const base = css `
|
|
|
126
126
|
--_enterX: -24px;
|
|
127
127
|
--_enterY: 0px;
|
|
128
128
|
}
|
|
129
|
-
:host([position="top-right"][slide="horizontal"]),
|
|
129
|
+
:host(:is([position="top-right"], :not([position]))[slide="horizontal"]),
|
|
130
130
|
:host([position="bottom-right"][slide="horizontal"]) {
|
|
131
131
|
--_enterX: 24px;
|
|
132
132
|
--_enterY: 0px;
|
|
@@ -198,8 +198,14 @@ const base = css `
|
|
|
198
198
|
var(--toast-border-color, var(--_frame, transparent));
|
|
199
199
|
padding: var(
|
|
200
200
|
--toast-padding,
|
|
201
|
-
var(
|
|
202
|
-
|
|
201
|
+
var(
|
|
202
|
+
--toast-padding-block,
|
|
203
|
+
max(0px, calc(var(--eun-space-m, 16px) - var(--_bw)))
|
|
204
|
+
)
|
|
205
|
+
var(
|
|
206
|
+
--toast-padding-inline,
|
|
207
|
+
max(0px, calc(var(--eun-space-m, 16px) - var(--_bw)))
|
|
208
|
+
)
|
|
203
209
|
);
|
|
204
210
|
border-radius: var(--toast-border-radius, var(--eun-border-radius-m, 8px));
|
|
205
211
|
box-shadow: var(
|
|
@@ -221,7 +227,7 @@ const base = css `
|
|
|
221
227
|
grid-column: 1;
|
|
222
228
|
}
|
|
223
229
|
|
|
224
|
-
:host([appearance="default"]) #toast {
|
|
230
|
+
:host(:is([appearance="default"], :not([appearance]))) #toast {
|
|
225
231
|
background: linear-gradient(
|
|
226
232
|
to right,
|
|
227
233
|
var(--toast-border-color, var(--_borderColor)) 4px,
|
|
@@ -307,11 +313,14 @@ const base = css `
|
|
|
307
313
|
--button-text: var(--_onFilled, #fff);
|
|
308
314
|
}
|
|
309
315
|
|
|
310
|
-
:host([closeable]) #toast {
|
|
316
|
+
:host([closeable]:not([closeable="false"])) #toast {
|
|
311
317
|
padding-right: calc(
|
|
312
318
|
var(
|
|
313
319
|
--toast-padding,
|
|
314
|
-
var(
|
|
320
|
+
var(
|
|
321
|
+
--toast-padding-inline,
|
|
322
|
+
max(0px, calc(var(--eun-space-s, 8px) - var(--_bw)))
|
|
323
|
+
)
|
|
315
324
|
) +
|
|
316
325
|
var(--eun-space-l, 32px)
|
|
317
326
|
);
|
|
@@ -128,10 +128,10 @@ let EunomiaBadge = class EunomiaBadge extends LitElement {
|
|
|
128
128
|
*/
|
|
129
129
|
EunomiaBadge.styles = badgeStyles;
|
|
130
130
|
__decorate([
|
|
131
|
-
property({ reflect: true })
|
|
131
|
+
property({ reflect: true, useDefault: true })
|
|
132
132
|
], EunomiaBadge.prototype, "color", void 0);
|
|
133
133
|
__decorate([
|
|
134
|
-
property({ reflect: true })
|
|
134
|
+
property({ reflect: true, useDefault: true })
|
|
135
135
|
], EunomiaBadge.prototype, "size", void 0);
|
|
136
136
|
__decorate([
|
|
137
137
|
property()
|
|
@@ -145,7 +145,7 @@ _EunomiaCard_newTab = new WeakMap();
|
|
|
145
145
|
*/
|
|
146
146
|
EunomiaCard.styles = [cardStyles, cardLinkStyles];
|
|
147
147
|
__decorate([
|
|
148
|
-
property({ reflect: true })
|
|
148
|
+
property({ reflect: true, useDefault: true })
|
|
149
149
|
], EunomiaCard.prototype, "appearance", void 0);
|
|
150
150
|
EunomiaCard = __decorate([
|
|
151
151
|
customElement(EunomiaCardTagName)
|
|
@@ -84,8 +84,8 @@ const base = css `
|
|
|
84
84
|
--_hoverBorderDefault: var(--eun-color-primary-500, #3d6fff);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
:host([appearance="default"]) #card:hover,
|
|
88
|
-
:host([appearance="default"]) #card:focus-visible {
|
|
87
|
+
:host(:is([appearance="default"], :not([appearance]))) #card:hover,
|
|
88
|
+
:host(:is([appearance="default"], :not([appearance]))) #card:focus-visible {
|
|
89
89
|
transform: var(--card-hover-transform, var(--_hoverLift));
|
|
90
90
|
background: var(
|
|
91
91
|
--card-hover-background,
|
|
@@ -70,8 +70,8 @@ declare const EunomiaChip_base: import("../../../utils/constructor.type.js").Con
|
|
|
70
70
|
* @prop {boolean} [rounded=true] - Whether the chip is fully rounded, as a pill
|
|
71
71
|
* @prop {boolean} [removable=true] - Shows the delete button. Clicking it fires the close event without changing the chip's own rendering
|
|
72
72
|
* @prop {boolean} [disabled=false] - Disables the delete button, preventing removal
|
|
73
|
-
* @prop {string} [
|
|
74
|
-
* @attr {string} [
|
|
73
|
+
* @prop {string} [removeLabel] - A prefix combined with the chip's own slotted text to build the delete button's accessible name, such as "Remove Alice Doe", so multiple chips on the same page stay distinguishable to assistive technology. Defaults to the localized string for the current locale (English: "Remove")
|
|
74
|
+
* @attr {string} [remove-label] - A prefix combined with the chip's own slotted text to build the delete button's accessible name. Defaults to the localized string for the current locale (English: "Remove")
|
|
75
75
|
* @prop {string} [locale] - The locale used to resolve the default accessible label of the delete button. Defaults to the runtime's own
|
|
76
76
|
* @cssprop [--chip-background-color] - Sets the background color of the chip, for every appearance, color and severity
|
|
77
77
|
* @cssprop [--chip-border-color] - Sets the border color of the chip, for every appearance, color and severity
|
|
@@ -182,7 +182,7 @@ export declare class EunomiaChip extends EunomiaChip_base {
|
|
|
182
182
|
* unless the consumer overrides it explicitly.
|
|
183
183
|
* @default {i18n:chip.remove}
|
|
184
184
|
*/
|
|
185
|
-
|
|
185
|
+
removeLabel?: string;
|
|
186
186
|
/**
|
|
187
187
|
* The chip's current slotted label text, trimmed ; tracked so the delete
|
|
188
188
|
* button's accessible name can include it (see {@link getRemoveLabel}).
|
|
@@ -224,7 +224,7 @@ export declare class EunomiaChip extends EunomiaChip_base {
|
|
|
224
224
|
private readonly handleRemove;
|
|
225
225
|
/**
|
|
226
226
|
* Builds the delete button's accessible name : the chip's own slotted
|
|
227
|
-
* text appended to `
|
|
227
|
+
* text appended to `removeLabel` (or its locale-resolved fallback),
|
|
228
228
|
* so multiple chips on the same page stay distinguishable from one
|
|
229
229
|
* another by sound alone. Falls back to that prefix alone when there's
|
|
230
230
|
* no label text yet.
|