@eunomia/elements 1.0.0-beta.3 → 1.0.0-beta.5
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-EAGGN3ZI.js → chunk-2XASWWKR.js} +9 -9
- package/dist/cdn/components/chunks/chunk-32DTNR52.js +1 -0
- package/dist/cdn/components/chunks/chunk-3MTUVMM5.js +1 -0
- package/dist/cdn/components/chunks/chunk-5GKM5DIB.js +1 -0
- package/dist/cdn/components/chunks/{chunk-32KRPOPV.js → chunk-5XJGYXW7.js} +6 -6
- package/dist/cdn/components/chunks/{chunk-O2HNWH65.js → chunk-5XJLIHAU.js} +7 -7
- package/dist/cdn/components/chunks/{chunk-TBKKTJOX.js → chunk-6ETDXUH2.js} +3 -3
- package/dist/cdn/components/chunks/{chunk-5GF2Q3NR.js → chunk-74AOAB4X.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-WYMBUIKX.js → chunk-A6KGFALA.js} +4 -4
- package/dist/cdn/components/chunks/{chunk-NEYBPT3D.js → chunk-AIS3UICU.js} +9 -9
- package/dist/cdn/components/chunks/{chunk-LJYTHDZP.js → chunk-D2M4BV5Y.js} +6 -6
- package/dist/cdn/components/chunks/chunk-DKOPI7QA.js +415 -0
- package/dist/cdn/components/chunks/{chunk-53QH6MPM.js → chunk-EAKYD33D.js} +3 -3
- package/dist/cdn/components/chunks/chunk-EST3M4AO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-BYBUXKXC.js → chunk-IDKZKLJR.js} +7 -7
- package/dist/cdn/components/chunks/chunk-JRGM3W7I.js +53 -0
- package/dist/cdn/components/chunks/{chunk-RWONCXTF.js → chunk-KVYUNKUO.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-6UPI7GHJ.js → chunk-L65WUTXM.js} +12 -12
- package/dist/cdn/components/chunks/chunk-LFCXUVDO.js +1 -0
- package/dist/cdn/components/chunks/chunk-LGLQ36QB.js +16 -0
- package/dist/cdn/components/chunks/chunk-MPQP4R54.js +263 -0
- package/dist/cdn/components/chunks/{chunk-ON42P6FI.js → chunk-NBIENHLV.js} +6 -6
- package/dist/cdn/components/chunks/chunk-OAULRKHQ.js +38 -0
- package/dist/cdn/components/chunks/chunk-OW7XKDCH.js +124 -0
- package/dist/cdn/components/chunks/chunk-P32B7BFD.js +118 -0
- package/dist/cdn/components/chunks/{chunk-ZPFHTJSS.js → chunk-PCM7D3YF.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-ABYEBP57.js → chunk-PED5ATYN.js} +11 -8
- package/dist/cdn/components/chunks/{chunk-5C7YND22.js → chunk-S2UCEWNG.js} +8 -8
- package/dist/cdn/components/chunks/{chunk-5RCCZVFZ.js → chunk-SD2WHGPF.js} +7 -6
- package/dist/cdn/components/chunks/chunk-SJWRE6PW.js +1 -0
- package/dist/cdn/components/chunks/{chunk-6IILPCSQ.js → chunk-X2AUBZD2.js} +3 -3
- package/dist/cdn/components/eun-alert.js +65 -45
- package/dist/cdn/components/eun-animate.js +5 -3
- package/dist/cdn/components/eun-badge.js +8 -8
- package/dist/cdn/components/eun-breadcrumb-item.js +14 -10
- package/dist/cdn/components/eun-breadcrumb.js +11 -7
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +20 -20
- package/dist/cdn/components/eun-card.js +61 -13
- package/dist/cdn/components/eun-carousel.js +35 -27
- package/dist/cdn/components/eun-check-card.js +3 -3
- package/dist/cdn/components/eun-checkbox-list.js +3 -3
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +45 -207
- package/dist/cdn/components/eun-collapse.js +49 -29
- package/dist/cdn/components/eun-color-picker.js +13 -13
- package/dist/cdn/components/eun-counter.js +15 -15
- package/dist/cdn/components/eun-date-picker.js +62 -62
- package/dist/cdn/components/eun-drawer.js +12 -12
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +6 -6
- package/dist/cdn/components/eun-fab.js +31 -53
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +18 -11
- package/dist/cdn/components/eun-image-carousel.js +18 -18
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +12 -12
- package/dist/cdn/components/eun-input-phone.js +28 -28
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-label.js +4 -4
- package/dist/cdn/components/eun-link.js +134 -18
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +21 -21
- package/dist/cdn/components/eun-pagination.js +3 -3
- package/dist/cdn/components/eun-password-strength.js +9 -6
- package/dist/cdn/components/eun-progress-bar.js +13 -13
- package/dist/cdn/components/eun-radio-card.js +2 -2
- package/dist/cdn/components/eun-radio-list.js +1 -1
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-scheduler-event-editor.js +9 -9
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +26 -26
- package/dist/cdn/components/eun-search.js +21 -21
- package/dist/cdn/components/eun-select.js +10 -10
- package/dist/cdn/components/eun-sidebar.js +9 -9
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +8 -8
- package/dist/cdn/components/eun-sliding-card.js +4 -3
- package/dist/cdn/components/eun-step.js +8 -8
- package/dist/cdn/components/eun-stepper.js +8 -8
- package/dist/cdn/components/eun-switch.js +10 -10
- package/dist/cdn/components/eun-tab-group.js +19 -11
- 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-cell.js +1 -1
- package/dist/cdn/components/eun-table-column.js +1 -1
- package/dist/cdn/components/eun-table-header.js +1 -1
- package/dist/cdn/components/eun-table-item.js +1 -1
- package/dist/cdn/components/eun-table-skeleton-row.js +1 -1
- package/dist/cdn/components/eun-table.js +3 -3
- package/dist/cdn/components/eun-tag.js +34 -126
- package/dist/cdn/components/eun-textarea.js +23 -23
- package/dist/cdn/components/eun-time-picker.js +32 -32
- package/dist/cdn/components/eun-toast.js +40 -36
- package/dist/cdn/components/eun-toggle-group.js +213 -72
- package/dist/cdn/components/eun-toggle-item.js +49 -30
- package/dist/cdn/components/eun-toggle.js +12 -9
- package/dist/cdn/components/eun-toolbar.js +15 -8
- package/dist/cdn/components/eun-tooltip.js +122 -87
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/eunomia-theme.css +1 -1
- package/dist/cdn/styles/themes/eunomia-theme.scss +1 -0
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +71 -0
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.scss +2 -0
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.mixin.scss +3 -13
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.scss +2 -0
- package/dist/cdn/styles/tools/indexes/eunomia-tools.index.scss +1 -0
- package/dist/cdn/styles/tools/mixins/settings/eunomia-alpha.mixin.scss +39 -0
- package/dist/cdn/styles/tools/mixins/settings/eunomia-border.mixin.scss +3 -3
- package/dist/cdn/styles/tools/mixins/settings/eunomia-font.mixin.scss +12 -12
- package/dist/cdn/styles/tools/mixins/settings/eunomia-radius.mixin.scss +4 -4
- package/dist/components/action/button/button.d.ts +44 -15
- package/dist/components/action/button/button.js +100 -20
- package/dist/components/action/button/button.styles.js +179 -393
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +13 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +16 -5
- package/dist/components/action/dropdown-button/dropdown-button.styles.js +8 -8
- package/dist/components/action/dropdown-button/dropdown-item.styles.js +6 -6
- package/dist/components/action/fab/fab.d.ts +7 -4
- package/dist/components/action/fab/fab.js +11 -6
- package/dist/components/action/fab/fab.styles.js +26 -49
- package/dist/components/action/link/link.d.ts +115 -6
- package/dist/components/action/link/link.js +245 -21
- package/dist/components/action/link/link.styles.js +105 -3
- package/dist/components/action/shared-styles/button-palette.styles.d.ts +27 -0
- package/dist/components/action/shared-styles/button-palette.styles.js +151 -0
- package/dist/components/action/toggle/toggle-group.d.ts +55 -11
- package/dist/components/action/toggle/toggle-group.js +193 -52
- package/dist/components/action/toggle/toggle-group.styles.d.ts +7 -5
- package/dist/components/action/toggle/toggle-group.styles.js +166 -41
- package/dist/components/action/toggle/toggle-item.d.ts +4 -4
- package/dist/components/action/toggle/toggle-item.js +2 -2
- package/dist/components/action/toggle/toggle-item.styles.js +45 -26
- package/dist/components/action/toggle/toggle.d.ts +1 -1
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/action/toggle/toggle.styles.d.ts +2 -2
- package/dist/components/action/toggle/toggle.styles.js +13 -10
- package/dist/components/alert/alert/alert.d.ts +4 -3
- package/dist/components/alert/alert/alert.js +4 -3
- package/dist/components/alert/alert/alert.styles.js +57 -36
- package/dist/components/alert/drawer/drawer.js +1 -1
- package/dist/components/alert/drawer/drawer.styles.js +3 -3
- package/dist/components/alert/modal/modal.d.ts +8 -8
- package/dist/components/alert/modal/modal.js +11 -11
- package/dist/components/alert/modal/modal.styles.js +6 -6
- package/dist/components/alert/toast/toast.d.ts +4 -3
- package/dist/components/alert/toast/toast.js +4 -3
- package/dist/components/alert/toast/toast.styles.js +41 -36
- package/dist/components/content/badge/badge.d.ts +6 -6
- package/dist/components/content/badge/badge.js +4 -4
- package/dist/components/content/badge/badge.styles.js +5 -5
- package/dist/components/content/card/card.d.ts +36 -8
- package/dist/components/content/card/card.js +68 -8
- package/dist/components/content/card/card.styles.js +52 -11
- package/dist/components/content/card/image-card.d.ts +3 -2
- package/dist/components/content/card/image-card.js +2 -1
- package/dist/components/content/card/image-card.styles.js +17 -10
- package/dist/components/content/card/sliding-card.d.ts +2 -1
- package/dist/components/content/card/sliding-card.js +1 -0
- package/dist/components/content/card/sliding-card.styles.js +3 -2
- package/dist/components/content/chip/chip.d.ts +16 -7
- package/dist/components/content/chip/chip.js +18 -6
- package/dist/components/content/chip/chip.styles.d.ts +1 -1
- package/dist/components/content/chip/chip.styles.js +43 -207
- package/dist/components/content/collapse/collapse.d.ts +29 -11
- package/dist/components/content/collapse/collapse.js +53 -23
- package/dist/components/content/collapse/collapse.styles.js +23 -9
- package/dist/components/content/icon/icon.d.ts +12 -2
- package/dist/components/content/icon/icon.js +52 -22
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +5 -2
- package/dist/components/content/image-carousel/image-carousel.styles.js +14 -14
- package/dist/components/content/password-strength/password-strength.styles.js +7 -4
- package/dist/components/content/progress-bar/progress-bar.styles.js +9 -9
- package/dist/components/content/shared-styles/card-link.styles.js +1 -0
- package/dist/components/content/shared-styles/tone-surface.styles.d.ts +31 -0
- package/dist/components/content/shared-styles/tone-surface.styles.js +149 -0
- package/dist/components/content/tag/tag.d.ts +16 -6
- package/dist/components/content/tag/tag.js +19 -6
- package/dist/components/content/tag/tag.styles.d.ts +1 -1
- package/dist/components/content/tag/tag.styles.js +40 -125
- package/dist/components/content/tooltip/tooltip.d.ts +15 -4
- package/dist/components/content/tooltip/tooltip.js +21 -4
- package/dist/components/content/tooltip/tooltip.styles.js +115 -79
- package/dist/components/form/checkbox/check-card.styles.js +2 -2
- package/dist/components/form/checkbox/checkbox-list.d.ts +1 -1
- package/dist/components/form/checkbox/checkbox.d.ts +1 -1
- package/dist/components/form/checkbox/checkbox.styles.js +6 -6
- package/dist/components/form/color-picker/color-picker.d.ts +3 -3
- package/dist/components/form/color-picker/color-picker.js +4 -4
- package/dist/components/form/color-picker/color-picker.styles.js +7 -7
- package/dist/components/form/counter/counter.d.ts +3 -3
- package/dist/components/form/counter/counter.js +3 -3
- package/dist/components/form/counter/counter.styles.js +12 -12
- package/dist/components/form/date-picker/date-picker-day-grid.styles.js +2 -2
- package/dist/components/form/date-picker/date-picker-grid.styles.js +15 -15
- package/dist/components/form/date-picker/date-picker-month-grid.styles.js +1 -1
- package/dist/components/form/date-picker/date-picker-year-grid.styles.js +1 -1
- package/dist/components/form/date-picker/date-picker.d.ts +3 -3
- package/dist/components/form/date-picker/date-picker.js +3 -3
- package/dist/components/form/date-picker/date-picker.styles.js +17 -17
- package/dist/components/form/input/input.d.ts +3 -3
- package/dist/components/form/input/input.js +4 -4
- package/dist/components/form/input-file/input-file.d.ts +1 -1
- package/dist/components/form/input-file/input-file.styles.js +9 -9
- package/dist/components/form/input-phone/input-phone.d.ts +3 -3
- package/dist/components/form/input-phone/input-phone.js +3 -3
- package/dist/components/form/input-phone/input-phone.styles.js +19 -19
- package/dist/components/form/label/label.styles.js +4 -4
- package/dist/components/form/radio/radio-card.styles.js +1 -1
- package/dist/components/form/radio/radio-list.d.ts +1 -1
- package/dist/components/form/radio/radio.d.ts +1 -1
- package/dist/components/form/radio/radio.styles.js +2 -2
- package/dist/components/form/search/search.styles.js +9 -9
- package/dist/components/form/select/select.d.ts +3 -3
- package/dist/components/form/select/select.js +3 -3
- package/dist/components/form/select/select.styles.js +6 -6
- package/dist/components/form/shared-styles/card.styles.js +1 -1
- package/dist/components/form/shared-styles/field.styles.js +12 -12
- package/dist/components/form/shared-styles/form-labels.styles.js +1 -1
- package/dist/components/form/shared-styles/listbox.styles.js +6 -6
- package/dist/components/form/slider/slider.d.ts +1 -1
- package/dist/components/form/slider/slider.styles.js +6 -6
- package/dist/components/form/switch/switch.d.ts +1 -1
- package/dist/components/form/switch/switch.styles.js +8 -8
- package/dist/components/form/textarea/textarea.d.ts +3 -3
- package/dist/components/form/textarea/textarea.js +4 -4
- package/dist/components/form/textarea/textarea.styles.js +6 -6
- package/dist/components/form/time-picker/time-picker-columns.styles.js +6 -6
- package/dist/components/form/time-picker/time-picker-list.styles.js +2 -2
- package/dist/components/form/time-picker/time-picker.d.ts +3 -3
- package/dist/components/form/time-picker/time-picker.js +3 -3
- package/dist/components/form/time-picker/time-picker.styles.js +13 -13
- package/dist/components/layout/animate/animate.d.ts +8 -0
- package/dist/components/layout/animate/animate.js +20 -8
- package/dist/components/loader/loader/loader.styles.js +2 -2
- package/dist/components/loader/skeleton/skeleton.styles.js +8 -5
- package/dist/components/navigation/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/dist/components/navigation/breadcrumb/breadcrumb-item.js +15 -1
- package/dist/components/navigation/breadcrumb/breadcrumb-item.styles.js +3 -3
- package/dist/components/navigation/breadcrumb/breadcrumb.d.ts +1 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.js +7 -1
- package/dist/components/navigation/breadcrumb/breadcrumb.styles.js +3 -3
- package/dist/components/navigation/carousel/carousel.d.ts +40 -6
- package/dist/components/navigation/carousel/carousel.js +61 -12
- package/dist/components/navigation/carousel/carousel.styles.js +19 -7
- package/dist/components/navigation/pagination/pagination.styles.js +3 -3
- package/dist/components/navigation/sidebar/sidebar.styles.js +9 -9
- package/dist/components/navigation/stepper/step.styles.js +8 -8
- package/dist/components/navigation/stepper/stepper.styles.js +8 -8
- package/dist/components/navigation/tabs/tab/tab.styles.js +5 -5
- package/dist/components/navigation/tabs/tab-group/tab-group.d.ts +9 -0
- package/dist/components/navigation/tabs/tab-group/tab-group.js +19 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +12 -4
- package/dist/components/navigation/tabs/tab-panel/tab-panel.styles.js +1 -1
- package/dist/components/navigation/toolbar/toolbar.d.ts +2 -0
- package/dist/components/navigation/toolbar/toolbar.js +2 -0
- package/dist/components/navigation/toolbar/toolbar.styles.js +16 -7
- package/dist/features/scheduler/calendar/calendar.d.ts +6 -6
- package/dist/features/scheduler/calendar/calendar.js +10 -10
- package/dist/features/scheduler/calendar/calendar.styles.js +3 -3
- package/dist/features/scheduler/scheduler/scheduler.d.ts +6 -6
- package/dist/features/scheduler/scheduler/scheduler.js +13 -13
- package/dist/features/scheduler/scheduler/scheduler.styles.js +2 -2
- package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +10 -8
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +7 -7
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +8 -8
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +5 -5
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.styles.js +2 -2
- package/dist/features/scheduler/shared/scheduler-event-popover.js +2 -2
- package/dist/features/scheduler/shared/scheduler-event-popover.styles.js +4 -4
- package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +2 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.js +3 -3
- package/dist/features/scheduler/shared/scheduler-hour-grid.styles.js +1 -1
- package/dist/features/scheduler/shared/scheduler-month-view.d.ts +3 -3
- package/dist/features/scheduler/shared/scheduler-month-view.js +2 -2
- package/dist/features/scheduler/shared/scheduler-month-view.styles.js +1 -1
- package/dist/features/scheduler/shared/scheduler-year-view.styles.js +1 -1
- package/dist/features/table/native-table.css +11 -11
- package/dist/features/table/table/table.styles.js +2 -2
- package/dist/features/table/table/table.types.d.ts +7 -3
- package/dist/features/table/table-action-bar/table-action-bar.js +3 -3
- package/dist/features/table/table-action-bar/table-action-bar.styles.js +2 -2
- package/dist/features/table/table-cell/table-cell.styles.js +2 -2
- package/dist/features/table/table-column/table-column.styles.js +3 -3
- package/dist/features/table/table-header/table-header.styles.js +4 -4
- package/dist/features/table/table-item/table-item.styles.js +6 -6
- package/dist/features/table/table-managed/table-managed.js +2 -2
- package/dist/features/table/table-skeleton-row/table-skeleton-row.styles.js +1 -1
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/fr.js +3 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +5 -2
- package/dist/jsx.d.ts +19 -6
- package/dist/mixins/button.mixin.d.ts +11 -9
- package/dist/mixins/button.mixin.js +23 -5
- package/dist/mixins/card-link.mixin.d.ts +3 -2
- package/dist/mixins/card-link.mixin.js +12 -5
- package/dist/mixins/check.mixin.d.ts +1 -1
- package/dist/mixins/disabled.mixin.d.ts +3 -3
- package/dist/mixins/disabled.mixin.js +10 -5
- package/dist/mixins/editable.mixin.d.ts +1 -1
- package/dist/mixins/field-appearance.mixin.d.ts +19 -0
- package/dist/mixins/{field-variant.mixin.js → field-appearance.mixin.js} +11 -11
- package/dist/mixins/form.mixin.d.ts +5 -1
- package/dist/mixins/form.mixin.js +32 -12
- package/dist/mixins/overflow-navigation.mixin.js +2 -1
- package/dist/mixins/radio.mixin.d.ts +1 -1
- package/dist/mixins/validators.mixin.d.ts +9 -3
- package/dist/ssr/animate-ssr.css +26 -72
- package/dist/ssr/links-ssr.css +35 -0
- package/dist/ssr/overlay-ssr.css +0 -41
- package/dist/ssr/rich-text.css +38 -0
- package/dist/ssr/sidebar-ssr.css +0 -38
- package/dist/ssr/toolbar-ssr.css +73 -39
- package/dist/types/variant.type.d.ts +26 -10
- package/dist/utils/navigation.utils.d.ts +14 -0
- package/dist/utils/navigation.utils.js +33 -0
- package/dist/utils/new-tab-anchor.controller.d.ts +44 -0
- package/dist/utils/new-tab-anchor.controller.js +102 -0
- package/dist/utils/rich-text.utils.d.ts +33 -0
- package/dist/utils/rich-text.utils.js +140 -49
- package/dist/utils/severity-icon.utils.d.ts +1 -1
- package/dist/utils/severity-icon.utils.js +1 -1
- package/dist/utils/theme-generator.utils.d.ts +26 -3
- package/dist/utils/theme-generator.utils.js +68 -21
- package/package.json +13 -2
- package/styles/themes/eunomia-theme.scss +1 -0
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +71 -0
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/eunomia/eunomia.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/eunomia/eunomia.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/fire/eunomia-fire.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/forest/eunomia-forest.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/gold/eunomia-gold.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.scss +2 -0
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/violet/eunomia-violet.mixin.scss +3 -13
- package/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.scss +2 -0
- package/styles/tools/indexes/eunomia-tools.index.scss +1 -0
- package/styles/tools/mixins/settings/eunomia-alpha.mixin.scss +39 -0
- package/styles/tools/mixins/settings/eunomia-border.mixin.scss +3 -3
- package/styles/tools/mixins/settings/eunomia-font.mixin.scss +12 -12
- package/styles/tools/mixins/settings/eunomia-radius.mixin.scss +4 -4
- package/dist/cdn/components/chunks/chunk-3LMI7KUA.js +0 -48
- package/dist/cdn/components/chunks/chunk-5TH3P53V.js +0 -16
- package/dist/cdn/components/chunks/chunk-ATH2OAMU.js +0 -1
- package/dist/cdn/components/chunks/chunk-BKHD4S57.js +0 -1
- package/dist/cdn/components/chunks/chunk-KNM5QHDK.js +0 -38
- package/dist/cdn/components/chunks/chunk-MBF52GEL.js +0 -1
- package/dist/cdn/components/chunks/chunk-T7WABJEJ.js +0 -1
- package/dist/cdn/components/chunks/chunk-XSMCT4DF.js +0 -1
- package/dist/cdn/components/chunks/chunk-Z6PJYSC3.js +0 -622
- package/dist/cdn/components/chunks/chunk-ZKPCO5RB.js +0 -262
- package/dist/mixins/field-variant.mixin.d.ts +0 -22
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { LitElement, TemplateResult } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
3
3
|
/**
|
|
4
4
|
* Tag name of the link component.
|
|
5
5
|
*/
|
|
6
6
|
export declare const EunomiaLinkTagName = "eun-link";
|
|
7
|
+
declare const EunomiaLink_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
7
8
|
/**
|
|
8
9
|
* A basic link with an optional decorative leading icon.
|
|
9
10
|
*
|
|
@@ -11,13 +12,22 @@ export declare const EunomiaLinkTagName = "eun-link";
|
|
|
11
12
|
* prevent the new page from controlling the original one, without affecting
|
|
12
13
|
* same-tab navigation.
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
+
* Without href, a native anchor placed as a direct child becomes the link
|
|
16
|
+
* instead, such as a framework's own link component. The anchor then exists
|
|
17
|
+
* in the server-rendered HTML, so crawlers that don't run JavaScript still
|
|
18
|
+
* find it, and it keeps the link styles and the current state. When that
|
|
19
|
+
* anchor opens in a new tab, the link shows the same end icon and announces
|
|
20
|
+
* it the same way, through the anchor's aria-description.
|
|
21
|
+
*
|
|
22
|
+
* @slot [default] - The link content, or a native anchor carrying the href itself when href is unset
|
|
15
23
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
16
24
|
* @prop {string} href - The destination URL
|
|
17
|
-
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically announces it to assistive technology
|
|
25
|
+
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically adds an external link icon at the end and announces it to assistive technology, in the current locale
|
|
18
26
|
* @prop {import('../../content/icon/icon.type.js').EunomiaIconName} icon - An optional decorative icon displayed to the left of the link
|
|
19
27
|
* @prop {'light' | 'dark'} [theme='light'] - The text color theme. Use dark on a dark background
|
|
20
28
|
* @prop {'auto' | 'off' | 'on'} [visitedStyle='auto'] - Controls the visited state color. Auto follows the browser's real navigation history, off always renders as unvisited, and on always renders as visited
|
|
29
|
+
* @prop {boolean} [current=false] - Marks the link as the current page: it renders with aria-current="page" and keeps the --link-color-current color in every state (hover, focus, visited), for example an active item in a navigation
|
|
30
|
+
* @prop {string} [locale] - The locale used to resolve the "opens in a new tab" announcement. Defaults to the one set with setDefaultLocale, English otherwise
|
|
21
31
|
* @attr {string} aria-label - An accessible label that overrides the link content. When the link also opens in a new tab, a note announcing it is appended automatically
|
|
22
32
|
* @fires {NavigationEvent} eunnavigate - Fired before following the link, so a client-side router can intercept the navigation. Cancelable
|
|
23
33
|
* @cssprop [--link-color] - Sets the color of the link
|
|
@@ -25,15 +35,19 @@ export declare const EunomiaLinkTagName = "eun-link";
|
|
|
25
35
|
* @cssprop [--link-color-focus] - Sets the color of the link on focus
|
|
26
36
|
* @cssprop [--link-color-visited] - Sets the color of a visited link
|
|
27
37
|
* @cssprop [--link-color-visited-hover] - Sets the color of a visited link on hover
|
|
38
|
+
* @cssprop [--link-color-current] - Sets the color of the current page link, kept on hover, focus and visited states
|
|
39
|
+
* @cssprop [--link-line-height] - Sets the line-height of the link. Inherits the surrounding text's line-height when unset
|
|
28
40
|
* @cssprop [--link-text-decoration] - Sets the text decoration of the link, for example none, when embedding a link inside an already distinct interactive surface such as a card
|
|
29
41
|
* @cssprop [--link-icon-color] - Sets the color of the leading icon, independently of the link text color
|
|
30
42
|
* @cssprop [--link-padding] - Sets padding around the link, for example to give its focus outline room to breathe. Defaults to 0, flush with the text
|
|
31
43
|
* @cssprop [--link-background] - Sets a persistent background color behind the link. Defaults to transparent
|
|
32
44
|
* @cssprop [--link-background-focus] - Sets a background color shown while the link is keyboard-focused, falling back to --link-background when unset
|
|
33
45
|
* @cssprop [--link-border-radius] - Sets the corner radius of the link's own background/focus outline box
|
|
46
|
+
* @cssstate focus-visible - Set while the link is keyboard-focused (never after a mouse click), so it can be styled from outside the shadow root with eun-link:state(focus-visible). Turbopack's CSS parser (lightningcss) doesn't recognize :state() yet and rejects the whole stylesheet it's in ; ship that rule as a runtime <style>/<link> instead until it's supported
|
|
34
47
|
* @element eun-link
|
|
35
48
|
*/
|
|
36
|
-
export declare class EunomiaLink extends
|
|
49
|
+
export declare class EunomiaLink extends EunomiaLink_base {
|
|
50
|
+
#private;
|
|
37
51
|
/**
|
|
38
52
|
* Styles to import to the component.
|
|
39
53
|
*
|
|
@@ -56,17 +70,89 @@ export declare class EunomiaLink extends LitElement {
|
|
|
56
70
|
*/
|
|
57
71
|
icon?: EunomiaIconName;
|
|
58
72
|
/**
|
|
59
|
-
* Text color theme, use `dark` on a dark background.
|
|
73
|
+
* Text color theme, use `dark` on a dark background. Only reflected once
|
|
74
|
+
* it differs from the default, so an SSR framework doesn't see an
|
|
75
|
+
* attribute it never rendered.
|
|
60
76
|
* @default light
|
|
61
77
|
*/
|
|
62
78
|
theme: "light" | "dark";
|
|
63
79
|
/**
|
|
64
80
|
* Controls the visited-state color: `auto` follows the browser's real
|
|
65
81
|
* navigation history for `href`, `off` always renders as unvisited, `on`
|
|
66
|
-
* always renders as visited.
|
|
82
|
+
* always renders as visited. Only reflected once it differs from the
|
|
83
|
+
* default, like {@link theme}.
|
|
67
84
|
* @default auto
|
|
68
85
|
*/
|
|
69
86
|
visitedStyle: "auto" | "off" | "on";
|
|
87
|
+
/**
|
|
88
|
+
* Exposes the `focus-visible` custom state (see {@link handleFocus}).
|
|
89
|
+
* Absent where `ElementInternals` isn't available, such as server-side.
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
private readonly internals?;
|
|
93
|
+
/**
|
|
94
|
+
* The element's custom state set, typed locally since the bundled DOM
|
|
95
|
+
* typings don't declare `ElementInternals.states` yet.
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
private get states();
|
|
99
|
+
constructor();
|
|
100
|
+
/**
|
|
101
|
+
* Marks the link as the current page (for example the active item of a
|
|
102
|
+
* navigation) : renders `aria-current="page"` on the inner anchor and
|
|
103
|
+
* keeps `--link-color-current` in every state.
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
current: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* React's server renderer writes a custom element's camelCase prop as an
|
|
109
|
+
* attribute of that exact name, lowercased (`visitedStyle="off"` becomes
|
|
110
|
+
* `visitedstyle="off"`), which never matches `visited-style`. Without this
|
|
111
|
+
* alias the link would start in `auto` (so, visited) and only switch once
|
|
112
|
+
* hydration sets the property, flashing the visited color on first load.
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
static get observedAttributes(): string[];
|
|
116
|
+
attributeChangedCallback(name: string, oldValue: string | null, value: string | null): void;
|
|
117
|
+
/**
|
|
118
|
+
* The native `<a>` slotted as a direct child while `href` is unset, which
|
|
119
|
+
* then acts as the link itself : it's in the light DOM, so it's part of
|
|
120
|
+
* the server-rendered HTML, and a framework's own link component (Next's
|
|
121
|
+
* `<Link>`, Angular's `routerLink`, ...) can be that anchor. Navigation,
|
|
122
|
+
* `target`/`rel` and the new-tab hint are the consumer's own in this mode.
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
private get slottedAnchor();
|
|
126
|
+
connectedCallback(): void;
|
|
127
|
+
disconnectedCallback(): void;
|
|
128
|
+
protected updated(changed: PropertyValues): void;
|
|
129
|
+
/**
|
|
130
|
+
* Mirrors {@link current} onto the slotted anchor as `aria-current`,
|
|
131
|
+
* since that anchor, not the wrapper around it, is what assistive
|
|
132
|
+
* technology announces.
|
|
133
|
+
* @private
|
|
134
|
+
*/
|
|
135
|
+
private syncSlottedAnchor;
|
|
136
|
+
/**
|
|
137
|
+
* Re-renders when the default slot changes, so an anchor added or removed
|
|
138
|
+
* after the first render switches between the two modes.
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
private handleDefaultSlotChange;
|
|
142
|
+
/**
|
|
143
|
+
* The slotted anchor's counterpart of {@link handleFocus} : it lives in
|
|
144
|
+
* the light DOM, so its focus reaches the host as a plain `focusin`.
|
|
145
|
+
* @param event the host's focusin event.
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
private handleSlottedFocusIn;
|
|
149
|
+
/**
|
|
150
|
+
* Clears the `focus-visible` custom state once the slotted anchor loses
|
|
151
|
+
* focus.
|
|
152
|
+
* @param event the host's focusout event.
|
|
153
|
+
* @private
|
|
154
|
+
*/
|
|
155
|
+
private handleSlottedFocusOut;
|
|
70
156
|
/**
|
|
71
157
|
* Elements assigned to the `icon` slot, if any ; queried live so
|
|
72
158
|
* {@link render} can decide whether to fall back to the `icon` prop.
|
|
@@ -81,6 +167,22 @@ export declare class EunomiaLink extends LitElement {
|
|
|
81
167
|
* @private
|
|
82
168
|
*/
|
|
83
169
|
private handleIconSlotChange;
|
|
170
|
+
/**
|
|
171
|
+
* Mirrors the inner anchor's real `:focus-visible` state onto the host as
|
|
172
|
+
* the `focus-visible` custom state, styled from outside with
|
|
173
|
+
* `eun-link:state(focus-visible)`. The anchor is shadow-internal, so the
|
|
174
|
+
* host's own `:focus-visible` never matches, and a plain `focus` listener
|
|
175
|
+
* can't stand in for it (a mouse click focuses the anchor too). Checking
|
|
176
|
+
* `:focus-visible` on the anchor itself keeps mouse focus out.
|
|
177
|
+
* @param event the anchor's focus event.
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
private handleFocus;
|
|
181
|
+
/**
|
|
182
|
+
* Clears the `focus-visible` custom state once the anchor loses focus.
|
|
183
|
+
* @private
|
|
184
|
+
*/
|
|
185
|
+
private handleBlur;
|
|
84
186
|
/**
|
|
85
187
|
* Gives an SPA router (Next.js, Angular, React Router, Vue Router, ...) a
|
|
86
188
|
* chance to intercept the click and perform client-side navigation instead
|
|
@@ -91,6 +193,12 @@ export declare class EunomiaLink extends LitElement {
|
|
|
91
193
|
* @private
|
|
92
194
|
*/
|
|
93
195
|
private handleClick;
|
|
196
|
+
/**
|
|
197
|
+
* The decorative icon at the end of a link opening in a new tab, the
|
|
198
|
+
* wording being announced separately.
|
|
199
|
+
* @private
|
|
200
|
+
*/
|
|
201
|
+
private renderExternalLinkIcon;
|
|
94
202
|
/**
|
|
95
203
|
* Renders the link template.
|
|
96
204
|
* @returns The rendered HTML template
|
|
@@ -102,3 +210,4 @@ declare global {
|
|
|
102
210
|
[EunomiaLinkTagName]: EunomiaLink;
|
|
103
211
|
}
|
|
104
212
|
}
|
|
213
|
+
export {};
|
|
@@ -4,12 +4,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
+
};
|
|
18
|
+
var _EunomiaLink_currentAnchor, _EunomiaLink_newTab;
|
|
7
19
|
import { customElement, property, queryAssignedElements, } from "lit/decorators.js";
|
|
8
20
|
import { html, LitElement, nothing } from "lit";
|
|
9
21
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
22
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
23
|
import { linkStyles } from "./link.styles.js";
|
|
12
|
-
import { handleLinkNavigation } from "../../../utils/navigation.utils.js";
|
|
24
|
+
import { handleLinkNavigation, warnIgnoredHostLinkAttributes, } from "../../../utils/navigation.utils.js";
|
|
25
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
26
|
+
import { NewTabAnchorController } from "../../../utils/new-tab-anchor.controller.js";
|
|
13
27
|
/**
|
|
14
28
|
* Tag name of the link component.
|
|
15
29
|
*/
|
|
@@ -21,13 +35,22 @@ export const EunomiaLinkTagName = "eun-link";
|
|
|
21
35
|
* prevent the new page from controlling the original one, without affecting
|
|
22
36
|
* same-tab navigation.
|
|
23
37
|
*
|
|
24
|
-
*
|
|
38
|
+
* Without href, a native anchor placed as a direct child becomes the link
|
|
39
|
+
* instead, such as a framework's own link component. The anchor then exists
|
|
40
|
+
* in the server-rendered HTML, so crawlers that don't run JavaScript still
|
|
41
|
+
* find it, and it keeps the link styles and the current state. When that
|
|
42
|
+
* anchor opens in a new tab, the link shows the same end icon and announces
|
|
43
|
+
* it the same way, through the anchor's aria-description.
|
|
44
|
+
*
|
|
45
|
+
* @slot [default] - The link content, or a native anchor carrying the href itself when href is unset
|
|
25
46
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
26
47
|
* @prop {string} href - The destination URL
|
|
27
|
-
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically announces it to assistive technology
|
|
48
|
+
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically adds an external link icon at the end and announces it to assistive technology, in the current locale
|
|
28
49
|
* @prop {import('../../content/icon/icon.type.js').EunomiaIconName} icon - An optional decorative icon displayed to the left of the link
|
|
29
50
|
* @prop {'light' | 'dark'} [theme='light'] - The text color theme. Use dark on a dark background
|
|
30
51
|
* @prop {'auto' | 'off' | 'on'} [visitedStyle='auto'] - Controls the visited state color. Auto follows the browser's real navigation history, off always renders as unvisited, and on always renders as visited
|
|
52
|
+
* @prop {boolean} [current=false] - Marks the link as the current page: it renders with aria-current="page" and keeps the --link-color-current color in every state (hover, focus, visited), for example an active item in a navigation
|
|
53
|
+
* @prop {string} [locale] - The locale used to resolve the "opens in a new tab" announcement. Defaults to the one set with setDefaultLocale, English otherwise
|
|
31
54
|
* @attr {string} aria-label - An accessible label that overrides the link content. When the link also opens in a new tab, a note announcing it is appended automatically
|
|
32
55
|
* @fires {NavigationEvent} eunnavigate - Fired before following the link, so a client-side router can intercept the navigation. Cancelable
|
|
33
56
|
* @cssprop [--link-color] - Sets the color of the link
|
|
@@ -35,34 +58,97 @@ export const EunomiaLinkTagName = "eun-link";
|
|
|
35
58
|
* @cssprop [--link-color-focus] - Sets the color of the link on focus
|
|
36
59
|
* @cssprop [--link-color-visited] - Sets the color of a visited link
|
|
37
60
|
* @cssprop [--link-color-visited-hover] - Sets the color of a visited link on hover
|
|
61
|
+
* @cssprop [--link-color-current] - Sets the color of the current page link, kept on hover, focus and visited states
|
|
62
|
+
* @cssprop [--link-line-height] - Sets the line-height of the link. Inherits the surrounding text's line-height when unset
|
|
38
63
|
* @cssprop [--link-text-decoration] - Sets the text decoration of the link, for example none, when embedding a link inside an already distinct interactive surface such as a card
|
|
39
64
|
* @cssprop [--link-icon-color] - Sets the color of the leading icon, independently of the link text color
|
|
40
65
|
* @cssprop [--link-padding] - Sets padding around the link, for example to give its focus outline room to breathe. Defaults to 0, flush with the text
|
|
41
66
|
* @cssprop [--link-background] - Sets a persistent background color behind the link. Defaults to transparent
|
|
42
67
|
* @cssprop [--link-background-focus] - Sets a background color shown while the link is keyboard-focused, falling back to --link-background when unset
|
|
43
68
|
* @cssprop [--link-border-radius] - Sets the corner radius of the link's own background/focus outline box
|
|
69
|
+
* @cssstate focus-visible - Set while the link is keyboard-focused (never after a mouse click), so it can be styled from outside the shadow root with eun-link:state(focus-visible). Turbopack's CSS parser (lightningcss) doesn't recognize :state() yet and rejects the whole stylesheet it's in ; ship that rule as a runtime <style>/<link> instead until it's supported
|
|
44
70
|
* @element eun-link
|
|
45
71
|
*/
|
|
46
|
-
let EunomiaLink = class EunomiaLink extends LitElement {
|
|
72
|
+
let EunomiaLink = class EunomiaLink extends LocalizableMixin(LitElement) {
|
|
73
|
+
/**
|
|
74
|
+
* The element's custom state set, typed locally since the bundled DOM
|
|
75
|
+
* typings don't declare `ElementInternals.states` yet.
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
get states() {
|
|
79
|
+
return this.internals?.states;
|
|
80
|
+
}
|
|
47
81
|
constructor() {
|
|
48
|
-
super(
|
|
82
|
+
super();
|
|
49
83
|
/**
|
|
50
84
|
* The native `target` attribute forwarded to the link.
|
|
51
85
|
* @default _self
|
|
52
86
|
*/
|
|
53
87
|
this.target = "_self";
|
|
54
88
|
/**
|
|
55
|
-
* Text color theme, use `dark` on a dark background.
|
|
89
|
+
* Text color theme, use `dark` on a dark background. Only reflected once
|
|
90
|
+
* it differs from the default, so an SSR framework doesn't see an
|
|
91
|
+
* attribute it never rendered.
|
|
56
92
|
* @default light
|
|
57
93
|
*/
|
|
58
94
|
this.theme = "light";
|
|
59
95
|
/**
|
|
60
96
|
* Controls the visited-state color: `auto` follows the browser's real
|
|
61
97
|
* navigation history for `href`, `off` always renders as unvisited, `on`
|
|
62
|
-
* always renders as visited.
|
|
98
|
+
* always renders as visited. Only reflected once it differs from the
|
|
99
|
+
* default, like {@link theme}.
|
|
63
100
|
* @default auto
|
|
64
101
|
*/
|
|
65
102
|
this.visitedStyle = "auto";
|
|
103
|
+
/**
|
|
104
|
+
* Marks the link as the current page (for example the active item of a
|
|
105
|
+
* navigation) : renders `aria-current="page"` on the inner anchor and
|
|
106
|
+
* keeps `--link-color-current` in every state.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
this.current = false;
|
|
110
|
+
/**
|
|
111
|
+
* The anchor {@link current} was last mirrored onto, so its
|
|
112
|
+
* `aria-current` can be cleared once it's swapped out or removed.
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
_EunomiaLink_currentAnchor.set(this, void 0);
|
|
116
|
+
/**
|
|
117
|
+
* Announces the slotted anchor opening in a new tab.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
_EunomiaLink_newTab.set(this, new NewTabAnchorController(this, () => this.slottedAnchor, () => this.dictionary.link.opensInNewTab));
|
|
121
|
+
/**
|
|
122
|
+
* Re-renders when the default slot changes, so an anchor added or removed
|
|
123
|
+
* after the first render switches between the two modes.
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
this.handleDefaultSlotChange = () => {
|
|
127
|
+
this.requestUpdate();
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The slotted anchor's counterpart of {@link handleFocus} : it lives in
|
|
131
|
+
* the light DOM, so its focus reaches the host as a plain `focusin`.
|
|
132
|
+
* @param event the host's focusin event.
|
|
133
|
+
* @private
|
|
134
|
+
*/
|
|
135
|
+
this.handleSlottedFocusIn = (event) => {
|
|
136
|
+
const target = event.target;
|
|
137
|
+
if (target === this.slottedAnchor && target.matches(":focus-visible")) {
|
|
138
|
+
this.states?.add("focus-visible");
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Clears the `focus-visible` custom state once the slotted anchor loses
|
|
143
|
+
* focus.
|
|
144
|
+
* @param event the host's focusout event.
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
this.handleSlottedFocusOut = (event) => {
|
|
148
|
+
if (event.target === this.slottedAnchor) {
|
|
149
|
+
this.states?.delete("focus-visible");
|
|
150
|
+
}
|
|
151
|
+
};
|
|
66
152
|
/**
|
|
67
153
|
* Re-renders when the `icon` slot's assigned content changes, so the
|
|
68
154
|
* `icon` prop fallback correctly appears/disappears as content is
|
|
@@ -72,6 +158,99 @@ let EunomiaLink = class EunomiaLink extends LitElement {
|
|
|
72
158
|
this.handleIconSlotChange = () => {
|
|
73
159
|
this.requestUpdate();
|
|
74
160
|
};
|
|
161
|
+
if (typeof this.attachInternals === "function") {
|
|
162
|
+
this.internals = this.attachInternals();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* React's server renderer writes a custom element's camelCase prop as an
|
|
167
|
+
* attribute of that exact name, lowercased (`visitedStyle="off"` becomes
|
|
168
|
+
* `visitedstyle="off"`), which never matches `visited-style`. Without this
|
|
169
|
+
* alias the link would start in `auto` (so, visited) and only switch once
|
|
170
|
+
* hydration sets the property, flashing the visited color on first load.
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
static get observedAttributes() {
|
|
174
|
+
return [...super.observedAttributes, "visitedstyle"];
|
|
175
|
+
}
|
|
176
|
+
attributeChangedCallback(name, oldValue, value) {
|
|
177
|
+
if (name === "visitedstyle") {
|
|
178
|
+
this.visitedStyle = (value ?? "auto");
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
super.attributeChangedCallback(name, oldValue, value);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The native `<a>` slotted as a direct child while `href` is unset, which
|
|
185
|
+
* then acts as the link itself : it's in the light DOM, so it's part of
|
|
186
|
+
* the server-rendered HTML, and a framework's own link component (Next's
|
|
187
|
+
* `<Link>`, Angular's `routerLink`, ...) can be that anchor. Navigation,
|
|
188
|
+
* `target`/`rel` and the new-tab hint are the consumer's own in this mode.
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
get slottedAnchor() {
|
|
192
|
+
return this.href ? null : this.querySelector(":scope > a");
|
|
193
|
+
}
|
|
194
|
+
connectedCallback() {
|
|
195
|
+
super.connectedCallback();
|
|
196
|
+
this.addEventListener("focusin", this.handleSlottedFocusIn);
|
|
197
|
+
this.addEventListener("focusout", this.handleSlottedFocusOut);
|
|
198
|
+
}
|
|
199
|
+
disconnectedCallback() {
|
|
200
|
+
this.removeEventListener("focusin", this.handleSlottedFocusIn);
|
|
201
|
+
this.removeEventListener("focusout", this.handleSlottedFocusOut);
|
|
202
|
+
super.disconnectedCallback();
|
|
203
|
+
}
|
|
204
|
+
updated(changed) {
|
|
205
|
+
super.updated(changed);
|
|
206
|
+
this.syncSlottedAnchor();
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Mirrors {@link current} onto the slotted anchor as `aria-current`,
|
|
210
|
+
* since that anchor, not the wrapper around it, is what assistive
|
|
211
|
+
* technology announces.
|
|
212
|
+
* @private
|
|
213
|
+
*/
|
|
214
|
+
syncSlottedAnchor() {
|
|
215
|
+
const anchor = this.slottedAnchor;
|
|
216
|
+
if (__classPrivateFieldGet(this, _EunomiaLink_currentAnchor, "f") && __classPrivateFieldGet(this, _EunomiaLink_currentAnchor, "f") !== anchor) {
|
|
217
|
+
__classPrivateFieldGet(this, _EunomiaLink_currentAnchor, "f").removeAttribute("aria-current");
|
|
218
|
+
__classPrivateFieldSet(this, _EunomiaLink_currentAnchor, undefined, "f");
|
|
219
|
+
}
|
|
220
|
+
if (!anchor) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
warnIgnoredHostLinkAttributes(this);
|
|
224
|
+
if (this.current) {
|
|
225
|
+
anchor.setAttribute("aria-current", "page");
|
|
226
|
+
__classPrivateFieldSet(this, _EunomiaLink_currentAnchor, anchor, "f");
|
|
227
|
+
}
|
|
228
|
+
else if (__classPrivateFieldGet(this, _EunomiaLink_currentAnchor, "f") === anchor) {
|
|
229
|
+
anchor.removeAttribute("aria-current");
|
|
230
|
+
__classPrivateFieldSet(this, _EunomiaLink_currentAnchor, undefined, "f");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Mirrors the inner anchor's real `:focus-visible` state onto the host as
|
|
235
|
+
* the `focus-visible` custom state, styled from outside with
|
|
236
|
+
* `eun-link:state(focus-visible)`. The anchor is shadow-internal, so the
|
|
237
|
+
* host's own `:focus-visible` never matches, and a plain `focus` listener
|
|
238
|
+
* can't stand in for it (a mouse click focuses the anchor too). Checking
|
|
239
|
+
* `:focus-visible` on the anchor itself keeps mouse focus out.
|
|
240
|
+
* @param event the anchor's focus event.
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
243
|
+
handleFocus(event) {
|
|
244
|
+
if (event.currentTarget.matches(":focus-visible")) {
|
|
245
|
+
this.states?.add("focus-visible");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Clears the `focus-visible` custom state once the anchor loses focus.
|
|
250
|
+
* @private
|
|
251
|
+
*/
|
|
252
|
+
handleBlur() {
|
|
253
|
+
this.states?.delete("focus-visible");
|
|
75
254
|
}
|
|
76
255
|
/**
|
|
77
256
|
* Gives an SPA router (Next.js, Angular, React Router, Vue Router, ...) a
|
|
@@ -85,6 +264,16 @@ let EunomiaLink = class EunomiaLink extends LitElement {
|
|
|
85
264
|
handleClick(event) {
|
|
86
265
|
handleLinkNavigation(this, event, this.href, this.target);
|
|
87
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* The decorative icon at the end of a link opening in a new tab, the
|
|
269
|
+
* wording being announced separately.
|
|
270
|
+
* @private
|
|
271
|
+
*/
|
|
272
|
+
renderExternalLinkIcon() {
|
|
273
|
+
return html `<span id="external-link-icon">
|
|
274
|
+
<eun-icon name="arrow_forward" shape="round" size="14"></eun-icon>
|
|
275
|
+
</span>`;
|
|
276
|
+
}
|
|
88
277
|
/**
|
|
89
278
|
* Renders the link template.
|
|
90
279
|
* @returns The rendered HTML template
|
|
@@ -92,6 +281,29 @@ let EunomiaLink = class EunomiaLink extends LitElement {
|
|
|
92
281
|
render() {
|
|
93
282
|
const isBlank = this.target === "_blank";
|
|
94
283
|
const hasIcon = !!this.icon || this.iconSlotEls?.length > 0;
|
|
284
|
+
const iconSlot = html `<slot
|
|
285
|
+
name="icon"
|
|
286
|
+
class=${classMap({ "has-icon": hasIcon })}
|
|
287
|
+
@slotchange=${this.handleIconSlotChange}
|
|
288
|
+
>
|
|
289
|
+
${this.icon
|
|
290
|
+
? html `<eun-icon name=${this.icon} size="18"></eun-icon>`
|
|
291
|
+
: nothing}
|
|
292
|
+
</slot>`;
|
|
293
|
+
if (this.slottedAnchor) {
|
|
294
|
+
return html `
|
|
295
|
+
<span
|
|
296
|
+
id="link"
|
|
297
|
+
part="link"
|
|
298
|
+
class=${classMap({ "has-icon": hasIcon, "slotted-link": true })}
|
|
299
|
+
>
|
|
300
|
+
${iconSlot}
|
|
301
|
+
<slot @slotchange=${this.handleDefaultSlotChange}></slot>
|
|
302
|
+
${__classPrivateFieldGet(this, _EunomiaLink_newTab, "f").isBlank ? this.renderExternalLinkIcon() : nothing}
|
|
303
|
+
</span>
|
|
304
|
+
`;
|
|
305
|
+
}
|
|
306
|
+
const newTabHint = `(${this.dictionary.link.opensInNewTab})`;
|
|
95
307
|
return html `
|
|
96
308
|
<a
|
|
97
309
|
id="link"
|
|
@@ -99,29 +311,27 @@ let EunomiaLink = class EunomiaLink extends LitElement {
|
|
|
99
311
|
class=${classMap({ "has-icon": hasIcon })}
|
|
100
312
|
href=${ifDefined(this.href)}
|
|
101
313
|
target=${this.target}
|
|
314
|
+
aria-current=${ifDefined(this.current ? "page" : undefined)}
|
|
102
315
|
rel=${ifDefined(isBlank ? "noopener noreferrer" : undefined)}
|
|
103
316
|
aria-label=${ifDefined(isBlank && this.ariaLabel
|
|
104
|
-
? `${this.ariaLabel}
|
|
317
|
+
? `${this.ariaLabel} ${newTabHint}`
|
|
105
318
|
: (this.ariaLabel ?? undefined))}
|
|
106
319
|
@click=${this.handleClick}
|
|
320
|
+
@focus=${this.handleFocus}
|
|
321
|
+
@blur=${this.handleBlur}
|
|
107
322
|
>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
class=${classMap({ "has-icon": hasIcon })}
|
|
111
|
-
@slotchange=${this.handleIconSlotChange}
|
|
112
|
-
>
|
|
113
|
-
${this.icon
|
|
114
|
-
? html `<eun-icon name=${this.icon} size="18"></eun-icon>`
|
|
115
|
-
: nothing}
|
|
116
|
-
</slot>
|
|
117
|
-
<slot></slot>
|
|
323
|
+
${iconSlot}
|
|
324
|
+
<slot @slotchange=${this.handleDefaultSlotChange}></slot>
|
|
118
325
|
${isBlank && !this.ariaLabel
|
|
119
|
-
? html `<span class="sr-only">
|
|
326
|
+
? html `<span class="sr-only"> ${newTabHint}</span>`
|
|
120
327
|
: nothing}
|
|
328
|
+
${isBlank ? this.renderExternalLinkIcon() : nothing}
|
|
121
329
|
</a>
|
|
122
330
|
`;
|
|
123
331
|
}
|
|
124
332
|
};
|
|
333
|
+
_EunomiaLink_currentAnchor = new WeakMap();
|
|
334
|
+
_EunomiaLink_newTab = new WeakMap();
|
|
125
335
|
/**
|
|
126
336
|
* Styles to import to the component.
|
|
127
337
|
*
|
|
@@ -140,11 +350,25 @@ __decorate([
|
|
|
140
350
|
property()
|
|
141
351
|
], EunomiaLink.prototype, "icon", void 0);
|
|
142
352
|
__decorate([
|
|
143
|
-
property({
|
|
353
|
+
property({
|
|
354
|
+
reflect: true,
|
|
355
|
+
converter: {
|
|
356
|
+
toAttribute: (value) => (value === "light" ? null : value),
|
|
357
|
+
},
|
|
358
|
+
})
|
|
144
359
|
], EunomiaLink.prototype, "theme", void 0);
|
|
145
360
|
__decorate([
|
|
146
|
-
property({
|
|
361
|
+
property({
|
|
362
|
+
reflect: true,
|
|
363
|
+
attribute: "visited-style",
|
|
364
|
+
converter: {
|
|
365
|
+
toAttribute: (value) => (value === "auto" ? null : value),
|
|
366
|
+
},
|
|
367
|
+
})
|
|
147
368
|
], EunomiaLink.prototype, "visitedStyle", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
property({ type: Boolean, reflect: true })
|
|
371
|
+
], EunomiaLink.prototype, "current", void 0);
|
|
148
372
|
__decorate([
|
|
149
373
|
queryAssignedElements({ slot: "icon" })
|
|
150
374
|
], EunomiaLink.prototype, "iconSlotEls", void 0);
|