@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
package/dist/ssr/toolbar-ssr.css
CHANGED
|
@@ -1,41 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* eun-toolbar documentation's Server-side rendering notes : the default
|
|
6
|
-
* slot (the mobile panel's own content, everything slotted in without a
|
|
7
|
-
* `slot` attribute) is only ever hidden by eun-toolbar's own Shadow DOM,
|
|
8
|
-
* either tucked inside a closed native popover once the element is
|
|
9
|
-
* upgraded and `mobile` is true, or simply never projected anywhere once
|
|
10
|
-
* upgraded and it's false. Server-rendered HTML has no Shadow DOM yet,
|
|
11
|
-
* so that content renders as plain, unstyled light-DOM children instead —
|
|
12
|
-
* visible, unpositioned, and often full-width/height, on top of
|
|
13
|
-
* everything else on the page, until the element upgrades.
|
|
14
|
-
*
|
|
15
|
-
* This stylesheet lives in the host document instead, hiding that exact
|
|
16
|
-
* content through `:not(:defined)`, which is true from first paint and
|
|
17
|
-
* stops matching permanently the moment the browser upgrades the
|
|
18
|
-
* element — handing off to eun-toolbar's own Shadow DOM at exactly the
|
|
19
|
-
* point it takes over, with no gap. Safe regardless of viewport : the
|
|
20
|
-
* content stays exactly as hidden post-upgrade whether `mobile` ends up
|
|
21
|
-
* true (closed popover) or false (never rendered at all), so this never
|
|
22
|
-
* has to guess at the breakpoint.
|
|
23
|
-
*
|
|
24
|
-
* Usage — link it in the page `<head>`, alongside (not instead of)
|
|
25
|
-
* importing "@eunomia/elements/toolbar.js" :
|
|
26
|
-
*
|
|
27
|
-
* <link
|
|
28
|
-
* rel="stylesheet"
|
|
29
|
-
* href="node_modules/@eunomia/elements/dist/ssr/toolbar-ssr.css"
|
|
30
|
-
* />
|
|
31
|
-
*
|
|
32
|
-
* The `start`/`center`/`end` slots aren't covered here : that content is
|
|
33
|
-
* meant to stay visible (and stay part of LCP) before upgrade too, same
|
|
34
|
-
* as after, so hiding it isn't this stylesheet's job. Style its own
|
|
35
|
-
* pre-upgrade layout, if needed, directly with `eun-toolbar:not(:defined)`
|
|
36
|
-
* in the host page's own CSS.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
eun-toolbar:not(:defined) > :not([slot]) {
|
|
1
|
+
eun-toolbar:not(:defined) > :not([slot]),
|
|
2
|
+
eun-toolbar:not(:defined) > [slot="skip-links"],
|
|
3
|
+
eun-toolbar:not(:defined) > [slot="menu-icon"],
|
|
4
|
+
eun-toolbar:not(:defined) > [slot="close-icon"] {
|
|
40
5
|
display: none;
|
|
41
6
|
}
|
|
7
|
+
|
|
8
|
+
eun-toolbar:not(:defined) {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--toolbar-gap, 16px);
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: var(--toolbar-height, 72px);
|
|
15
|
+
padding: var(--toolbar-padding, 0 24px);
|
|
16
|
+
position: sticky;
|
|
17
|
+
top: 0;
|
|
18
|
+
z-index: var(--toolbar-z-index, 100);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
eun-toolbar[position="fixed"]:not(:defined) {
|
|
22
|
+
position: fixed;
|
|
23
|
+
inset-inline: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
eun-toolbar[position="static"]:not(:defined) {
|
|
27
|
+
position: static;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
eun-toolbar:not(:defined) > [slot="start"] {
|
|
31
|
+
order: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
eun-toolbar:not(:defined) > [slot="center"] {
|
|
35
|
+
order: 2;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
eun-toolbar:not(:defined) > [slot="end"] {
|
|
39
|
+
order: 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
eun-toolbar:not(:defined)
|
|
43
|
+
> [slot="center"]:where(:nth-child(1 of [slot="center"])) {
|
|
44
|
+
margin-inline-start: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
eun-toolbar:not(:defined)
|
|
48
|
+
> [slot="center"]:where(:nth-last-child(1 of [slot="center"])) {
|
|
49
|
+
margin-inline-end: auto;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
eun-toolbar:not(:defined):where(:not(:has(> [slot="center"])))
|
|
53
|
+
> [slot="end"]:where(:nth-child(1 of [slot="end"])) {
|
|
54
|
+
margin-inline-start: auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
eun-toolbar:not(:defined):where(
|
|
58
|
+
:has(> [slot="start"]):has(> [slot="end"]):not(
|
|
59
|
+
:has(> :nth-child(2 of [slot="start"]), > :nth-child(2 of [slot="end"]))
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
> :is([slot="start"], [slot="end"]) {
|
|
63
|
+
flex: 1 1 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
eun-toolbar:not(:defined):where(
|
|
67
|
+
:has(> [slot="start"]):has(> [slot="end"]):not(
|
|
68
|
+
:has(> :nth-child(2 of [slot="start"]), > :nth-child(2 of [slot="end"]))
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
> [slot="end"] {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: flex-end;
|
|
75
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* independent of whether that something is an action being taken or a
|
|
4
4
|
* state being observed. Shared by feedback/display components (alert,
|
|
5
5
|
* toast, chip, tag, tooltip, progress-bar), and partly borrowed by
|
|
6
|
-
* {@link
|
|
6
|
+
* {@link EunomiaActionColor} : a "critical" button and a "critical" alert
|
|
7
7
|
* mean the same thing and must share the same red, or the app ends up with
|
|
8
8
|
* two unrelated definitions of "critical" depending on whether the thing
|
|
9
9
|
* wearing the color is clickable.
|
|
@@ -12,7 +12,9 @@ export type EunomiaSeverity = "info" | "success" | "warning" | "critical" | "neu
|
|
|
12
12
|
/**
|
|
13
13
|
* Canonical color union for interactive/action components (button, fab,
|
|
14
14
|
* dropdown-button, toggle-group/-item, badge, modal's confirm/cancel
|
|
15
|
-
* buttons)
|
|
15
|
+
* buttons), always exposed as `color`, like tag, chip and tooltip's own
|
|
16
|
+
* {@link EunomiaTone} palette. `variant` stays reserved for a shape or
|
|
17
|
+
* style (a field's outline/fill/underline, a loader's dots, ...). Composed of two genuinely different things sharing one visual
|
|
16
18
|
* slot — an action only ever needs one color, never both at once, so they
|
|
17
19
|
* live in a single prop rather than two independently-precedenced ones :
|
|
18
20
|
* - `"primary"` / `"secondary"` : pure emphasis/hierarchy, meaningless
|
|
@@ -26,18 +28,18 @@ export type EunomiaSeverity = "info" | "success" | "warning" | "critical" | "neu
|
|
|
26
28
|
* three do.
|
|
27
29
|
*
|
|
28
30
|
* Most components expose this union as-is ; only a genuine subset (see
|
|
29
|
-
* {@link
|
|
31
|
+
* {@link EunomiaModalConfirmColor}) needs a further narrowing on top of it.
|
|
30
32
|
*/
|
|
31
|
-
export type
|
|
33
|
+
export type EunomiaActionColor = "primary" | "secondary" | Extract<EunomiaSeverity, "critical" | "success" | "warning">;
|
|
32
34
|
/**
|
|
33
|
-
* The two-value {@link
|
|
34
|
-
* `
|
|
35
|
+
* The two-value {@link EunomiaActionColor} subset `eun-modal`'s
|
|
36
|
+
* `confirmColor` uses — a confirm button is only ever the modal's default
|
|
35
37
|
* emphasis or a destructive warning, never `secondary`/`success`/`warning`.
|
|
36
38
|
*/
|
|
37
|
-
export type
|
|
39
|
+
export type EunomiaModalConfirmColor = Extract<EunomiaActionColor, "primary" | "critical">;
|
|
38
40
|
/**
|
|
39
41
|
* Canonical surface-treatment union : how a component's background/border is
|
|
40
|
-
* rendered, independent of its `
|
|
42
|
+
* rendered, independent of its `severity`/`color`. Always named
|
|
41
43
|
* `appearance` on the components that expose it — never `type`, which stays
|
|
42
44
|
* reserved for a native HTML mechanism (e.g. `eun-button`'s `type="submit"`)
|
|
43
45
|
* wherever it appears.
|
|
@@ -53,8 +55,16 @@ export type EunomiaModalConfirmVariant = Extract<EunomiaActionVariant, "primary"
|
|
|
53
55
|
* (elevated, drop shadow) doesn't share that constraint : it's a static
|
|
54
56
|
* effect, not one gated behind interaction, so `eun-card` also exposes it
|
|
55
57
|
* (see {@link EunomiaCardAppearance}) despite being a passive container.
|
|
58
|
+
* `underline` (a bottom border only) is a form field's own look, and
|
|
59
|
+
* `transparent` (the pale tint, see-through instead of opaque) a scheduler
|
|
60
|
+
* event chip's : each belongs to a single family, like `ghost`.
|
|
61
|
+
*
|
|
62
|
+
* `appearance` only ever paints the surface (background, border, shadow)
|
|
63
|
+
* and combines with `color`/`severity`. A property changing what is drawn
|
|
64
|
+
* (a loader's dots or bar, a skeleton's shape) is a `variant` instead,
|
|
65
|
+
* with values of its own that mean nothing outside that component.
|
|
56
66
|
*/
|
|
57
|
-
export type EunomiaAppearance = "default" | "fill" | "outline" | "flat" | "raised" | "ghost";
|
|
67
|
+
export type EunomiaAppearance = "default" | "fill" | "outline" | "flat" | "raised" | "ghost" | "underline" | "transparent";
|
|
58
68
|
/**
|
|
59
69
|
* The four-value {@link EunomiaAppearance} subset feedback/display components
|
|
60
70
|
* (alert, toast, chip, tag, tooltip) actually use — no `raised`/`ghost`,
|
|
@@ -82,9 +92,15 @@ export type EunomiaToggleAppearance = Extract<EunomiaAppearance, "default" | "ou
|
|
|
82
92
|
* share `ghost`'s constraint.
|
|
83
93
|
*/
|
|
84
94
|
export type EunomiaCardAppearance = Extract<EunomiaAppearance, "default" | "fill" | "raised">;
|
|
95
|
+
/**
|
|
96
|
+
* The three-value {@link EunomiaAppearance} subset text-like form fields
|
|
97
|
+
* use : a bordered box (`outline`, their default), a muted background with
|
|
98
|
+
* no border (`flat`), or a bottom border only (`underline`).
|
|
99
|
+
*/
|
|
100
|
+
export type EunomiaFieldAppearance = Extract<EunomiaAppearance, "outline" | "flat" | "underline">;
|
|
85
101
|
/**
|
|
86
102
|
* Canonical decorative, non-semantic palette : a plain brand/neutral color
|
|
87
|
-
* pick with no status meaning, as opposed to {@link
|
|
103
|
+
* pick with no status meaning, as opposed to {@link EunomiaActionColor}/
|
|
88
104
|
* {@link EunomiaSeverity}. Always named `color` on the components that expose
|
|
89
105
|
* it.
|
|
90
106
|
*/
|
|
@@ -15,3 +15,17 @@
|
|
|
15
15
|
* @param target the anchor's target, if any.
|
|
16
16
|
*/
|
|
17
17
|
export declare function handleLinkNavigation(host: HTMLElement, event: MouseEvent, href: string | undefined, target?: string | null): void;
|
|
18
|
+
/**
|
|
19
|
+
* Warns once when a host in slotted anchor mode (a native `<a>` as a direct
|
|
20
|
+
* child, `href` unset) still carries link attributes of its own. The
|
|
21
|
+
* anchor is the link in that mode, so `aria-label`, `target`, `rel` and
|
|
22
|
+
* `download` left on the host are ignored without any visible sign : a
|
|
23
|
+
* forgotten `aria-label` ends up on an element with no role, and the link
|
|
24
|
+
* loses its accessible name.
|
|
25
|
+
*
|
|
26
|
+
* @param host the link, button or card whose anchor is slotted.
|
|
27
|
+
*/
|
|
28
|
+
export declare function warnIgnoredHostLinkAttributes(host: HTMLElement & {
|
|
29
|
+
target?: string;
|
|
30
|
+
download?: string;
|
|
31
|
+
}): void;
|
|
@@ -42,3 +42,36 @@ export function handleLinkNavigation(host, event, href, target) {
|
|
|
42
42
|
event.preventDefault();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Hosts already warned by {@link warnIgnoredHostLinkAttributes}, so each
|
|
47
|
+
* one only logs once however often it updates.
|
|
48
|
+
*/
|
|
49
|
+
const warnedHosts = new WeakSet();
|
|
50
|
+
/**
|
|
51
|
+
* Warns once when a host in slotted anchor mode (a native `<a>` as a direct
|
|
52
|
+
* child, `href` unset) still carries link attributes of its own. The
|
|
53
|
+
* anchor is the link in that mode, so `aria-label`, `target`, `rel` and
|
|
54
|
+
* `download` left on the host are ignored without any visible sign : a
|
|
55
|
+
* forgotten `aria-label` ends up on an element with no role, and the link
|
|
56
|
+
* loses its accessible name.
|
|
57
|
+
*
|
|
58
|
+
* @param host the link, button or card whose anchor is slotted.
|
|
59
|
+
*/
|
|
60
|
+
export function warnIgnoredHostLinkAttributes(host) {
|
|
61
|
+
if (warnedHosts.has(host)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const ignored = ['aria-label', 'target', 'rel', 'download'].filter((name) => host.hasAttribute(name));
|
|
65
|
+
if (!ignored.includes('target') && host.target && host.target !== '_self') {
|
|
66
|
+
ignored.push('target');
|
|
67
|
+
}
|
|
68
|
+
if (!ignored.includes('download') && host.download) {
|
|
69
|
+
ignored.push('download');
|
|
70
|
+
}
|
|
71
|
+
if (!ignored.length) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
warnedHosts.add(host);
|
|
75
|
+
console.warn(`<${host.localName}>: ${ignored.join(', ')} ignored on the host, since ` +
|
|
76
|
+
'the slotted <a> is the link. Move them onto the <a> itself.', host);
|
|
77
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Class of a visually-hidden "opens in a new tab" text the consumer writes
|
|
4
|
+
* inside the slotted anchor, hidden by `links-ssr.css`. It's part of the
|
|
5
|
+
* anchor's accessible name and of the server-rendered HTML, so it's
|
|
6
|
+
* announced everywhere, links lists and no-JS pages included, and the
|
|
7
|
+
* controller then leaves the anchor's `aria-description` alone.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NEW_TAB_HINT_CLASS = "eun-new-tab-hint";
|
|
10
|
+
/**
|
|
11
|
+
* Announces a slotted anchor opening in a new tab, for a link, button or
|
|
12
|
+
* card whose native `<a>` is slotted as a direct child. The anchor belongs
|
|
13
|
+
* to the consumer (and to their framework, which would undo or trip over an
|
|
14
|
+
* injected child during hydration), so the hint goes on its
|
|
15
|
+
* `aria-description` rather than into its content, leaving its text and
|
|
16
|
+
* `aria-label` untouched. A description the consumer set themselves is
|
|
17
|
+
* never overwritten, and only the one this controller wrote is ever removed.
|
|
18
|
+
* A description only reaches some assistive technology, so an anchor
|
|
19
|
+
* holding a {@link NEW_TAB_HINT_CLASS} text of its own gets none.
|
|
20
|
+
*
|
|
21
|
+
* The anchor's `target` and content can change after the first render (a
|
|
22
|
+
* framework re-render), which no `slotchange` reports, so they're observed
|
|
23
|
+
* directly and re-render the host, whose visible new-tab icon keys off
|
|
24
|
+
* {@link isBlank}.
|
|
25
|
+
*/
|
|
26
|
+
export declare class NewTabAnchorController implements ReactiveController {
|
|
27
|
+
#private;
|
|
28
|
+
private readonly host;
|
|
29
|
+
private readonly getAnchor;
|
|
30
|
+
private readonly getHint;
|
|
31
|
+
/**
|
|
32
|
+
* @param host the link, button or card.
|
|
33
|
+
* @param getAnchor returns the slotted anchor, or null outside that mode.
|
|
34
|
+
* @param getHint returns the localized "opens in a new tab" wording.
|
|
35
|
+
*/
|
|
36
|
+
constructor(host: ReactiveControllerHost & HTMLElement, getAnchor: () => HTMLAnchorElement | null, getHint: () => string);
|
|
37
|
+
/**
|
|
38
|
+
* Whether the slotted anchor, if any, opens in a new tab.
|
|
39
|
+
*/
|
|
40
|
+
get isBlank(): boolean;
|
|
41
|
+
hostConnected(): void;
|
|
42
|
+
hostDisconnected(): void;
|
|
43
|
+
hostUpdated(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
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");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
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");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _NewTabAnchorController_instances, _NewTabAnchorController_described, _NewTabAnchorController_observer, _NewTabAnchorController_clear;
|
|
13
|
+
/**
|
|
14
|
+
* Class of a visually-hidden "opens in a new tab" text the consumer writes
|
|
15
|
+
* inside the slotted anchor, hidden by `links-ssr.css`. It's part of the
|
|
16
|
+
* anchor's accessible name and of the server-rendered HTML, so it's
|
|
17
|
+
* announced everywhere, links lists and no-JS pages included, and the
|
|
18
|
+
* controller then leaves the anchor's `aria-description` alone.
|
|
19
|
+
*/
|
|
20
|
+
export const NEW_TAB_HINT_CLASS = "eun-new-tab-hint";
|
|
21
|
+
/**
|
|
22
|
+
* Announces a slotted anchor opening in a new tab, for a link, button or
|
|
23
|
+
* card whose native `<a>` is slotted as a direct child. The anchor belongs
|
|
24
|
+
* to the consumer (and to their framework, which would undo or trip over an
|
|
25
|
+
* injected child during hydration), so the hint goes on its
|
|
26
|
+
* `aria-description` rather than into its content, leaving its text and
|
|
27
|
+
* `aria-label` untouched. A description the consumer set themselves is
|
|
28
|
+
* never overwritten, and only the one this controller wrote is ever removed.
|
|
29
|
+
* A description only reaches some assistive technology, so an anchor
|
|
30
|
+
* holding a {@link NEW_TAB_HINT_CLASS} text of its own gets none.
|
|
31
|
+
*
|
|
32
|
+
* The anchor's `target` and content can change after the first render (a
|
|
33
|
+
* framework re-render), which no `slotchange` reports, so they're observed
|
|
34
|
+
* directly and re-render the host, whose visible new-tab icon keys off
|
|
35
|
+
* {@link isBlank}.
|
|
36
|
+
*/
|
|
37
|
+
export class NewTabAnchorController {
|
|
38
|
+
/**
|
|
39
|
+
* @param host the link, button or card.
|
|
40
|
+
* @param getAnchor returns the slotted anchor, or null outside that mode.
|
|
41
|
+
* @param getHint returns the localized "opens in a new tab" wording.
|
|
42
|
+
*/
|
|
43
|
+
constructor(host, getAnchor, getHint) {
|
|
44
|
+
_NewTabAnchorController_instances.add(this);
|
|
45
|
+
this.host = host;
|
|
46
|
+
this.getAnchor = getAnchor;
|
|
47
|
+
this.getHint = getHint;
|
|
48
|
+
/**
|
|
49
|
+
* The anchor this controller last wrote `aria-description` on, so it can
|
|
50
|
+
* clear it once the anchor stops opening in a new tab or is swapped out.
|
|
51
|
+
*/
|
|
52
|
+
_NewTabAnchorController_described.set(this, void 0);
|
|
53
|
+
_NewTabAnchorController_observer.set(this, new MutationObserver((records) => {
|
|
54
|
+
const anchor = this.getAnchor();
|
|
55
|
+
if (anchor && records.some((record) => anchor.contains(record.target))) {
|
|
56
|
+
this.host.requestUpdate();
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
host.addController(this);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Whether the slotted anchor, if any, opens in a new tab.
|
|
63
|
+
*/
|
|
64
|
+
get isBlank() {
|
|
65
|
+
return this.getAnchor()?.target === "_blank";
|
|
66
|
+
}
|
|
67
|
+
hostConnected() {
|
|
68
|
+
__classPrivateFieldGet(this, _NewTabAnchorController_observer, "f").observe(this.host, {
|
|
69
|
+
subtree: true,
|
|
70
|
+
childList: true,
|
|
71
|
+
attributeFilter: ["target"],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
hostDisconnected() {
|
|
75
|
+
__classPrivateFieldGet(this, _NewTabAnchorController_observer, "f").disconnect();
|
|
76
|
+
}
|
|
77
|
+
hostUpdated() {
|
|
78
|
+
const anchor = this.getAnchor();
|
|
79
|
+
if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") && __classPrivateFieldGet(this, _NewTabAnchorController_described, "f") !== anchor) {
|
|
80
|
+
__classPrivateFieldGet(this, _NewTabAnchorController_instances, "m", _NewTabAnchorController_clear).call(this);
|
|
81
|
+
}
|
|
82
|
+
if (!anchor) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const ownHint = !!anchor.querySelector(`.${NEW_TAB_HINT_CLASS}`);
|
|
86
|
+
if (!this.isBlank || ownHint) {
|
|
87
|
+
if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") === anchor) {
|
|
88
|
+
__classPrivateFieldGet(this, _NewTabAnchorController_instances, "m", _NewTabAnchorController_clear).call(this);
|
|
89
|
+
}
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") !== anchor && anchor.hasAttribute("aria-description")) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
anchor.setAttribute("aria-description", this.getHint());
|
|
96
|
+
__classPrivateFieldSet(this, _NewTabAnchorController_described, anchor, "f");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_NewTabAnchorController_described = new WeakMap(), _NewTabAnchorController_observer = new WeakMap(), _NewTabAnchorController_instances = new WeakSet(), _NewTabAnchorController_clear = function _NewTabAnchorController_clear() {
|
|
100
|
+
__classPrivateFieldGet(this, _NewTabAnchorController_described, "f")?.removeAttribute("aria-description");
|
|
101
|
+
__classPrivateFieldSet(this, _NewTabAnchorController_described, undefined, "f");
|
|
102
|
+
};
|
|
@@ -146,6 +146,39 @@ export declare function renderInline(nodes: InlineNode[]): TemplateResult;
|
|
|
146
146
|
* @returns the formatted template.
|
|
147
147
|
*/
|
|
148
148
|
export declare function formatRichText(text: string): TemplateResult;
|
|
149
|
+
/**
|
|
150
|
+
* Strips every Markdown-lite marker from a value and returns what a reader
|
|
151
|
+
* actually sees, as a plain string : the `[align:...]` directive, `**`,
|
|
152
|
+
* `{color=name}`, link URLs and so on are removed (a link keeps its label),
|
|
153
|
+
* and one newline is kept between lines. Needs no DOM, so it runs anywhere,
|
|
154
|
+
* including on the server, unlike {@link formatRichText}.
|
|
155
|
+
*
|
|
156
|
+
* Always consistent with {@link getPlainTextLength} :
|
|
157
|
+
* `toPlainText(text).length === getPlainTextLength(text)`. Handy for
|
|
158
|
+
* structured data (JSON-LD), meta descriptions, search indexes or
|
|
159
|
+
* notifications.
|
|
160
|
+
*
|
|
161
|
+
* @param text the raw Markdown-lite string.
|
|
162
|
+
* @returns the plain text.
|
|
163
|
+
*/
|
|
164
|
+
export declare function toPlainText(text: string): string;
|
|
165
|
+
/**
|
|
166
|
+
* Converts a Markdown-lite string into an HTML string, with the same markup
|
|
167
|
+
* as {@link formatRichText} (`<p>`, `<ul>`, `<strong>`, ...). Needs no DOM
|
|
168
|
+
* and no Lit, so it fits server rendering (a Next.js Server Component, an
|
|
169
|
+
* email, an RSS feed) where {@link formatRichText}'s template can't be used.
|
|
170
|
+
*
|
|
171
|
+
* Every piece of text and every attribute is escaped, and a link whose URL
|
|
172
|
+
* uses anything other than a relative path, a fragment, `http`, `https`,
|
|
173
|
+
* `mailto` or `tel` (such as `javascript:`) is rendered as its plain label,
|
|
174
|
+
* so the result is safe to inject with `innerHTML` or React's
|
|
175
|
+
* `dangerouslySetInnerHTML`. The `[align:...]` directive is stripped, read
|
|
176
|
+
* it with {@link splitAlign} if you need it.
|
|
177
|
+
*
|
|
178
|
+
* @param text the raw Markdown-lite string.
|
|
179
|
+
* @returns the HTML string.
|
|
180
|
+
*/
|
|
181
|
+
export declare function toHtml(text: string): string;
|
|
149
182
|
/**
|
|
150
183
|
* Populates a contenteditable root with the given Markdown-lite value,
|
|
151
184
|
* replacing its entire content — used both for the `formatting` toolbar's
|
|
@@ -126,15 +126,6 @@ export function parseInlineNodes(text) {
|
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
// `***text***` : bold and italic together produce adjacent `**`+`*`
|
|
130
|
-
// delimiters at both ends (from nesting `<strong><em>`/`</em></strong>`),
|
|
131
|
-
// which the plain `**` check below can't tell apart from "close bold,
|
|
132
|
-
// then a stray, unmatched italic `*`" — it greedily consumes the first
|
|
133
|
-
// two of the three as bold's own closer, leaving the third orphaned
|
|
134
|
-
// with no closer of its own within the once-was-italic content, and
|
|
135
|
-
// the italic wrapping is silently lost on reparse. Handling the
|
|
136
|
-
// three-character run as one atomic unit first — same convention real
|
|
137
|
-
// Markdown uses for `***bold italic***` — avoids that ambiguity.
|
|
138
129
|
if (text.startsWith("***", i)) {
|
|
139
130
|
const closeIndex = text.indexOf("***", i + 3);
|
|
140
131
|
if (closeIndex !== -1) {
|
|
@@ -266,6 +257,39 @@ function renderInlineNode(node) {
|
|
|
266
257
|
return html `<a href=${node.href}>${renderInline(node.children)}</a>`;
|
|
267
258
|
}
|
|
268
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Splits a Markdown-lite body (without its `[align:...]` directive) into
|
|
262
|
+
* blocks : consecutive `- ` lines become one list, other non-empty lines
|
|
263
|
+
* become paragraphs, and empty lines are dropped. Shared by every output
|
|
264
|
+
* format ({@link formatRichText}, {@link toHtml}, {@link toPlainText}) so
|
|
265
|
+
* they can never disagree on what counts as a paragraph or a list.
|
|
266
|
+
*
|
|
267
|
+
* @param body the Markdown-lite body.
|
|
268
|
+
* @returns the blocks, in order.
|
|
269
|
+
*/
|
|
270
|
+
function splitBlocks(body) {
|
|
271
|
+
const blocks = [];
|
|
272
|
+
let list = [];
|
|
273
|
+
const flushList = () => {
|
|
274
|
+
if (list.length) {
|
|
275
|
+
blocks.push({ type: "list", items: list });
|
|
276
|
+
list = [];
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
body.split("\n").forEach((line) => {
|
|
280
|
+
const trimmed = line.trim();
|
|
281
|
+
if (trimmed.startsWith("- ")) {
|
|
282
|
+
list.push(trimmed.slice(2));
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
flushList();
|
|
286
|
+
if (trimmed) {
|
|
287
|
+
blocks.push({ type: "paragraph", text: trimmed });
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
flushList();
|
|
291
|
+
return blocks;
|
|
292
|
+
}
|
|
269
293
|
/**
|
|
270
294
|
* Converts a multi-line Markdown-lite string into a Lit template — see
|
|
271
295
|
* {@link parseInlineNodes} for the supported inline syntax.
|
|
@@ -284,30 +308,115 @@ function renderInlineNode(node) {
|
|
|
284
308
|
*/
|
|
285
309
|
export function formatRichText(text) {
|
|
286
310
|
const { body } = splitAlign(text);
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
311
|
+
return html `${splitBlocks(body).map((block) => block.type === "list"
|
|
312
|
+
? html `<ul>
|
|
313
|
+
${block.items.map((item) => html `<li>${renderInline(parseInlineNodes(item))}</li>`)}
|
|
314
|
+
</ul>`
|
|
315
|
+
: html `<p>${renderInline(parseInlineNodes(block.text))}</p>`)}`;
|
|
316
|
+
}
|
|
317
|
+
function inlineToPlainText(nodes) {
|
|
318
|
+
return nodes
|
|
319
|
+
.map((node) => node.type === "text" ? node.value : inlineToPlainText(node.children))
|
|
320
|
+
.join("");
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Strips every Markdown-lite marker from a value and returns what a reader
|
|
324
|
+
* actually sees, as a plain string : the `[align:...]` directive, `**`,
|
|
325
|
+
* `{color=name}`, link URLs and so on are removed (a link keeps its label),
|
|
326
|
+
* and one newline is kept between lines. Needs no DOM, so it runs anywhere,
|
|
327
|
+
* including on the server, unlike {@link formatRichText}.
|
|
328
|
+
*
|
|
329
|
+
* Always consistent with {@link getPlainTextLength} :
|
|
330
|
+
* `toPlainText(text).length === getPlainTextLength(text)`. Handy for
|
|
331
|
+
* structured data (JSON-LD), meta descriptions, search indexes or
|
|
332
|
+
* notifications.
|
|
333
|
+
*
|
|
334
|
+
* @param text the raw Markdown-lite string.
|
|
335
|
+
* @returns the plain text.
|
|
336
|
+
*/
|
|
337
|
+
export function toPlainText(text) {
|
|
338
|
+
const { body } = splitAlign(text);
|
|
339
|
+
const lines = body.length ? body.split("\n") : [""];
|
|
340
|
+
return lines
|
|
341
|
+
.map((line) => inlineToPlainText(parseInlineNodes(line)))
|
|
342
|
+
.join("\n");
|
|
343
|
+
}
|
|
344
|
+
const HTML_ESCAPES = {
|
|
345
|
+
"&": "&",
|
|
346
|
+
"<": "<",
|
|
347
|
+
">": ">",
|
|
348
|
+
'"': """,
|
|
349
|
+
"'": "'",
|
|
350
|
+
};
|
|
351
|
+
function escapeHtml(value) {
|
|
352
|
+
return value.replace(/[&<>"']/g, (char) => HTML_ESCAPES[char]);
|
|
353
|
+
}
|
|
354
|
+
const SAFE_URL_SCHEMES = new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
355
|
+
/**
|
|
356
|
+
* Whether a link destination is safe to put in an `href` : relative URLs,
|
|
357
|
+
* fragments and the `http`, `https`, `mailto` and `tel` schemes. Anything
|
|
358
|
+
* else (`javascript:`, `data:`, ...) is refused.
|
|
359
|
+
*
|
|
360
|
+
* @param href the raw destination.
|
|
361
|
+
* @returns `true` when it can be emitted as an `href`.
|
|
362
|
+
*/
|
|
363
|
+
function isSafeHref(href) {
|
|
364
|
+
const normalized = href.replace(/[\u0000-\u0020]/g, "");
|
|
365
|
+
const scheme = /^([a-z][a-z0-9+.-]*:)/i.exec(normalized);
|
|
366
|
+
return !scheme || SAFE_URL_SCHEMES.has(scheme[1].toLowerCase());
|
|
367
|
+
}
|
|
368
|
+
function inlineToHtml(nodes) {
|
|
369
|
+
return nodes.map(inlineNodeToHtml).join("");
|
|
370
|
+
}
|
|
371
|
+
function inlineNodeToHtml(node) {
|
|
372
|
+
switch (node.type) {
|
|
373
|
+
case "text":
|
|
374
|
+
return escapeHtml(node.value);
|
|
375
|
+
case "bold":
|
|
376
|
+
return `<strong>${inlineToHtml(node.children)}</strong>`;
|
|
377
|
+
case "italic":
|
|
378
|
+
return `<em>${inlineToHtml(node.children)}</em>`;
|
|
379
|
+
case "underline":
|
|
380
|
+
return `<u>${inlineToHtml(node.children)}</u>`;
|
|
381
|
+
case "color": {
|
|
382
|
+
const color = findRichTextColor(node.color);
|
|
383
|
+
return `<span data-color="${escapeHtml(node.color)}" style="color: ${color?.text ?? "inherit"}">${inlineToHtml(node.children)}</span>`;
|
|
303
384
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
385
|
+
case "highlight": {
|
|
386
|
+
const color = findRichTextColor(node.color);
|
|
387
|
+
return `<span data-highlight="${escapeHtml(node.color)}" style="background-color: ${color?.highlight ?? "transparent"}">${inlineToHtml(node.children)}</span>`;
|
|
307
388
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
389
|
+
case "link":
|
|
390
|
+
return isSafeHref(node.href)
|
|
391
|
+
? `<a href="${escapeHtml(node.href)}">${inlineToHtml(node.children)}</a>`
|
|
392
|
+
: inlineToHtml(node.children);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Converts a Markdown-lite string into an HTML string, with the same markup
|
|
397
|
+
* as {@link formatRichText} (`<p>`, `<ul>`, `<strong>`, ...). Needs no DOM
|
|
398
|
+
* and no Lit, so it fits server rendering (a Next.js Server Component, an
|
|
399
|
+
* email, an RSS feed) where {@link formatRichText}'s template can't be used.
|
|
400
|
+
*
|
|
401
|
+
* Every piece of text and every attribute is escaped, and a link whose URL
|
|
402
|
+
* uses anything other than a relative path, a fragment, `http`, `https`,
|
|
403
|
+
* `mailto` or `tel` (such as `javascript:`) is rendered as its plain label,
|
|
404
|
+
* so the result is safe to inject with `innerHTML` or React's
|
|
405
|
+
* `dangerouslySetInnerHTML`. The `[align:...]` directive is stripped, read
|
|
406
|
+
* it with {@link splitAlign} if you need it.
|
|
407
|
+
*
|
|
408
|
+
* @param text the raw Markdown-lite string.
|
|
409
|
+
* @returns the HTML string.
|
|
410
|
+
*/
|
|
411
|
+
export function toHtml(text) {
|
|
412
|
+
const { body } = splitAlign(text);
|
|
413
|
+
return splitBlocks(body)
|
|
414
|
+
.map((block) => block.type === "list"
|
|
415
|
+
? `<ul>${block.items
|
|
416
|
+
.map((item) => `<li>${inlineToHtml(parseInlineNodes(item))}</li>`)
|
|
417
|
+
.join("")}</ul>`
|
|
418
|
+
: `<p>${inlineToHtml(parseInlineNodes(block.text))}</p>`)
|
|
419
|
+
.join("");
|
|
311
420
|
}
|
|
312
421
|
/**
|
|
313
422
|
* Builds one `<p>` per line of `body`, each with its inline Markdown-lite
|
|
@@ -351,13 +460,6 @@ function buildParagraphs(body) {
|
|
|
351
460
|
render(html `${lines.map((line) => html `<p>${renderInline(parseInlineNodes(line))}</p>`)}`, scratch);
|
|
352
461
|
stripComments(scratch);
|
|
353
462
|
const paragraphs = Array.from(scratch.children);
|
|
354
|
-
// A genuinely empty <p> (an empty line, most commonly the sole paragraph
|
|
355
|
-
// of an otherwise-empty field) has no content a browser can anchor a
|
|
356
|
-
// caret inside — clicking into it then often places the caret at the
|
|
357
|
-
// *root* level instead, right before the <p>, so anything typed lands
|
|
358
|
-
// there as a stray text node the block-based serializer never sees
|
|
359
|
-
// (value silently stays empty forever). A <br> gives every empty
|
|
360
|
-
// paragraph a real caret position of its own.
|
|
361
463
|
paragraphs.forEach((paragraph) => {
|
|
362
464
|
if (!paragraph.hasChildNodes()) {
|
|
363
465
|
paragraph.appendChild(document.createElement("br"));
|
|
@@ -394,20 +496,9 @@ const INLINE_TAG_MARKERS = {
|
|
|
394
496
|
};
|
|
395
497
|
function serializeInlineNode(node) {
|
|
396
498
|
if (node.nodeType === Node.TEXT_NODE) {
|
|
397
|
-
// U+200B (zero-width space) : the textarea's own toolbar uses it as an
|
|
398
|
-
// invisible caret anchor for a "pending" mark toggled with nothing
|
|
399
|
-
// selected (see textarea.ts's `PENDING_CARET_TEXT`) ; a real character
|
|
400
|
-
// a browser can place a caret next to inside an otherwise-empty inline
|
|
401
|
-
// element, but never meant to be real content, so it never survives
|
|
402
|
-
// into `value`.
|
|
403
499
|
return (node.textContent ?? "").replace(/\u200B/g, "");
|
|
404
500
|
}
|
|
405
501
|
if (node.nodeName === "BR") {
|
|
406
|
-
// The editor only ever inserts a `<br>` as an empty paragraph's sole
|
|
407
|
-
// child (so it stays focusable/visible) — never as a mid-paragraph soft
|
|
408
|
-
// break — so it always serializes to nothing, not a newline (block
|
|
409
|
-
// boundaries already produce one `\n` per paragraph in
|
|
410
|
-
// `serializeEditableRoot`).
|
|
411
502
|
return "";
|
|
412
503
|
}
|
|
413
504
|
if (!(node instanceof HTMLElement)) {
|