@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
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
eun-toggle-group:not(:defined) {
|
|
2
|
+
--_toggleRadius: var(
|
|
3
|
+
--toggle-group-border-radius,
|
|
4
|
+
var(--eun-border-radius-m, 8px)
|
|
5
|
+
);
|
|
6
|
+
--_toggleFontSize: var(--eun-font-size-s, 14px);
|
|
7
|
+
--_toggleButtonPaddingBlock: var(--eun-space-s, 8px);
|
|
8
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-l, 32px) / 2);
|
|
9
|
+
--_toggleLineHeight: 1rem;
|
|
10
|
+
--_trackPaddingBlock: var(
|
|
11
|
+
--toggle-group-padding,
|
|
12
|
+
var(
|
|
13
|
+
--toggle-group-padding-block,
|
|
14
|
+
calc(var(--_toggleButtonPaddingBlock) / 2)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
--_toggleOptionPaddingBlock: max(
|
|
18
|
+
0px,
|
|
19
|
+
calc(var(--_toggleButtonPaddingBlock) - var(--_trackPaddingBlock))
|
|
20
|
+
);
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
width: fit-content;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
gap: var(--toggle-group-gap, var(--eun-space-xs, 4px));
|
|
26
|
+
padding: var(--_trackPaddingBlock)
|
|
27
|
+
var(--toggle-group-padding, var(--toggle-group-padding-inline, 4px));
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
border-radius: var(--_toggleRadius);
|
|
30
|
+
background: var(
|
|
31
|
+
--toggle-group-background,
|
|
32
|
+
var(--eun-surface-sunken, #f7f8fa)
|
|
33
|
+
);
|
|
34
|
+
border: var(--eun-border-width-s, 1px) solid
|
|
35
|
+
var(--toggle-group-border-color, var(--eun-color-grey-300, #dee0e7));
|
|
36
|
+
box-shadow: var(--toggle-group-box-shadow, none);
|
|
37
|
+
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
38
|
+
font-size: var(--_toggleFontSize);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
eun-toggle-group[rounded]:not(:defined) {
|
|
42
|
+
--_toggleRadius: var(
|
|
43
|
+
--toggle-group-border-radius,
|
|
44
|
+
var(--eun-border-radius-xl, 999px)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
eun-toggle-group[size="xs"]:not(:defined) {
|
|
49
|
+
--_toggleFontSize: var(--eun-font-size-xs, 10px);
|
|
50
|
+
--_toggleButtonPaddingBlock: var(--eun-space-xxs, 1.6px);
|
|
51
|
+
--_toggleOptionPaddingInline: var(--eun-space-xs, 4px);
|
|
52
|
+
--_toggleLineHeight: 10px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
eun-toggle-group[size="s"]:not(:defined) {
|
|
56
|
+
--_toggleFontSize: var(--eun-font-size-xs, 10px);
|
|
57
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) / 2);
|
|
58
|
+
--_toggleOptionPaddingInline: var(--eun-space-s, 8px);
|
|
59
|
+
--_toggleLineHeight: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
eun-toggle-group[size="l"]:not(:defined) {
|
|
63
|
+
--_toggleFontSize: var(--eun-font-size-m, 16px);
|
|
64
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.25);
|
|
65
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.25);
|
|
66
|
+
--_toggleLineHeight: 1.1rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
eun-toggle-group[size="xl"]:not(:defined) {
|
|
70
|
+
--_toggleFontSize: var(--eun-font-size-l, 1.3rem);
|
|
71
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.5);
|
|
72
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.5);
|
|
73
|
+
--_toggleLineHeight: 1.3rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
eun-toggle-group:is([appearance="outline"], [appearance="flat"]):not(:defined) {
|
|
77
|
+
--_toggleOptionPaddingBlock: var(--_toggleButtonPaddingBlock);
|
|
78
|
+
padding: 0;
|
|
79
|
+
overflow: visible;
|
|
80
|
+
background: var(--toggle-group-background, transparent);
|
|
81
|
+
border: none;
|
|
82
|
+
border-radius: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
eun-toggle-group[full]:not(:defined) {
|
|
86
|
+
display: flex;
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
eun-toggle-group[disabled]:not(:defined) {
|
|
91
|
+
opacity: 0.5;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
eun-toggle-item:not(:defined) {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: var(--eun-space-xs, 4px);
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: var(--_toggleOptionPaddingBlock, calc(var(--eun-space-s, 8px) / 2))
|
|
101
|
+
var(--_toggleOptionPaddingInline, calc(var(--eun-space-l, 32px) / 2));
|
|
102
|
+
border-radius: calc(
|
|
103
|
+
var(--_toggleRadius, var(--eun-border-radius-m, 8px)) - 3px
|
|
104
|
+
);
|
|
105
|
+
color: var(--toggle-group-color, var(--eun-color-grey-600, #666e8a));
|
|
106
|
+
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
107
|
+
font-size: var(--_toggleFontSize, var(--eun-font-size-s, 14px));
|
|
108
|
+
line-height: var(--_toggleLineHeight, 1rem);
|
|
109
|
+
font-weight: var(--eun-font-weight-m, 500);
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
--_customTint: color-mix(
|
|
112
|
+
in srgb,
|
|
113
|
+
var(--toggle-group-active-background) 15%,
|
|
114
|
+
transparent
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
eun-toggle-item:not(:defined) > [slot="icon"] {
|
|
119
|
+
order: -1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:is(
|
|
123
|
+
eun-toggle-group:is([appearance="outline"], [appearance="flat"])
|
|
124
|
+
> eun-toggle-item,
|
|
125
|
+
eun-toggle-item:is([appearance="outline"], [appearance="flat"])
|
|
126
|
+
):not(:defined) {
|
|
127
|
+
border: var(--eun-border-width-s, 1px) solid
|
|
128
|
+
var(--toggle-group-border-color, transparent);
|
|
129
|
+
border-radius: var(--_toggleRadius, var(--eun-border-radius-m, 8px));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:is(
|
|
133
|
+
eun-toggle-group[appearance="outline"] > eun-toggle-item,
|
|
134
|
+
eun-toggle-item[appearance="outline"]
|
|
135
|
+
):not(:defined) {
|
|
136
|
+
border-color: var(
|
|
137
|
+
--toggle-group-border-color,
|
|
138
|
+
var(--eun-color-grey-300, #dee0e7)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:is(eun-toggle-group[full] > eun-toggle-item, eun-toggle-item[full]):not(
|
|
143
|
+
:defined
|
|
144
|
+
) {
|
|
145
|
+
flex: 1 1 0%;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:is(
|
|
150
|
+
eun-toggle-group:not(
|
|
151
|
+
[single],
|
|
152
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
153
|
+
)
|
|
154
|
+
> eun-toggle-item[checked],
|
|
155
|
+
eun-toggle-group:is(
|
|
156
|
+
[single],
|
|
157
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
158
|
+
)
|
|
159
|
+
> eun-toggle-item:nth-child(1 of [checked]),
|
|
160
|
+
eun-toggle-group:is(
|
|
161
|
+
[single],
|
|
162
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
163
|
+
):not([value], :has(> eun-toggle-item[checked]))
|
|
164
|
+
> eun-toggle-item:first-of-type
|
|
165
|
+
):not(:defined) {
|
|
166
|
+
background: var(
|
|
167
|
+
--toggle-group-active-background,
|
|
168
|
+
var(--eun-color-primary-500, #3d6fff)
|
|
169
|
+
);
|
|
170
|
+
color: var(
|
|
171
|
+
--toggle-group-active-color,
|
|
172
|
+
var(--eun-color-on-primary-500, #ffffff)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:is(
|
|
177
|
+
eun-toggle-group:not(
|
|
178
|
+
[single],
|
|
179
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
180
|
+
)
|
|
181
|
+
> eun-toggle-item[checked],
|
|
182
|
+
eun-toggle-group:is(
|
|
183
|
+
[single],
|
|
184
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
185
|
+
)
|
|
186
|
+
> eun-toggle-item:nth-child(1 of [checked]),
|
|
187
|
+
eun-toggle-group:is(
|
|
188
|
+
[single],
|
|
189
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
190
|
+
):not([value], :has(> eun-toggle-item[checked]))
|
|
191
|
+
> eun-toggle-item:first-of-type
|
|
192
|
+
):is(
|
|
193
|
+
eun-toggle-group:is([appearance="outline"], [appearance="flat"])
|
|
194
|
+
> eun-toggle-item,
|
|
195
|
+
eun-toggle-item:is([appearance="outline"], [appearance="flat"])
|
|
196
|
+
):not(:defined) {
|
|
197
|
+
background: var(--_customTint, var(--eun-color-primary-alpha-20, #3d6fff33));
|
|
198
|
+
color: var(
|
|
199
|
+
--toggle-group-active-color,
|
|
200
|
+
var(--toggle-group-active-background, var(--eun-color-primary-500, #3d6fff))
|
|
201
|
+
);
|
|
202
|
+
font-weight: var(--eun-font-weight-b, 700);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:is(
|
|
206
|
+
eun-toggle-group:not(
|
|
207
|
+
[single],
|
|
208
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
209
|
+
)
|
|
210
|
+
> eun-toggle-item[checked],
|
|
211
|
+
eun-toggle-group:is(
|
|
212
|
+
[single],
|
|
213
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
214
|
+
)
|
|
215
|
+
> eun-toggle-item:nth-child(1 of [checked]),
|
|
216
|
+
eun-toggle-group:is(
|
|
217
|
+
[single],
|
|
218
|
+
:has(> eun-toggle-item:nth-of-type(2):last-of-type)
|
|
219
|
+
):not([value], :has(> eun-toggle-item[checked]))
|
|
220
|
+
> eun-toggle-item:first-of-type
|
|
221
|
+
):is(
|
|
222
|
+
eun-toggle-group[appearance="outline"] > eun-toggle-item,
|
|
223
|
+
eun-toggle-item[appearance="outline"]
|
|
224
|
+
):not(:defined) {
|
|
225
|
+
border-color: var(
|
|
226
|
+
--toggle-group-active-background,
|
|
227
|
+
var(--eun-color-primary-500, #3d6fff)
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
eun-toggle-item[disabled]:not(:defined) {
|
|
232
|
+
opacity: 0.5;
|
|
233
|
+
}
|
package/dist/ssr/toolbar-ssr.css
CHANGED
|
@@ -14,12 +14,41 @@ eun-toolbar:not(:defined) {
|
|
|
14
14
|
height: var(--toolbar-height, 72px);
|
|
15
15
|
padding: var(
|
|
16
16
|
--toolbar-padding,
|
|
17
|
-
var(--toolbar-padding-block, 0)
|
|
18
|
-
var(--toolbar-padding-inline, 24px)
|
|
17
|
+
var(--toolbar-padding-block, 0) var(--toolbar-padding-inline, 24px)
|
|
19
18
|
);
|
|
20
19
|
position: sticky;
|
|
21
20
|
top: 0;
|
|
22
21
|
z-index: var(--toolbar-z-index, 100);
|
|
22
|
+
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
23
|
+
background: var(
|
|
24
|
+
--toolbar-background,
|
|
25
|
+
var(--toolbar-background-light, var(--eun-surface-color, #ffffff))
|
|
26
|
+
);
|
|
27
|
+
color: var(
|
|
28
|
+
--toolbar-color,
|
|
29
|
+
var(--toolbar-color-light, var(--eun-text-color, #071621))
|
|
30
|
+
);
|
|
31
|
+
border-block-end: var(--eun-border-width-s, 1px) solid
|
|
32
|
+
var(--toolbar-border-color, var(--eun-border-color, #dee0e7));
|
|
33
|
+
box-shadow: var(--toolbar-shadow, none);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
eun-toolbar[theme="dark"]:not(:defined) {
|
|
37
|
+
background: var(
|
|
38
|
+
--toolbar-background,
|
|
39
|
+
var(--toolbar-background-dark, var(--eun-surface-inverse, #0b1620))
|
|
40
|
+
);
|
|
41
|
+
color: var(
|
|
42
|
+
--toolbar-color,
|
|
43
|
+
var(--toolbar-color-dark, var(--eun-text-on-inverse, #f5f7fa))
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* A page loads scrolled to the top, where the upgraded bar is transparent. */
|
|
48
|
+
eun-toolbar[transparent-at-top]:not(:defined) {
|
|
49
|
+
background: transparent;
|
|
50
|
+
border-color: transparent;
|
|
51
|
+
box-shadow: none;
|
|
23
52
|
}
|
|
24
53
|
|
|
25
54
|
eun-toolbar[position="fixed"]:not(:defined) {
|
|
@@ -77,3 +106,53 @@ eun-toolbar:not(:defined):where(
|
|
|
77
106
|
align-items: center;
|
|
78
107
|
justify-content: flex-end;
|
|
79
108
|
}
|
|
109
|
+
|
|
110
|
+
@media (width < 600px) {
|
|
111
|
+
eun-toolbar[mobile-breakpoint="600"][mobile-hide~="start"]:not(:defined)
|
|
112
|
+
> [slot="start"],
|
|
113
|
+
eun-toolbar[mobile-breakpoint="600"][mobile-hide~="center"]:not(:defined)
|
|
114
|
+
> [slot="center"],
|
|
115
|
+
eun-toolbar[mobile-breakpoint="600"][mobile-hide~="end"]:not(:defined)
|
|
116
|
+
> [slot="end"] {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media (width < 768px) {
|
|
122
|
+
eun-toolbar:not([mobile-breakpoint])[mobile-hide~="start"]:not(:defined)
|
|
123
|
+
> [slot="start"],
|
|
124
|
+
eun-toolbar:not([mobile-breakpoint])[mobile-hide~="center"]:not(:defined)
|
|
125
|
+
> [slot="center"],
|
|
126
|
+
eun-toolbar:not([mobile-breakpoint])[mobile-hide~="end"]:not(:defined)
|
|
127
|
+
> [slot="end"],
|
|
128
|
+
eun-toolbar[mobile-breakpoint="768"][mobile-hide~="start"]:not(:defined)
|
|
129
|
+
> [slot="start"],
|
|
130
|
+
eun-toolbar[mobile-breakpoint="768"][mobile-hide~="center"]:not(:defined)
|
|
131
|
+
> [slot="center"],
|
|
132
|
+
eun-toolbar[mobile-breakpoint="768"][mobile-hide~="end"]:not(:defined)
|
|
133
|
+
> [slot="end"] {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@media (width < 1024px) {
|
|
139
|
+
eun-toolbar[mobile-breakpoint="1024"][mobile-hide~="start"]:not(:defined)
|
|
140
|
+
> [slot="start"],
|
|
141
|
+
eun-toolbar[mobile-breakpoint="1024"][mobile-hide~="center"]:not(:defined)
|
|
142
|
+
> [slot="center"],
|
|
143
|
+
eun-toolbar[mobile-breakpoint="1024"][mobile-hide~="end"]:not(:defined)
|
|
144
|
+
> [slot="end"] {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@media (width < 1280px) {
|
|
150
|
+
eun-toolbar[mobile-breakpoint="1280"][mobile-hide~="start"]:not(:defined)
|
|
151
|
+
> [slot="start"],
|
|
152
|
+
eun-toolbar[mobile-breakpoint="1280"][mobile-hide~="center"]:not(:defined)
|
|
153
|
+
> [slot="center"],
|
|
154
|
+
eun-toolbar[mobile-breakpoint="1280"][mobile-hide~="end"]:not(:defined)
|
|
155
|
+
> [slot="end"] {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -55,6 +55,9 @@ export type EunomiaModalConfirmColor = Extract<EunomiaActionColor, "primary" | "
|
|
|
55
55
|
* (elevated, drop shadow) doesn't share that constraint : it's a static
|
|
56
56
|
* effect, not one gated behind interaction, so `eun-card` also exposes it
|
|
57
57
|
* (see {@link EunomiaCardAppearance}) despite being a passive container.
|
|
58
|
+
* Button-family components spell that pale tinted wash `soft` instead of
|
|
59
|
+
* `default`, since their own default is `fill` : `appearance="default"`
|
|
60
|
+
* on a button would otherwise not render the default.
|
|
58
61
|
* `underline` (a bottom border only) is a form field's own look, and
|
|
59
62
|
* `transparent` (the pale tint, see-through instead of opaque) a scheduler
|
|
60
63
|
* event chip's : each belongs to a single family, like `ghost`.
|
|
@@ -64,7 +67,7 @@ export type EunomiaModalConfirmColor = Extract<EunomiaActionColor, "primary" | "
|
|
|
64
67
|
* (a loader's dots or bar, a skeleton's shape) is a `variant` instead,
|
|
65
68
|
* with values of its own that mean nothing outside that component.
|
|
66
69
|
*/
|
|
67
|
-
export type EunomiaAppearance = "default" | "fill" | "outline" | "flat" | "raised" | "ghost" | "underline" | "transparent";
|
|
70
|
+
export type EunomiaAppearance = "default" | "soft" | "fill" | "outline" | "flat" | "raised" | "ghost" | "underline" | "transparent";
|
|
68
71
|
/**
|
|
69
72
|
* The four-value {@link EunomiaAppearance} subset feedback/display components
|
|
70
73
|
* (alert, toast, chip, tag, tooltip) actually use — no `raised`/`ghost`,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComplexAttributeConverter } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Converter for the boolean attributes that default to `true`. Lit's
|
|
4
|
+
* standard boolean converter only looks at the attribute's presence, the
|
|
5
|
+
* same way native HTML boolean attributes work, so `closeable="false"`
|
|
6
|
+
* would still read as `true`, and nothing declarative (HTML, SSR, JSX)
|
|
7
|
+
* could turn these off. Here the literal `"false"` really means `false`.
|
|
8
|
+
*
|
|
9
|
+
* When reflected, `true` writes an empty attribute and `false` writes
|
|
10
|
+
* `"false"`, rather than removing it : a missing attribute would read back
|
|
11
|
+
* as the `true` default on the next upgrade (SSR output, `cloneNode`), and
|
|
12
|
+
* stylesheets can target the off state with `[attr="false"]`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const defaultTrueConverter: ComplexAttributeConverter<boolean>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converter for the boolean attributes that default to `true`. Lit's
|
|
3
|
+
* standard boolean converter only looks at the attribute's presence, the
|
|
4
|
+
* same way native HTML boolean attributes work, so `closeable="false"`
|
|
5
|
+
* would still read as `true`, and nothing declarative (HTML, SSR, JSX)
|
|
6
|
+
* could turn these off. Here the literal `"false"` really means `false`.
|
|
7
|
+
*
|
|
8
|
+
* When reflected, `true` writes an empty attribute and `false` writes
|
|
9
|
+
* `"false"`, rather than removing it : a missing attribute would read back
|
|
10
|
+
* as the `true` default on the next upgrade (SSR output, `cloneNode`), and
|
|
11
|
+
* stylesheets can target the off state with `[attr="false"]`.
|
|
12
|
+
*/
|
|
13
|
+
export const defaultTrueConverter = {
|
|
14
|
+
fromAttribute(value) {
|
|
15
|
+
return value !== null && value !== "false";
|
|
16
|
+
},
|
|
17
|
+
toAttribute(value) {
|
|
18
|
+
return value ? "" : "false";
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -38,7 +38,7 @@ export interface DropdownMenuContainer extends HTMLElement {
|
|
|
38
38
|
* an open submenu without knowing its concrete class.
|
|
39
39
|
*/
|
|
40
40
|
export interface DropdownMenuEntry extends HTMLElement {
|
|
41
|
-
readonly
|
|
41
|
+
readonly value: string;
|
|
42
42
|
closeSubmenu(): void;
|
|
43
43
|
repositionSubmenu(): void;
|
|
44
44
|
}
|
|
@@ -36,6 +36,18 @@ export interface FocusableElementsOptions {
|
|
|
36
36
|
* @returns every focusable descendant, in traversal order.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getFocusableElements(root: Element | ShadowRoot, options?: FocusableElementsOptions): HTMLElement[];
|
|
39
|
+
/**
|
|
40
|
+
* The element that actually receives focus for `element` : `element`
|
|
41
|
+
* itself when it's a tab stop, otherwise its first focusable descendant
|
|
42
|
+
* (crossing slots and nested shadow roots, see {@link walkFlatTree}), e.g.
|
|
43
|
+
* the `<a>` slotted into an `eun-link` or the native control rendered
|
|
44
|
+
* inside a component's shadow root. Falls back to `element` when nothing
|
|
45
|
+
* inside it is focusable. Rendering isn't required, so a visually hidden
|
|
46
|
+
* (`sr-only`) control still counts.
|
|
47
|
+
*
|
|
48
|
+
* @param element the element to resolve.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveFocusTarget(element: HTMLElement): HTMLElement;
|
|
39
51
|
/**
|
|
40
52
|
* Whether `root` has *any* focusable descendant (see {@link
|
|
41
53
|
* walkFlatTree}), stopping at the first match rather than collecting them
|
|
@@ -106,6 +106,32 @@ export function getFocusableElements(root, options = {}) {
|
|
|
106
106
|
});
|
|
107
107
|
return results;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* The element that actually receives focus for `element` : `element`
|
|
111
|
+
* itself when it's a tab stop, otherwise its first focusable descendant
|
|
112
|
+
* (crossing slots and nested shadow roots, see {@link walkFlatTree}), e.g.
|
|
113
|
+
* the `<a>` slotted into an `eun-link` or the native control rendered
|
|
114
|
+
* inside a component's shadow root. Falls back to `element` when nothing
|
|
115
|
+
* inside it is focusable. Rendering isn't required, so a visually hidden
|
|
116
|
+
* (`sr-only`) control still counts.
|
|
117
|
+
*
|
|
118
|
+
* @param element the element to resolve.
|
|
119
|
+
*/
|
|
120
|
+
export function resolveFocusTarget(element) {
|
|
121
|
+
const options = { requireRendered: false };
|
|
122
|
+
if (isFocusable(element, options)) {
|
|
123
|
+
return element;
|
|
124
|
+
}
|
|
125
|
+
let target;
|
|
126
|
+
walkFlatTree(element.shadowRoot ?? element, (descendant) => {
|
|
127
|
+
if (isFocusable(descendant, options)) {
|
|
128
|
+
target = descendant;
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
});
|
|
133
|
+
return target ?? element;
|
|
134
|
+
}
|
|
109
135
|
/**
|
|
110
136
|
* Whether `root` has *any* focusable descendant (see {@link
|
|
111
137
|
* walkFlatTree}), stopping at the first match rather than collecting them
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a key press should trigger implicit submission: Enter, outside
|
|
3
|
+
* of an IME composition, and not already handled by something else.
|
|
4
|
+
*
|
|
5
|
+
* @param event - The keydown event to check.
|
|
6
|
+
* @returns Whether the event asks for implicit submission.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isImplicitSubmissionKey(event: KeyboardEvent): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Submits a form the way the browser does when Enter is pressed in one of
|
|
11
|
+
* its text fields, since a field whose native input lives in a shadow root
|
|
12
|
+
* never triggers it on its own. Clicks the form's default button when it
|
|
13
|
+
* has one, unless that button is disabled. Without one, submits only when
|
|
14
|
+
* the form holds a single text field.
|
|
15
|
+
*
|
|
16
|
+
* @param form - The form to submit.
|
|
17
|
+
*/
|
|
18
|
+
export declare function submitImplicitly(form: HTMLFormElement): void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Buttons that can submit a form, in the order the browser looks for the
|
|
3
|
+
* form's default button. `eun-button` and `eun-fab` aren't form-associated,
|
|
4
|
+
* so they're found in the form's own subtree rather than in `form.elements`.
|
|
5
|
+
*/
|
|
6
|
+
const SUBMIT_BUTTONS = [
|
|
7
|
+
"button:not([type])",
|
|
8
|
+
'button[type="submit"]',
|
|
9
|
+
'input[type="submit"]',
|
|
10
|
+
'input[type="image"]',
|
|
11
|
+
'eun-button[type="submit"]',
|
|
12
|
+
'eun-fab[type="submit"]',
|
|
13
|
+
].join(", ");
|
|
14
|
+
/**
|
|
15
|
+
* Native input types that block implicit submission, per the HTML spec.
|
|
16
|
+
*/
|
|
17
|
+
const BLOCKING_INPUT_TYPES = new Set([
|
|
18
|
+
"text",
|
|
19
|
+
"search",
|
|
20
|
+
"url",
|
|
21
|
+
"tel",
|
|
22
|
+
"email",
|
|
23
|
+
"password",
|
|
24
|
+
"date",
|
|
25
|
+
"month",
|
|
26
|
+
"week",
|
|
27
|
+
"time",
|
|
28
|
+
"datetime-local",
|
|
29
|
+
"number",
|
|
30
|
+
]);
|
|
31
|
+
/**
|
|
32
|
+
* Library fields standing in for one of the native inputs above, and so
|
|
33
|
+
* blocking implicit submission the same way it does.
|
|
34
|
+
*/
|
|
35
|
+
const BLOCKING_FIELDS = [
|
|
36
|
+
"eun-input",
|
|
37
|
+
"eun-search",
|
|
38
|
+
"eun-input-phone",
|
|
39
|
+
"eun-counter",
|
|
40
|
+
"eun-date-picker",
|
|
41
|
+
"eun-time-picker",
|
|
42
|
+
].join(", ");
|
|
43
|
+
/**
|
|
44
|
+
* Whether a key press should trigger implicit submission: Enter, outside
|
|
45
|
+
* of an IME composition, and not already handled by something else.
|
|
46
|
+
*
|
|
47
|
+
* @param event - The keydown event to check.
|
|
48
|
+
* @returns Whether the event asks for implicit submission.
|
|
49
|
+
*/
|
|
50
|
+
export function isImplicitSubmissionKey(event) {
|
|
51
|
+
return (event.key === "Enter" &&
|
|
52
|
+
!event.isComposing &&
|
|
53
|
+
event.keyCode !== 229 &&
|
|
54
|
+
!event.defaultPrevented);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Submits a form the way the browser does when Enter is pressed in one of
|
|
58
|
+
* its text fields, since a field whose native input lives in a shadow root
|
|
59
|
+
* never triggers it on its own. Clicks the form's default button when it
|
|
60
|
+
* has one, unless that button is disabled. Without one, submits only when
|
|
61
|
+
* the form holds a single text field.
|
|
62
|
+
*
|
|
63
|
+
* @param form - The form to submit.
|
|
64
|
+
*/
|
|
65
|
+
export function submitImplicitly(form) {
|
|
66
|
+
const defaultButton = form.querySelector(SUBMIT_BUTTONS);
|
|
67
|
+
if (defaultButton) {
|
|
68
|
+
if (!defaultButton.matches(":disabled, [disabled]")) {
|
|
69
|
+
defaultButton.click();
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const blockingFields = Array.from(form.elements).filter((element) => (element instanceof HTMLInputElement &&
|
|
74
|
+
BLOCKING_INPUT_TYPES.has(element.type)) ||
|
|
75
|
+
element.matches(BLOCKING_FIELDS));
|
|
76
|
+
if (blockingFields.length <= 1) {
|
|
77
|
+
form.requestSubmit();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starts recording, once per page, whether the latest interaction came from
|
|
3
|
+
* the keyboard or a pointer. Listens in the capture phase, so a handler
|
|
4
|
+
* stopping propagation further down can't hide an interaction. Safe to call
|
|
5
|
+
* from every instance's `connectedCallback`, and a no-op outside a browser.
|
|
6
|
+
*/
|
|
7
|
+
export declare function trackInputModality(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the latest interaction recorded by {@link trackInputModality}
|
|
10
|
+
* came from the keyboard. `false` before any interaction, so a surface
|
|
11
|
+
* opened by script on page load keeps its pointer behavior.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isKeyboardModality(): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the user's latest interaction with the page came from the
|
|
3
|
+
* keyboard, as opposed to a mouse, pen, or touch.
|
|
4
|
+
*/
|
|
5
|
+
let keyboardModality = false;
|
|
6
|
+
let tracking = false;
|
|
7
|
+
const handleKeydown = () => {
|
|
8
|
+
keyboardModality = true;
|
|
9
|
+
};
|
|
10
|
+
const handlePointerdown = () => {
|
|
11
|
+
keyboardModality = false;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Starts recording, once per page, whether the latest interaction came from
|
|
15
|
+
* the keyboard or a pointer. Listens in the capture phase, so a handler
|
|
16
|
+
* stopping propagation further down can't hide an interaction. Safe to call
|
|
17
|
+
* from every instance's `connectedCallback`, and a no-op outside a browser.
|
|
18
|
+
*/
|
|
19
|
+
export function trackInputModality() {
|
|
20
|
+
if (tracking || typeof document === "undefined") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
tracking = true;
|
|
24
|
+
document.addEventListener("keydown", handleKeydown, true);
|
|
25
|
+
document.addEventListener("pointerdown", handlePointerdown, true);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether the latest interaction recorded by {@link trackInputModality}
|
|
29
|
+
* came from the keyboard. `false` before any interaction, so a surface
|
|
30
|
+
* opened by script on page load keeps its pointer behavior.
|
|
31
|
+
*/
|
|
32
|
+
export function isKeyboardModality() {
|
|
33
|
+
return keyboardModality;
|
|
34
|
+
}
|
|
@@ -31,3 +31,14 @@ export declare function parseListboxOptions(children: Iterable<Element>): Listbo
|
|
|
31
31
|
* @returns the rendered template, or the plain `label` when nothing matches.
|
|
32
32
|
*/
|
|
33
33
|
export declare function renderHighlightedLabel(label: string, query: string): TemplateResult | string;
|
|
34
|
+
/**
|
|
35
|
+
* Renders a listbox's option rows, wrapping each run of options sharing an
|
|
36
|
+
* `optgroup` in a `role="group"` row named by that group's label, so
|
|
37
|
+
* assistive technology announces which group an option belongs to.
|
|
38
|
+
* Options outside any group are rendered as they are.
|
|
39
|
+
*
|
|
40
|
+
* @param options the options to render, in display order.
|
|
41
|
+
* @param renderOption renders one option row, given its index in `options`.
|
|
42
|
+
* @returns the rendered rows.
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderListboxRows<T extends ListboxOption>(options: T[], renderOption: (option: T, index: number) => TemplateResult): TemplateResult[];
|
|
@@ -48,7 +48,45 @@ export function renderHighlightedLabel(label, query) {
|
|
|
48
48
|
if (index === -1) {
|
|
49
49
|
return label;
|
|
50
50
|
}
|
|
51
|
-
return html `${label.slice(0, index)}<mark
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
return html `${label.slice(0, index)}<mark>${label.slice(index, index + query.length)}</mark>${label.slice(index + query.length)}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Renders a listbox's option rows, wrapping each run of options sharing an
|
|
55
|
+
* `optgroup` in a `role="group"` row named by that group's label, so
|
|
56
|
+
* assistive technology announces which group an option belongs to.
|
|
57
|
+
* Options outside any group are rendered as they are.
|
|
58
|
+
*
|
|
59
|
+
* @param options the options to render, in display order.
|
|
60
|
+
* @param renderOption renders one option row, given its index in `options`.
|
|
61
|
+
* @returns the rendered rows.
|
|
62
|
+
*/
|
|
63
|
+
export function renderListboxRows(options, renderOption) {
|
|
64
|
+
const rows = [];
|
|
65
|
+
let groupCount = 0;
|
|
66
|
+
let index = 0;
|
|
67
|
+
while (index < options.length) {
|
|
68
|
+
const { group } = options[index];
|
|
69
|
+
const start = index;
|
|
70
|
+
while (index < options.length && options[index].group === group) {
|
|
71
|
+
index += 1;
|
|
72
|
+
}
|
|
73
|
+
const run = options
|
|
74
|
+
.slice(start, index)
|
|
75
|
+
.map((option, offset) => renderOption(option, start + offset));
|
|
76
|
+
if (!group) {
|
|
77
|
+
rows.push(...run);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const labelId = `listbox-group-${groupCount}`;
|
|
81
|
+
groupCount += 1;
|
|
82
|
+
rows.push(html `
|
|
83
|
+
<li class="option-group" role="group" aria-labelledby=${labelId}>
|
|
84
|
+
<div id=${labelId} class="group-label">${group}</div>
|
|
85
|
+
<ul class="group-options" role="presentation">
|
|
86
|
+
${run}
|
|
87
|
+
</ul>
|
|
88
|
+
</li>
|
|
89
|
+
`);
|
|
90
|
+
}
|
|
91
|
+
return rows;
|
|
54
92
|
}
|