@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.7
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-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-3PNGQEG4.js} +3 -3
- package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
- package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-BVASCT2V.js +109 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-DGI7TKCU.js} +14 -9
- package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
- package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
- package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
- package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-LVKMAHMU.js} +10 -0
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-PXF554MD.js} +1 -1
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
- package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
- package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-Z3OFIE7S.js} +1 -1
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +3 -3
- package/dist/cdn/components/eun-badge.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +2 -2
- package/dist/cdn/components/eun-card.js +4 -4
- package/dist/cdn/components/eun-carousel.js +21 -18
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +11 -8
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +3 -3
- package/dist/cdn/components/eun-color-picker.js +60 -68
- package/dist/cdn/components/eun-counter.js +10 -10
- package/dist/cdn/components/eun-date-picker.js +47 -46
- package/dist/cdn/components/eun-description-list.js +2 -2
- package/dist/cdn/components/eun-divider.js +3 -3
- package/dist/cdn/components/eun-drawer.js +5 -5
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-fab.js +2 -2
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +10 -10
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +21 -21
- package/dist/cdn/components/eun-input-phone.js +10 -9
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +2 -2
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +13 -13
- package/dist/cdn/components/eun-pagination.js +16 -16
- package/dist/cdn/components/eun-password-strength.js +14 -10
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +11 -8
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +276 -0
- package/dist/cdn/components/eun-scheduler-event-editor.js +10 -10
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +28 -28
- package/dist/cdn/components/eun-search.js +19 -21
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +10 -8
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +3 -3
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +5 -4
- package/dist/cdn/components/eun-stepper.js +25 -25
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +4 -4
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +1 -1
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +39 -34
- package/dist/cdn/components/eun-time-picker.js +15 -14
- package/dist/cdn/components/eun-toast.js +19 -10
- package/dist/cdn/components/eun-toggle-group.js +6 -4
- package/dist/cdn/components/eun-toggle-item.js +1 -1
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +5 -5
- package/dist/cdn/components/eun-tooltip.js +3 -3
- package/dist/components/action/button/button.d.ts +2 -1
- package/dist/components/action/button/button.js +3 -2
- package/dist/components/action/button/button.styles.js +10 -5
- package/dist/components/action/dropdown-button/dropdown-button.js +10 -5
- package/dist/components/action/toggle/toggle-group.js +1 -1
- package/dist/components/action/toggle/toggle-group.styles.js +4 -2
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/alert/alert/alert.d.ts +9 -7
- package/dist/components/alert/alert/alert.js +11 -14
- package/dist/components/alert/alert/alert.styles.js +9 -2
- package/dist/components/alert/drawer/drawer.d.ts +5 -5
- package/dist/components/alert/drawer/drawer.js +8 -12
- package/dist/components/alert/drawer/drawer.styles.js +1 -1
- package/dist/components/alert/modal/modal.d.ts +10 -10
- package/dist/components/alert/modal/modal.js +13 -25
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +9 -13
- package/dist/components/alert/toast/toast.styles.js +15 -6
- package/dist/components/content/badge/badge.js +2 -2
- package/dist/components/content/card/card.js +1 -1
- package/dist/components/content/card/card.styles.js +2 -2
- package/dist/components/content/chip/chip.d.ts +4 -4
- package/dist/components/content/chip/chip.js +8 -8
- package/dist/components/content/description-list/description-list.js +3 -3
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.js +3 -0
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -0
- package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
- package/dist/components/content/image-carousel/image-carousel.js +24 -24
- package/dist/components/content/password-strength/password-strength.d.ts +21 -6
- package/dist/components/content/password-strength/password-strength.js +37 -16
- package/dist/components/content/password-strength/password-strength.styles.js +4 -0
- package/dist/components/content/tag/tag.js +2 -2
- package/dist/components/content/tooltip/tooltip.js +3 -3
- package/dist/components/form/checkbox/check-card.d.ts +1 -0
- package/dist/components/form/checkbox/check-card.js +1 -0
- package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
- package/dist/components/form/checkbox/checkbox-list.js +39 -10
- package/dist/components/form/checkbox/checkbox.d.ts +1 -0
- package/dist/components/form/checkbox/checkbox.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +3 -2
- package/dist/components/form/color-picker/color-picker.d.ts +41 -28
- package/dist/components/form/color-picker/color-picker.js +66 -50
- package/dist/components/form/color-picker/color-picker.styles.js +1 -1
- package/dist/components/form/counter/counter.d.ts +22 -18
- package/dist/components/form/counter/counter.js +59 -61
- package/dist/components/form/date-picker/date-picker.d.ts +27 -6
- package/dist/components/form/date-picker/date-picker.js +75 -54
- package/dist/components/form/input/input.d.ts +38 -39
- package/dist/components/form/input/input.js +85 -109
- package/dist/components/form/input-file/input-file.d.ts +26 -13
- package/dist/components/form/input-file/input-file.js +35 -35
- package/dist/components/form/input-file/input-file.styles.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +22 -5
- package/dist/components/form/input-phone/input-phone.js +41 -13
- package/dist/components/form/radio/radio-card.d.ts +1 -0
- package/dist/components/form/radio/radio-card.js +1 -0
- package/dist/components/form/radio/radio-list.d.ts +23 -7
- package/dist/components/form/radio/radio-list.js +47 -22
- package/dist/components/form/radio/radio.d.ts +1 -0
- package/dist/components/form/radio/radio.js +1 -0
- package/dist/components/form/rating/rating.d.ts +349 -0
- package/dist/components/form/rating/rating.js +665 -0
- package/dist/components/form/rating/rating.styles.d.ts +1 -0
- package/dist/components/form/rating/rating.styles.js +213 -0
- package/dist/components/form/search/search.d.ts +8 -8
- package/dist/components/form/search/search.js +23 -41
- package/dist/components/form/select/select.d.ts +23 -10
- package/dist/components/form/select/select.js +59 -41
- package/dist/components/form/shared-styles/listbox.styles.js +10 -0
- package/dist/components/form/slider/slider.d.ts +7 -8
- package/dist/components/form/slider/slider.js +9 -12
- package/dist/components/form/switch/switch.d.ts +1 -0
- package/dist/components/form/switch/switch.js +1 -0
- package/dist/components/form/textarea/textarea.d.ts +89 -23
- package/dist/components/form/textarea/textarea.js +192 -43
- package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
- package/dist/components/form/time-picker/time-picker-columns.js +8 -8
- package/dist/components/form/time-picker/time-picker.d.ts +24 -8
- package/dist/components/form/time-picker/time-picker.js +59 -38
- package/dist/components/layout/animate/animate.js +1 -1
- package/dist/components/layout/animate/animate.styles.js +2 -2
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.styles.js +1 -1
- package/dist/components/loader/loader/loader.js +2 -2
- package/dist/components/loader/loader/loader.styles.js +14 -12
- package/dist/components/loader/skeleton/skeleton.js +1 -1
- package/dist/components/navigation/carousel/carousel.d.ts +31 -7
- package/dist/components/navigation/carousel/carousel.js +74 -35
- package/dist/components/navigation/carousel/carousel.styles.js +5 -2
- package/dist/components/navigation/pagination/pagination.d.ts +23 -21
- package/dist/components/navigation/pagination/pagination.js +30 -53
- package/dist/components/navigation/sidebar/sidebar.d.ts +15 -13
- package/dist/components/navigation/sidebar/sidebar.js +21 -33
- package/dist/components/navigation/sidebar/sidebar.styles.js +5 -3
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.js +12 -5
- package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
- package/dist/components/navigation/toolbar/toolbar.d.ts +13 -13
- package/dist/components/navigation/toolbar/toolbar.js +20 -34
- package/dist/features/scheduler/calendar/calendar.js +1 -1
- package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
- package/dist/features/scheduler/scheduler/scheduler.js +15 -24
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +6 -7
- package/dist/i18n/en.d.ts +68 -0
- package/dist/i18n/en.js +68 -0
- package/dist/i18n/fr.js +68 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.js +3 -2
- package/dist/mixins/check.mixin.js +11 -10
- package/dist/mixins/disabled.mixin.d.ts +5 -0
- package/dist/mixins/disabled.mixin.js +21 -1
- package/dist/mixins/editable.mixin.js +28 -5
- package/dist/mixins/field-appearance.mixin.js +3 -2
- package/dist/mixins/form.mixin.d.ts +4 -0
- package/dist/mixins/form.mixin.js +87 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -1
- package/dist/mixins/localizable.mixin.js +1 -1
- package/dist/mixins/radio.mixin.js +11 -10
- package/dist/mixins/readonly.mixin.d.ts +2 -1
- package/dist/mixins/readonly.mixin.js +10 -3
- package/dist/ssr/alert-ssr.css +187 -0
- package/dist/ssr/badge-ssr.css +67 -0
- package/dist/ssr/breadcrumb-ssr.css +41 -0
- package/dist/ssr/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +238 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +242 -0
- package/dist/ssr/collapse-ssr.css +151 -0
- package/dist/ssr/field-ssr.css +163 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +24 -0
- package/dist/ssr/links-ssr.css +7 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +9 -1
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +182 -0
- package/dist/ssr/toolbar-ssr.css +31 -2
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/package.json +26 -7
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
- package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
- package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
- package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
- package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
- package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
- package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
- package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as i}from"./chunks/chunk-YYCEPZUN.js";import{a as d}from"./chunks/chunk-
|
|
1
|
+
import{a as i}from"./chunks/chunk-YYCEPZUN.js";import{a as d}from"./chunks/chunk-3BMACIDO.js";import{a as r,f as n,h as l,j as t,p as a,u as s}from"./chunks/chunk-YITWLCD3.js";var c=l`
|
|
2
2
|
:host {
|
|
3
3
|
--_hoverColor: var(
|
|
4
4
|
--toggle-hover-color,
|
|
@@ -107,4 +107,4 @@ import{a as i}from"./chunks/chunk-YYCEPZUN.js";import{a as d}from"./chunks/chunk
|
|
|
107
107
|
:host(:not([checked])) ::slotted([slot="checked"]) {
|
|
108
108
|
display: none;
|
|
109
109
|
}
|
|
110
|
-
`;var g="eun-toggle",o=class extends d(s){constructor(){super(...arguments);this.checked=!1;this.swap=!1;this.appearance="default";this.toggle=()=>{this.disabled||(this.checked=!this.checked,this.dispatchEvent(new i(this.checked)))};this.handleKeydown=e=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.toggle())}}connectedCallback(){super.connectedCallback?.(),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this.toggle),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("click",this.toggle),this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback?.()}updated(e){super.updated(e),e.has("checked")&&this.setAttribute("aria-pressed",String(this.checked))}render(){let e=this.swap?a`<slot name="unchecked"></slot><slot name="checked"></slot>`:a`<slot></slot>`;return a`<div id="toggle" part="toggle">${e}</div>`}};o.styles=[c],r([t({type:Boolean,reflect:!0})],o.prototype,"checked",2),r([t({type:Boolean,reflect:!0})],o.prototype,"swap",2),r([t({reflect:!0})],o.prototype,"appearance",2),o=r([n(g)],o);export{o as EunomiaToggle,g as EunomiaToggleTagName};
|
|
110
|
+
`;var g="eun-toggle",o=class extends d(s){constructor(){super(...arguments);this.checked=!1;this.swap=!1;this.appearance="default";this.toggle=()=>{this.disabled||(this.checked=!this.checked,this.dispatchEvent(new i(this.checked)))};this.handleKeydown=e=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.toggle())}}connectedCallback(){super.connectedCallback?.(),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this.toggle),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("click",this.toggle),this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback?.()}updated(e){super.updated(e),e.has("checked")&&this.setAttribute("aria-pressed",String(this.checked))}render(){let e=this.swap?a`<slot name="unchecked"></slot><slot name="checked"></slot>`:a`<slot></slot>`;return a`<div id="toggle" part="toggle">${e}</div>`}};o.styles=[c],r([t({type:Boolean,reflect:!0})],o.prototype,"checked",2),r([t({type:Boolean,reflect:!0})],o.prototype,"swap",2),r([t({reflect:!0,useDefault:!0})],o.prototype,"appearance",2),o=r([n(g)],o);export{o as EunomiaToggle,g as EunomiaToggleTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as g}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js";import"./chunks/chunk-UDOZRIJZ.js";import{a as s}from"./chunks/chunk-YYCEPZUN.js";import{a as b}from"./chunks/chunk-BKZGTCMF.js";import{a as v}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as r,f as c,h,j as i,l as d,n as p,p as n,r as l,u}from"./chunks/chunk-YITWLCD3.js";var f=h`
|
|
2
2
|
:host {
|
|
3
3
|
--_height: var(--toolbar-height, 72px);
|
|
4
4
|
--_heightCollapsed: var(--toolbar-height-collapsed, 56px);
|
|
@@ -381,7 +381,7 @@ import{a as b}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js
|
|
|
381
381
|
transition-duration: 0.01ms;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
`,
|
|
384
|
+
`,k=f;var y="eun-toolbar",t=class extends g(v(u)){constructor(){super(...arguments);this.position="sticky";this.mobileBreakpoint=b.tablet;this.open=!1;this.panelDirection="top";this.closeOnBackdrop=!0;this.collapseOnScroll=!1;this.collapseThreshold=24;this.collapsed=!1;this.transparentAtTop=!1;this.atTop=!0;this.adaptiveTheme=!1;this.adaptiveThemeSelector="[data-toolbar-theme]";this.theme="light";this.defaultTheme="light";this.skipLinkLabel="Skip to main content";this.mobile=!1;this.handleIconSlotChange=()=>{this.requestUpdate()};this.scrollTargetEl=window;this.scrollListenerAttached=!1;this.intersectingThemeEls=new Set;this.handleMediaChange=e=>{this.mobile=e.matches,!this.mobile&&this.open&&this.hide()};this.handleScroll=()=>{this.scrollRafId===void 0&&(this.scrollRafId=requestAnimationFrame(()=>{this.scrollRafId=void 0,this.updateScrollState()}))};this.handleThemeIntersect=e=>{for(let a of e)a.isIntersecting?this.intersectingThemeEls.add(a.target):this.intersectingThemeEls.delete(a.target);this.resolveAdaptiveTheme()};this.handlePanelToggle=e=>{let a=e;if(this.syncingFromPopover=!0,this.open=a.newState==="open",this.syncingFromPopover=!1,this.open){this.openDialogSurface({surfaceEl:this.panelEl,onEscape:()=>this.hide(),onOutsideClick:()=>{this.closeOnBackdrop&&this.hide()}}),this.dispatchEvent(new s),this.updateComplete.then(()=>this.focusInitialElement());return}this.closeDialogSurface(this.burgerEl),this.dispatchEvent(new s)};this.handleSkipLinkClick=e=>{let o=e.composedPath().find(m=>m instanceof HTMLAnchorElement)?.getAttribute("href");!o||!o.startsWith("#")||o.length<2||document.getElementById(o.slice(1))?.focus()}}connectedCallback(){super.connectedCallback(),this.updateMediaQuery(),this.syncScrollListener()}disconnectedCallback(){this.mediaQueryList?.removeEventListener("change",this.handleMediaChange),this.detachScrollListener(),this.teardownAdaptiveThemeObserver(),this.teardownDialogSurface(this.open),super.disconnectedCallback()}updated(e){super.updated(e),e.has("mobileBreakpoint")&&this.updateMediaQuery(),e.has("open")&&this.syncPopoverOpenState(this.open,this.panelEl),e.has("panelSize")&&(this.panelSize?this.style.setProperty("--toolbar-panel-size",this.panelSize):this.style.removeProperty("--toolbar-panel-size")),this.updateScrollListenerFor(e),this.updateAdaptiveThemeObserverFor(e)}updateScrollListenerFor(e){(e.has("collapseOnScroll")||e.has("transparentAtTop"))&&this.syncScrollListener(),e.has("scrollTarget")&&this.scrollListenerAttached&&this.attachScrollListener()}updateAdaptiveThemeObserverFor(e){if(e.has("adaptiveTheme")){this.adaptiveTheme?this.setupAdaptiveThemeObserver():e.get("adaptiveTheme")===!0&&(this.teardownAdaptiveThemeObserver(),this.theme=this.defaultTheme);return}this.adaptiveTheme&&(e.has("adaptiveThemeSelector")||e.has("collapsed")||e.has("scrollTarget"))&&this.setupAdaptiveThemeObserver()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}refreshAdaptiveTheme(){this.themeObserver&&(this.themeObserver.disconnect(),this.intersectingThemeEls.clear(),document.querySelectorAll(this.adaptiveThemeSelector).forEach(e=>this.themeObserver?.observe(e)),this.resolveAdaptiveTheme())}updateMediaQuery(){this.mediaQueryList?.removeEventListener("change",this.handleMediaChange),this.mediaQueryList=window.matchMedia(`(width < ${this.mobileBreakpoint}px)`),this.mediaQueryList.addEventListener("change",this.handleMediaChange),this.mobile=this.mediaQueryList.matches}resolveScrollTarget(){if(this.scrollTarget){let e=document.querySelector(this.scrollTarget);if(e)return e}return window}resolveIntersectionRoot(){if(this.scrollTarget){let e=document.querySelector(this.scrollTarget);if(e)return e}return null}syncScrollListener(){let e=this.collapseOnScroll||this.transparentAtTop;e&&!this.scrollListenerAttached?(this.attachScrollListener(),this.scrollListenerAttached=!0):!e&&this.scrollListenerAttached&&(this.detachScrollListener(),this.scrollListenerAttached=!1)}attachScrollListener(){this.scrollTargetEl?.removeEventListener("scroll",this.handleScroll),this.scrollTargetEl=this.resolveScrollTarget(),this.scrollTargetEl.addEventListener("scroll",this.handleScroll,{passive:!0}),this.updateScrollState()}detachScrollListener(){this.scrollTargetEl?.removeEventListener("scroll",this.handleScroll),this.scrollRafId!==void 0&&(cancelAnimationFrame(this.scrollRafId),this.scrollRafId=void 0)}currentScrollY(){return this.scrollTargetEl instanceof Element?this.scrollTargetEl.scrollTop:window.scrollY}updateScrollState(){let e=this.currentScrollY();this.collapseOnScroll&&this.setCollapsed(e>this.collapseThreshold),this.transparentAtTop&&(this.atTop=e<=0)}setCollapsed(e){this.collapsed!==e&&(this.collapsed=e,this.dispatchEvent(new s))}setTheme(e){this.theme!==e&&(this.theme=e,this.dispatchEvent(new s))}barHeightPx(){return this.barEl?.getBoundingClientRect().height??(this.collapsed?56:72)}setupAdaptiveThemeObserver(){this.teardownAdaptiveThemeObserver();let e=this.barHeightPx();this.themeObserver=new IntersectionObserver(this.handleThemeIntersect,{root:this.resolveIntersectionRoot(),rootMargin:`-${e}px 0px -85% 0px`}),document.querySelectorAll(this.adaptiveThemeSelector).forEach(a=>this.themeObserver?.observe(a)),this.resolveAdaptiveTheme()}teardownAdaptiveThemeObserver(){this.themeObserver?.disconnect(),this.themeObserver=void 0,this.intersectingThemeEls.clear()}resolveAdaptiveTheme(){if(this.intersectingThemeEls.size===0){this.setTheme(this.defaultTheme);return}let e=document.querySelectorAll(this.adaptiveThemeSelector);for(let a=e.length-1;a>=0;a-=1)if(this.intersectingThemeEls.has(e[a])){this.setTheme(e[a].getAttribute("data-toolbar-theme")==="dark"?"dark":"light");return}this.setTheme(this.defaultTheme)}focusInitialElement(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.panelEl?.focus()}hasSkipLinksContent(){return this.skipLinkTarget!==void 0||this.querySelector('[slot="skip-links"]')!==null}renderSkipLinks(){return n`
|
|
385
385
|
<div id="skip-links" @click=${this.handleSkipLinkClick}>
|
|
386
386
|
<slot name="skip-links">
|
|
387
387
|
${this.skipLinkTarget?n`
|
|
@@ -406,7 +406,7 @@ import{a as b}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js
|
|
|
406
406
|
rounded
|
|
407
407
|
size="s"
|
|
408
408
|
aria-expanded=${this.open}
|
|
409
|
-
aria-label=${this.open?this.
|
|
409
|
+
aria-label=${this.open?this.menuCloseLabel??this.dictionary.toolbar.menuClose:this.menuOpenLabel??this.dictionary.toolbar.menuOpen}
|
|
410
410
|
@click=${()=>this.toggle()}
|
|
411
411
|
>
|
|
412
412
|
<slot name=${e} @slotchange=${this.handleIconSlotChange}>
|
|
@@ -419,7 +419,7 @@ import{a as b}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js
|
|
|
419
419
|
popover="manual"
|
|
420
420
|
role="dialog"
|
|
421
421
|
aria-modal="true"
|
|
422
|
-
aria-label=${this.
|
|
422
|
+
aria-label=${this.menuLabel??this.dictionary.toolbar.menu}
|
|
423
423
|
data-direction=${this.panelDirection}
|
|
424
424
|
tabindex="-1"
|
|
425
425
|
@toggle=${this.handlePanelToggle}
|
|
@@ -437,4 +437,4 @@ import{a as b}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js
|
|
|
437
437
|
${this.renderEnd()}
|
|
438
438
|
</nav>
|
|
439
439
|
${this.mobile?this.renderPanel():l}
|
|
440
|
-
`}};t.styles=
|
|
440
|
+
`}};t.styles=k,r([i({reflect:!0,useDefault:!0})],t.prototype,"position",2),r([i({type:Number,attribute:"mobile-breakpoint"})],t.prototype,"mobileBreakpoint",2),r([i({type:Boolean,reflect:!0})],t.prototype,"open",2),r([i({reflect:!0,attribute:"panel-direction",useDefault:!0})],t.prototype,"panelDirection",2),r([i({attribute:"panel-size"})],t.prototype,"panelSize",2),r([i({type:Boolean,attribute:"close-on-backdrop"})],t.prototype,"closeOnBackdrop",2),r([i({attribute:"menu-open-label"})],t.prototype,"menuOpenLabel",2),r([i({attribute:"menu-close-label"})],t.prototype,"menuCloseLabel",2),r([i({attribute:"menu-label"})],t.prototype,"menuLabel",2),r([i({type:Boolean,attribute:"collapse-on-scroll"})],t.prototype,"collapseOnScroll",2),r([i({type:Number,attribute:"collapse-threshold"})],t.prototype,"collapseThreshold",2),r([i({type:Boolean,reflect:!0})],t.prototype,"collapsed",2),r([i({type:Boolean,attribute:"transparent-at-top"})],t.prototype,"transparentAtTop",2),r([i({type:Boolean,reflect:!0,attribute:"at-top"})],t.prototype,"atTop",2),r([i({attribute:"scroll-target"})],t.prototype,"scrollTarget",2),r([i({type:Boolean,attribute:"adaptive-theme"})],t.prototype,"adaptiveTheme",2),r([i({attribute:"adaptive-theme-selector"})],t.prototype,"adaptiveThemeSelector",2),r([i({reflect:!0,useDefault:!0})],t.prototype,"theme",2),r([i({attribute:"default-theme"})],t.prototype,"defaultTheme",2),r([i({attribute:"skip-link-target"})],t.prototype,"skipLinkTarget",2),r([i({attribute:"skip-link-label"})],t.prototype,"skipLinkLabel",2),r([i({type:Boolean,reflect:!0})],t.prototype,"mobile",2),r([d("#bar")],t.prototype,"barEl",2),r([d("#panel")],t.prototype,"panelEl",2),r([d("#burger")],t.prototype,"burgerEl",2),r([p({slot:"menu-icon"})],t.prototype,"menuIconSlotEls",2),r([p({slot:"close-icon"})],t.prototype,"closeIconSlotEls",2),t=r([c(y)],t);export{t as EunomiaToolbar,y as EunomiaToolbarTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as g}from"./chunks/chunk-EUWUDCBZ.js";import{a as C}from"./chunks/chunk-LK5BJ4SH.js";import{b as
|
|
1
|
+
import{c as g}from"./chunks/chunk-EUWUDCBZ.js";import{a as C}from"./chunks/chunk-LK5BJ4SH.js";import{b as D,c as y}from"./chunks/chunk-624VJYNA.js";import{a as m}from"./chunks/chunk-LYYQAALT.js";import{e as L}from"./chunks/chunk-GDBPWZN6.js";import{a as v}from"./chunks/chunk-PPCHQG7P.js";import{a as f}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a,f as S,h as c,j as l,n as A,o as u,p as h,r as _,t as P,u as T}from"./chunks/chunk-YITWLCD3.js";var k=c`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -279,7 +279,7 @@ import{c as g}from"./chunks/chunk-EUWUDCBZ.js";import{a as C}from"./chunks/chunk
|
|
|
279
279
|
right: calc(anchor(left) + var(--tooltip-gap, 8px));
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
`,w=$;var M="eun-tooltip",B=0,V=0,R=new WeakSet,I=["--tooltip-z-index","--tooltip-gap","--tooltip-viewport-gap","--tooltip-min-width","--tooltip-max-width","--tooltip-background-color","--tooltip-color","--tooltip-content-color","--tooltip-border-color","--tooltip-border-width","--tooltip-font-weight","--tooltip-border-radius","--tooltip-padding","--tooltip-padding-block","--tooltip-padding-inline","--tooltip-row-gap","--tooltip-shadow","--tooltip-transition-duration"],F=C(T),o=class extends F{constructor(){super(...arguments);this.color="primary";this.appearance="default";this.fixedColor=!1;this.placement="top";this.open=!1;this.lazy=!1;this.showDelay=100;this.hideDelay=150;this.pinned=!1;this.panelId=`eun-tooltip-panel-${++V}`;this.headingId=`${this.panelId}-heading`;this.ariaDescribedByApplied=!1;this.handleReposition=()=>{this.reposition()};this.handleDocumentKeydown=e=>{e.key==="Escape"&&this.hide()};this.handleDocumentPointerDown=e=>{if(!this.pinned)return;let t=e.composedPath();this.anchorEl&&t.includes(this.anchorEl)||this.panelEl&&t.includes(this.panelEl)||this.hide()};this.handleAnchorSlotChange=()=>{this.rebindAnchorListeners()};this.handleAnchorPointerEnter=()=>{this.scheduleShow()};this.handleAnchorPointerLeave=()=>{this.scheduleHide()};this.handleAnchorFocusIn=()=>{this.clearShowTimer(),this.clearHideTimer(),this.show()};this.handleAnchorFocusOut=()=>{this.pinned=!1,this.hide()};this.handleAnchorClick=()=>{this.pinned=!this.pinned,this.pinned?(this.clearShowTimer(),this.clearHideTimer(),this.show()):this.scheduleHide()};this.handlePanelPointerEnter=()=>{this.clearHideTimer()};this.handlePanelPointerLeave=()=>{this.scheduleHide()};this.handleSlotChange=()=>{this.requestUpdate()}}supportsAnchorPositioning(){return o.nativeAnchorPositioningSupported}connectedCallback(){super.connectedCallback(),this.hasUpdated&&!this.lazy&&this.ensurePortal()}firstUpdated(e){super.firstUpdated(e),this.rebindAnchorListeners(),this.lazy||this.ensurePortal()}disconnectedCallback(){this.unbindAnchorListeners(),this.clearShowTimer(),this.clearHideTimer(),this.panelAnimation?.cancel(),this.panelAnimation=void 0,this.removeGlobalListeners(),this.portalContainer?.remove(),this.portalContainer=void 0,this.portalRoot=void 0,this.panelEl=void 0,super.disconnectedCallback?.()}updated(e){if(super.updated(e),this.portalContainer&&this.renderPortal(),e.has("open")){this.open?this.openTooltip():this.closeTooltip();return}e.has("placement")&&this.open&&this.reposition()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}get anchorEl(){return this.anchorSlotEls[0]}ensurePortal(){if(this.portalContainer||!this.anchorEl)return;let e=this.anchorEl.getRootNode();this.portalRoot=e,this.installPanelStyles(e);let t=document.createElement("div");t.style.display="contents",(e===document?document.body:e).appendChild(t),this.portalContainer=t,this.renderPortal()}installPanelStyles(e){if(R.has(e)||!b.styleSheet)return;R.add(e);let t=[b.styleSheet];!m&&w.styleSheet&&t.push(w.styleSheet),e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]}renderPortal(){this.portalContainer&&(P(this.renderPanel(),this.portalContainer,{host:this}),this.panelEl=this.portalContainer.querySelector(".eun-tooltip-panel")??void 0,this.forwardCssVariables(),this.mirrorSlottedContent())}forwardCssVariables(){if(!this.panelEl)return;let e=getComputedStyle(this);for(let t of I)this.panelEl.style.setProperty(t,e.getPropertyValue(t))}openTooltip(){if(this.ensurePortal(),!this.anchorEl||!this.panelEl)return;this.applyAriaDescribedBy();let e=this.panelEl,t=this.panelAnimation!==void 0;this.panelAnimation?.cancel(),this.panelAnimation=void 0;let r=!e.matches(":popover-open");r&&e.showPopover(),this.reposition(),(r||t)&&this.playEnterAnimation(e),window.addEventListener("resize",this.handleReposition),window.addEventListener("scroll",this.handleReposition,!0),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("pointerdown",this.handleDocumentPointerDown,!0),this.observeAnchorVisibility(this.anchorEl,()=>this.hide())}closeTooltip(){this.pinned=!1;let e=this.panelEl;this.panelAnimation?.cancel(),this.panelAnimation=void 0,e?.matches(":popover-open")&&this.playExitAnimation(e),this.removeGlobalListeners(),this.unobserveAnchorVisibility()}static panelAnimationDuration(e){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:
|
|
282
|
+
`,w=$;var M="eun-tooltip",B=0,V=0,R=new WeakSet,I=["--tooltip-z-index","--tooltip-gap","--tooltip-viewport-gap","--tooltip-min-width","--tooltip-max-width","--tooltip-background-color","--tooltip-color","--tooltip-content-color","--tooltip-border-color","--tooltip-border-width","--tooltip-font-weight","--tooltip-border-radius","--tooltip-padding","--tooltip-padding-block","--tooltip-padding-inline","--tooltip-row-gap","--tooltip-shadow","--tooltip-transition-duration"],F=C(T),o=class extends F{constructor(){super(...arguments);this.color="primary";this.appearance="default";this.fixedColor=!1;this.placement="top";this.open=!1;this.lazy=!1;this.showDelay=100;this.hideDelay=150;this.pinned=!1;this.panelId=`eun-tooltip-panel-${++V}`;this.headingId=`${this.panelId}-heading`;this.ariaDescribedByApplied=!1;this.handleReposition=()=>{this.reposition()};this.handleDocumentKeydown=e=>{e.key==="Escape"&&this.hide()};this.handleDocumentPointerDown=e=>{if(!this.pinned)return;let t=e.composedPath();this.anchorEl&&t.includes(this.anchorEl)||this.panelEl&&t.includes(this.panelEl)||this.hide()};this.handleAnchorSlotChange=()=>{this.rebindAnchorListeners()};this.handleAnchorPointerEnter=()=>{this.scheduleShow()};this.handleAnchorPointerLeave=()=>{this.scheduleHide()};this.handleAnchorFocusIn=()=>{this.clearShowTimer(),this.clearHideTimer(),this.show()};this.handleAnchorFocusOut=()=>{this.pinned=!1,this.hide()};this.handleAnchorClick=()=>{this.pinned=!this.pinned,this.pinned?(this.clearShowTimer(),this.clearHideTimer(),this.show()):this.scheduleHide()};this.handlePanelPointerEnter=()=>{this.clearHideTimer()};this.handlePanelPointerLeave=()=>{this.scheduleHide()};this.handleSlotChange=()=>{this.requestUpdate()}}supportsAnchorPositioning(){return o.nativeAnchorPositioningSupported}connectedCallback(){super.connectedCallback(),this.hasUpdated&&!this.lazy&&this.ensurePortal()}firstUpdated(e){super.firstUpdated(e),this.rebindAnchorListeners(),this.lazy||this.ensurePortal()}disconnectedCallback(){this.unbindAnchorListeners(),this.clearShowTimer(),this.clearHideTimer(),this.panelAnimation?.cancel(),this.panelAnimation=void 0,this.removeGlobalListeners(),this.portalContainer?.remove(),this.portalContainer=void 0,this.portalRoot=void 0,this.panelEl=void 0,super.disconnectedCallback?.()}updated(e){if(super.updated(e),this.portalContainer&&this.renderPortal(),e.has("open")){this.open?this.openTooltip():this.closeTooltip();return}e.has("placement")&&this.open&&this.reposition()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}get anchorEl(){return this.anchorSlotEls[0]}ensurePortal(){if(this.portalContainer||!this.anchorEl)return;let e=this.anchorEl.getRootNode();this.portalRoot=e,this.installPanelStyles(e);let t=document.createElement("div");t.style.display="contents",(e===document?document.body:e).appendChild(t),this.portalContainer=t,this.renderPortal()}installPanelStyles(e){if(R.has(e)||!b.styleSheet)return;R.add(e);let t=[b.styleSheet];!m&&w.styleSheet&&t.push(w.styleSheet),e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]}renderPortal(){this.portalContainer&&(P(this.renderPanel(),this.portalContainer,{host:this}),this.panelEl=this.portalContainer.querySelector(".eun-tooltip-panel")??void 0,this.forwardCssVariables(),this.mirrorSlottedContent())}forwardCssVariables(){if(!this.panelEl)return;let e=getComputedStyle(this);for(let t of I)this.panelEl.style.setProperty(t,e.getPropertyValue(t))}openTooltip(){if(this.ensurePortal(),!this.anchorEl||!this.panelEl)return;this.applyAriaDescribedBy();let e=this.panelEl,t=this.panelAnimation!==void 0;this.panelAnimation?.cancel(),this.panelAnimation=void 0;let r=!e.matches(":popover-open");r&&e.showPopover(),this.reposition(),(r||t)&&this.playEnterAnimation(e),window.addEventListener("resize",this.handleReposition),window.addEventListener("scroll",this.handleReposition,!0),document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("pointerdown",this.handleDocumentPointerDown,!0),this.observeAnchorVisibility(this.anchorEl,()=>this.hide())}closeTooltip(){this.pinned=!1;let e=this.panelEl;this.panelAnimation?.cancel(),this.panelAnimation=void 0,e?.matches(":popover-open")&&this.playExitAnimation(e),this.removeGlobalListeners(),this.unobserveAnchorVisibility()}static panelAnimationDuration(e){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:D(e,"--tooltip-transition-duration","s",150)}playEnterAnimation(e){e.style.removeProperty("pointer-events");let t=o.panelAnimationDuration(e);t!==0&&(this.panelAnimation=e.animate([{opacity:0,scale:.96},{opacity:1,scale:1}],{duration:t,easing:y(e),fill:"forwards"}))}playExitAnimation(e){e.style.pointerEvents="none";let t=o.panelAnimationDuration(e);if(t===0){e.hidePopover();return}let r=e.animate([{opacity:1,scale:1},{opacity:0,scale:.96}],{duration:t,easing:y(e),fill:"forwards"});this.panelAnimation=r,r.finished.then(()=>{this.panelAnimation===r&&(this.panelAnimation=void 0),e.hidePopover()}).catch(()=>{})}removeGlobalListeners(){window.removeEventListener("resize",this.handleReposition),window.removeEventListener("scroll",this.handleReposition,!0),document.removeEventListener("keydown",this.handleDocumentKeydown),document.removeEventListener("pointerdown",this.handleDocumentPointerDown,!0)}reposition(){!this.anchorEl||!this.panelEl||(this.supportsAnchorPositioning()?(this.anchorPositionName??=`--eun-tooltip-anchor-${++B}`,this.anchorEl.style.setProperty("anchor-name",this.anchorPositionName),this.panelEl.style.setProperty("position-anchor",this.anchorPositionName)):this.updateFallbackPosition(),this.clampPanelToViewport())}getEffectivePlacementFallback(e,t,r,i){let n=this.readGap();if(this.placement==="left"||this.placement==="right"){let H=window.innerWidth,x=e.right+n+t.width<=H,E=e.left-n-t.width>=0;return this.placement==="right"&&!x&&E?"left":this.placement==="left"&&!E&&x?"right":this.placement}let p=window.innerHeight,d=e.bottom+n+t.height<=p-i,s=e.top-n-t.height>=r;return this.placement==="top"&&!s&&d?"bottom":this.placement==="bottom"&&!d&&s?"top":this.placement}updateFallbackPosition(){if(!this.anchorEl||!this.panelEl)return;let e=this.readGap(),t=this.readViewportInset(this.panelEl,"--eun-viewport-inset-top"),r=this.readViewportInset(this.panelEl,"--eun-viewport-inset-bottom"),i=this.anchorEl.getBoundingClientRect(),n=this.panelEl.getBoundingClientRect(),p=this.getEffectivePlacementFallback(i,n,t,r),d,s;p==="top"||p==="bottom"?(d=p==="top"?i.top-n.height-e:i.bottom+e,s=g(i.left+i.width/2-n.width/2,n.width,window.innerWidth,e)):(s=p==="left"?i.left-n.width-e:i.right+e,d=g(i.top+i.height/2-n.height/2,n.height,window.innerHeight,e)),this.panelEl.style.setProperty("--_panelTop",`${d}px`),this.panelEl.style.setProperty("--_panelLeft",`${s}px`)}clampPanelToViewport(){if(!this.panelEl)return;let e=this.readPixelVar("--tooltip-viewport-gap",8),t=this.readViewportInset(this.panelEl,"--eun-viewport-inset-top"),r=this.readViewportInset(this.panelEl,"--eun-viewport-inset-bottom"),i=this.panelEl.getBoundingClientRect(),n=0;i.left<e?n=e-i.left:i.right>window.innerWidth-e&&(n=window.innerWidth-e-i.right);let p=t+e,d=window.innerHeight-r-e,s=0;i.top<p?s=p-i.top:i.bottom>d&&(s=d-i.bottom),this.panelEl.style.transform=n||s?`translate(${n}px, ${s}px)`:""}readPixelVar(e,t){if(!this.panelEl)return t;let r=getComputedStyle(this.panelEl).getPropertyValue(e),i=Number.parseFloat(r);return Number.isFinite(i)?i:t}readGap(){return this.readPixelVar("--tooltip-gap",8)}applyAriaDescribedBy(){if(this.ariaDescribedByApplied||!this.anchorEl)return;this.ariaDescribedByApplied=!0;let e=this.anchorEl.getAttribute("aria-describedby"),t=e?e.split(/\s+/):[];t.includes(this.panelId)||(t.push(this.panelId),this.anchorEl.setAttribute("aria-describedby",t.join(" ")))}clearShowTimer(){this.showTimer!==void 0&&(clearTimeout(this.showTimer),this.showTimer=void 0)}clearHideTimer(){this.hideTimer!==void 0&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}scheduleShow(){this.clearHideTimer(),!this.open&&(this.clearShowTimer(),this.showTimer=setTimeout(()=>{this.showTimer=void 0,this.show()},this.showDelay))}scheduleHide(){this.clearShowTimer(),!this.pinned&&(this.clearHideTimer(),this.hideTimer=setTimeout(()=>{this.hideTimer=void 0,this.pinned||this.hide()},this.hideDelay))}rebindAnchorListeners(){let e=this.anchorEl;this.boundAnchorEl!==e&&(this.unbindAnchorListeners(),this.boundAnchorEl=e,this.ariaDescribedByApplied=!1,e&&(e.addEventListener("pointerenter",this.handleAnchorPointerEnter),e.addEventListener("pointerleave",this.handleAnchorPointerLeave),e.addEventListener("focusin",this.handleAnchorFocusIn),e.addEventListener("focusout",this.handleAnchorFocusOut),e.addEventListener("click",this.handleAnchorClick)))}unbindAnchorListeners(){this.boundAnchorEl?.removeEventListener("pointerenter",this.handleAnchorPointerEnter),this.boundAnchorEl?.removeEventListener("pointerleave",this.handleAnchorPointerLeave),this.boundAnchorEl?.removeEventListener("focusin",this.handleAnchorFocusIn),this.boundAnchorEl?.removeEventListener("focusout",this.handleAnchorFocusOut),this.boundAnchorEl?.removeEventListener("click",this.handleAnchorClick)}hasDescription(){return!!this.richText||this.descriptionSlotNodes.length>0}hasHeading(){return!!this.heading||this.defaultSlotNodes.some(e=>e.nodeType!==Node.TEXT_NODE||!!e.textContent?.trim())}mirrorSlottedContent(){if(!this.panelEl)return;this.heading||this.panelEl.querySelector(".eun-tooltip-heading-mirror")?.replaceChildren(...this.defaultSlotNodes.map(r=>r.cloneNode(!0))),this.panelEl.querySelector(".eun-tooltip-description-mirror")?.replaceChildren(...this.descriptionSlotNodes.map(t=>t.cloneNode(!0)))}renderPanel(){let e=this.heading?this.heading:h`<span class="eun-tooltip-heading-mirror"></span>`;return h`
|
|
283
283
|
<div
|
|
284
284
|
id=${this.panelId}
|
|
285
285
|
class=${f({"eun-tooltip-panel":!0,"no-heading":!this.hasHeading()})}
|
|
@@ -314,4 +314,4 @@ import{c as g}from"./chunks/chunk-EUWUDCBZ.js";import{a as C}from"./chunks/chunk
|
|
|
314
314
|
hidden
|
|
315
315
|
@slotchange=${this.handleSlotChange}
|
|
316
316
|
></slot>
|
|
317
|
-
`}};o.styles=
|
|
317
|
+
`}};o.styles=k,o.nativeAnchorPositioningSupported=typeof CSS<"u"&&CSS.supports("anchor-name: --a")&&!m,a([l({reflect:!0})],o.prototype,"severity",2),a([l({reflect:!0,useDefault:!0})],o.prototype,"color",2),a([l({reflect:!0,useDefault:!0})],o.prototype,"appearance",2),a([l({type:Boolean,reflect:!0,attribute:"fixed-color"})],o.prototype,"fixedColor",2),a([l({reflect:!0,useDefault:!0})],o.prototype,"placement",2),a([l()],o.prototype,"heading",2),a([l({attribute:"rich-text"})],o.prototype,"richText",2),a([l({type:Boolean,reflect:!0})],o.prototype,"open",2),a([l({type:Boolean,reflect:!0})],o.prototype,"lazy",2),a([l({type:Number,attribute:"show-delay"})],o.prototype,"showDelay",2),a([l({type:Number,attribute:"hide-delay"})],o.prototype,"hideDelay",2),a([A({slot:"anchor"})],o.prototype,"anchorSlotEls",2),a([u()],o.prototype,"defaultSlotNodes",2),a([u({slot:"description"})],o.prototype,"descriptionSlotNodes",2),o=a([S(M)],o);export{o as EunomiaTooltip,M as EunomiaTooltipTagName};
|
|
@@ -96,7 +96,8 @@ export declare class EunomiaButton extends EunomiaButton_base {
|
|
|
96
96
|
* regardless of `color` ; `raised` adds a drop shadow ; `ghost` has no
|
|
97
97
|
* visible surface at rest at all — a border (and a tinted background)
|
|
98
98
|
* only appear on hover/focus/active, defaulting to a neutral gray when
|
|
99
|
-
* `color` isn't also set.
|
|
99
|
+
* `color` isn't also set. The default isn't reflected, so an SSR framework
|
|
100
|
+
* doesn't see an attribute it never rendered.
|
|
100
101
|
* @default fill
|
|
101
102
|
*/
|
|
102
103
|
appearance: EunomiaButtonAppearance;
|
|
@@ -98,7 +98,8 @@ let EunomiaButton = class EunomiaButton extends ButtonMixin(CommandMixin(Disable
|
|
|
98
98
|
* regardless of `color` ; `raised` adds a drop shadow ; `ghost` has no
|
|
99
99
|
* visible surface at rest at all — a border (and a tinted background)
|
|
100
100
|
* only appear on hover/focus/active, defaulting to a neutral gray when
|
|
101
|
-
* `color` isn't also set.
|
|
101
|
+
* `color` isn't also set. The default isn't reflected, so an SSR framework
|
|
102
|
+
* doesn't see an attribute it never rendered.
|
|
102
103
|
* @default fill
|
|
103
104
|
*/
|
|
104
105
|
this.appearance = "fill";
|
|
@@ -317,7 +318,7 @@ __decorate([
|
|
|
317
318
|
property({ reflect: true })
|
|
318
319
|
], EunomiaButton.prototype, "severity", void 0);
|
|
319
320
|
__decorate([
|
|
320
|
-
property({ reflect: true })
|
|
321
|
+
property({ reflect: true, useDefault: true })
|
|
321
322
|
], EunomiaButton.prototype, "appearance", void 0);
|
|
322
323
|
__decorate([
|
|
323
324
|
property({ type: Boolean, reflect: true })
|
|
@@ -319,7 +319,7 @@ const appearances = css `
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
:host(
|
|
322
|
-
[appearance="fill"]:is(
|
|
322
|
+
:is([appearance="fill"], :not([appearance])):is(
|
|
323
323
|
[color="critical"],
|
|
324
324
|
[color="success"],
|
|
325
325
|
[color="warning"]
|
|
@@ -327,7 +327,7 @@ const appearances = css `
|
|
|
327
327
|
)
|
|
328
328
|
#button,
|
|
329
329
|
:host(
|
|
330
|
-
[appearance="fill"]:is(
|
|
330
|
+
:is([appearance="fill"], :not([appearance])):is(
|
|
331
331
|
[color="critical"],
|
|
332
332
|
[color="success"],
|
|
333
333
|
[color="warning"]
|
|
@@ -336,9 +336,14 @@ const appearances = css `
|
|
|
336
336
|
#button:is(:hover, :focus-visible) {
|
|
337
337
|
filter: brightness(0.9);
|
|
338
338
|
}
|
|
339
|
-
:host(
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
:host(
|
|
340
|
+
:is([appearance="fill"], :not([appearance])):is(
|
|
341
|
+
[color="critical"],
|
|
342
|
+
[color="success"],
|
|
343
|
+
[color="warning"]
|
|
344
|
+
):not([disabled])
|
|
345
|
+
)
|
|
346
|
+
#button:active {
|
|
342
347
|
filter: brightness(0.8);
|
|
343
348
|
}
|
|
344
349
|
`;
|
|
@@ -1116,16 +1116,21 @@ __decorate([
|
|
|
1116
1116
|
property({ reflect: true })
|
|
1117
1117
|
], EunomiaDropdownButton.prototype, "severity", void 0);
|
|
1118
1118
|
__decorate([
|
|
1119
|
-
property({ type: Array, reflect: true })
|
|
1119
|
+
property({ type: Array, reflect: true, useDefault: true })
|
|
1120
1120
|
], EunomiaDropdownButton.prototype, "options", void 0);
|
|
1121
1121
|
__decorate([
|
|
1122
|
-
property({
|
|
1122
|
+
property({
|
|
1123
|
+
type: Array,
|
|
1124
|
+
reflect: true,
|
|
1125
|
+
attribute: "disabled-keys",
|
|
1126
|
+
useDefault: true,
|
|
1127
|
+
})
|
|
1123
1128
|
], EunomiaDropdownButton.prototype, "disabledKeys", void 0);
|
|
1124
1129
|
__decorate([
|
|
1125
1130
|
property({ type: Boolean, reflect: true })
|
|
1126
1131
|
], EunomiaDropdownButton.prototype, "disabled", void 0);
|
|
1127
1132
|
__decorate([
|
|
1128
|
-
property({ reflect: true })
|
|
1133
|
+
property({ reflect: true, useDefault: true })
|
|
1129
1134
|
], EunomiaDropdownButton.prototype, "size", void 0);
|
|
1130
1135
|
__decorate([
|
|
1131
1136
|
property({ reflect: true })
|
|
@@ -1137,10 +1142,10 @@ __decorate([
|
|
|
1137
1142
|
property({ type: Boolean, reflect: true })
|
|
1138
1143
|
], EunomiaDropdownButton.prototype, "rounded", void 0);
|
|
1139
1144
|
__decorate([
|
|
1140
|
-
property({ reflect: true })
|
|
1145
|
+
property({ reflect: true, useDefault: true })
|
|
1141
1146
|
], EunomiaDropdownButton.prototype, "appearance", void 0);
|
|
1142
1147
|
__decorate([
|
|
1143
|
-
property({ reflect: true })
|
|
1148
|
+
property({ reflect: true, useDefault: true })
|
|
1144
1149
|
], EunomiaDropdownButton.prototype, "placement", void 0);
|
|
1145
1150
|
__decorate([
|
|
1146
1151
|
property({ type: Boolean, reflect: true })
|
|
@@ -750,7 +750,7 @@ __decorate([
|
|
|
750
750
|
property({ type: Boolean, reflect: true })
|
|
751
751
|
], EunomiaToggleGroup.prototype, "single", void 0);
|
|
752
752
|
__decorate([
|
|
753
|
-
property({ reflect: true })
|
|
753
|
+
property({ reflect: true, useDefault: true })
|
|
754
754
|
], EunomiaToggleGroup.prototype, "appearance", void 0);
|
|
755
755
|
__decorate([
|
|
756
756
|
property({ type: Boolean, reflect: true })
|
|
@@ -272,13 +272,15 @@ export const toggleGroupStyles = css `
|
|
|
272
272
|
button[disabled] {
|
|
273
273
|
cursor: not-allowed;
|
|
274
274
|
}
|
|
275
|
-
:host([appearance="default"]
|
|
275
|
+
:host(:is([appearance="default"], :not([appearance])))
|
|
276
|
+
#scrollable:has(#indicator)
|
|
277
|
+
button.active {
|
|
276
278
|
color: var(
|
|
277
279
|
--toggle-group-active-color,
|
|
278
280
|
var(--eun-color-on-primary-500, #ffffff)
|
|
279
281
|
);
|
|
280
282
|
}
|
|
281
|
-
:host([appearance="default"])
|
|
283
|
+
:host(:is([appearance="default"], :not([appearance])))
|
|
282
284
|
#scrollable:not(:has(#indicator))
|
|
283
285
|
button.active {
|
|
284
286
|
background: var(
|
|
@@ -161,7 +161,7 @@ __decorate([
|
|
|
161
161
|
property({ type: Boolean, reflect: true })
|
|
162
162
|
], EunomiaToggle.prototype, "swap", void 0);
|
|
163
163
|
__decorate([
|
|
164
|
-
property({ reflect: true })
|
|
164
|
+
property({ reflect: true, useDefault: true })
|
|
165
165
|
], EunomiaToggle.prototype, "appearance", void 0);
|
|
166
166
|
EunomiaToggle = __decorate([
|
|
167
167
|
customElement(EunomiaToggleTagName)
|
|
@@ -13,6 +13,7 @@ type AlertSeverity = EunomiaSeverity;
|
|
|
13
13
|
* All available alert surface treatments.
|
|
14
14
|
*/
|
|
15
15
|
type AlertAppearance = EunomiaDisplayAppearance;
|
|
16
|
+
declare const EunomiaAlert_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
16
17
|
/**
|
|
17
18
|
* An inline banner that relays information to the user without
|
|
18
19
|
* interrupting their current task, such as a form submission result, a
|
|
@@ -44,8 +45,8 @@ type AlertAppearance = EunomiaDisplayAppearance;
|
|
|
44
45
|
* @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
|
|
45
46
|
* @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
|
|
46
47
|
* @prop {boolean} [closeable=false] - Shows a close button. Clicking it fires the close event without changing the alert's own rendering
|
|
47
|
-
* @prop {string} [
|
|
48
|
-
* @attr {string} [
|
|
48
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
49
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
49
50
|
* @cssprop [--alert-background-color] - Sets the background color, for every appearance and severity
|
|
50
51
|
* @cssprop [--alert-border-color] - Sets the border color, for every appearance and severity: the leading accent of the default appearance, and the border of every other one
|
|
51
52
|
* @cssprop [--alert-border-width] - Sets the border width, for every appearance. The border takes room out of the padding, so it keeps its size
|
|
@@ -58,10 +59,10 @@ type AlertAppearance = EunomiaDisplayAppearance;
|
|
|
58
59
|
* @cssprop [--alert-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
|
|
59
60
|
* @cssprop [--alert-gap] - Sets the gap between the icon column and the heading and content column
|
|
60
61
|
* @cssprop [--alert-row-gap] - Sets the gap between the heading, description, and action rows
|
|
61
|
-
* @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button
|
|
62
|
+
* @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button, and of the alert itself when it's given focus
|
|
62
63
|
* @element eun-alert
|
|
63
64
|
*/
|
|
64
|
-
export declare class EunomiaAlert extends
|
|
65
|
+
export declare class EunomiaAlert extends EunomiaAlert_base {
|
|
65
66
|
/**
|
|
66
67
|
* Styles to import to the component.
|
|
67
68
|
*
|
|
@@ -75,7 +76,8 @@ export declare class EunomiaAlert extends LitElement {
|
|
|
75
76
|
*/
|
|
76
77
|
severity?: AlertSeverity;
|
|
77
78
|
/**
|
|
78
|
-
* The surface treatment of the alert.
|
|
79
|
+
* The surface treatment of the alert. The default isn't reflected, so an
|
|
80
|
+
* SSR framework doesn't see an attribute it never rendered.
|
|
79
81
|
* @default default
|
|
80
82
|
*/
|
|
81
83
|
appearance: AlertAppearance;
|
|
@@ -108,9 +110,9 @@ export declare class EunomiaAlert extends LitElement {
|
|
|
108
110
|
closeable: boolean;
|
|
109
111
|
/**
|
|
110
112
|
* Accessible label of the close button.
|
|
111
|
-
*
|
|
113
|
+
* Falls back to the localized string for the current locale when unset.
|
|
112
114
|
*/
|
|
113
|
-
|
|
115
|
+
closeLabel?: string;
|
|
114
116
|
/**
|
|
115
117
|
* Elements assigned to the `description` slot, if any ; queried live so
|
|
116
118
|
* {@link render} can decide whether the description row should render at
|
|
@@ -12,6 +12,7 @@ import { CloseEvent } from "../../../events/close.event.js";
|
|
|
12
12
|
import { formatRichText } from "../../../utils/rich-text.utils.js";
|
|
13
13
|
import { resolveIcon } from "../../../utils/severity-icon.utils.js";
|
|
14
14
|
import { alertStyles } from "./alert.styles.js";
|
|
15
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
15
16
|
/**
|
|
16
17
|
* Tag name of the alert component.
|
|
17
18
|
*/
|
|
@@ -47,8 +48,8 @@ export const EunomiaAlertTagName = "eun-alert";
|
|
|
47
48
|
* @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
|
|
48
49
|
* @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
|
|
49
50
|
* @prop {boolean} [closeable=false] - Shows a close button. Clicking it fires the close event without changing the alert's own rendering
|
|
50
|
-
* @prop {string} [
|
|
51
|
-
* @attr {string} [
|
|
51
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
52
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
52
53
|
* @cssprop [--alert-background-color] - Sets the background color, for every appearance and severity
|
|
53
54
|
* @cssprop [--alert-border-color] - Sets the border color, for every appearance and severity: the leading accent of the default appearance, and the border of every other one
|
|
54
55
|
* @cssprop [--alert-border-width] - Sets the border width, for every appearance. The border takes room out of the padding, so it keeps its size
|
|
@@ -61,14 +62,15 @@ export const EunomiaAlertTagName = "eun-alert";
|
|
|
61
62
|
* @cssprop [--alert-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
|
|
62
63
|
* @cssprop [--alert-gap] - Sets the gap between the icon column and the heading and content column
|
|
63
64
|
* @cssprop [--alert-row-gap] - Sets the gap between the heading, description, and action rows
|
|
64
|
-
* @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button
|
|
65
|
+
* @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button, and of the alert itself when it's given focus
|
|
65
66
|
* @element eun-alert
|
|
66
67
|
*/
|
|
67
|
-
let EunomiaAlert = class EunomiaAlert extends LitElement {
|
|
68
|
+
let EunomiaAlert = class EunomiaAlert extends LocalizableMixin(LitElement) {
|
|
68
69
|
constructor() {
|
|
69
70
|
super(...arguments);
|
|
70
71
|
/**
|
|
71
|
-
* The surface treatment of the alert.
|
|
72
|
+
* The surface treatment of the alert. The default isn't reflected, so an
|
|
73
|
+
* SSR framework doesn't see an attribute it never rendered.
|
|
72
74
|
* @default default
|
|
73
75
|
*/
|
|
74
76
|
this.appearance = "default";
|
|
@@ -83,11 +85,6 @@ let EunomiaAlert = class EunomiaAlert extends LitElement {
|
|
|
83
85
|
* @default false
|
|
84
86
|
*/
|
|
85
87
|
this.closeable = false;
|
|
86
|
-
/**
|
|
87
|
-
* Accessible label of the close button.
|
|
88
|
-
* @default Close
|
|
89
|
-
*/
|
|
90
|
-
this.ariaLabelClose = "Close";
|
|
91
88
|
/**
|
|
92
89
|
* Re-renders when a named slot's assigned content changes, so the
|
|
93
90
|
* description/action rows correctly appear/disappear as content is slotted
|
|
@@ -179,7 +176,7 @@ let EunomiaAlert = class EunomiaAlert extends LitElement {
|
|
|
179
176
|
appearance="ghost"
|
|
180
177
|
rounded
|
|
181
178
|
size="xs"
|
|
182
|
-
aria-label=${this.
|
|
179
|
+
aria-label=${this.closeLabel ?? this.dictionary.common.close}
|
|
183
180
|
@click=${this.handleClose}
|
|
184
181
|
>
|
|
185
182
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -235,7 +232,7 @@ __decorate([
|
|
|
235
232
|
property({ reflect: true })
|
|
236
233
|
], EunomiaAlert.prototype, "severity", void 0);
|
|
237
234
|
__decorate([
|
|
238
|
-
property({ reflect: true })
|
|
235
|
+
property({ reflect: true, useDefault: true })
|
|
239
236
|
], EunomiaAlert.prototype, "appearance", void 0);
|
|
240
237
|
__decorate([
|
|
241
238
|
property()
|
|
@@ -253,8 +250,8 @@ __decorate([
|
|
|
253
250
|
property({ type: Boolean, reflect: true })
|
|
254
251
|
], EunomiaAlert.prototype, "closeable", void 0);
|
|
255
252
|
__decorate([
|
|
256
|
-
property({ attribute: "
|
|
257
|
-
], EunomiaAlert.prototype, "
|
|
253
|
+
property({ attribute: "close-label" })
|
|
254
|
+
], EunomiaAlert.prototype, "closeLabel", void 0);
|
|
258
255
|
__decorate([
|
|
259
256
|
queryAssignedElements({ slot: "description" })
|
|
260
257
|
], EunomiaAlert.prototype, "descriptionSlotEls", void 0);
|
|
@@ -15,7 +15,7 @@ import { css } from "lit";
|
|
|
15
15
|
* [--alert-padding-inline] - Set a custom horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
|
|
16
16
|
* [--alert-gap] - Set a custom gap between the icon column and the heading/content column
|
|
17
17
|
* [--alert-row-gap] - Set a custom gap between the heading, description, and action rows
|
|
18
|
-
* [--alert-focus-outline-color] - Set a custom focus outline color for the close button
|
|
18
|
+
* [--alert-focus-outline-color] - Set a custom focus outline color for the close button, and for the alert itself when it's given focus
|
|
19
19
|
*/
|
|
20
20
|
const base = css `
|
|
21
21
|
:host {
|
|
@@ -23,6 +23,12 @@ const base = css `
|
|
|
23
23
|
width: 100%;
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
26
|
+
border-radius: var(--alert-border-radius, var(--eun-border-radius-m, 8px));
|
|
27
|
+
}
|
|
28
|
+
:host(:focus-visible) {
|
|
29
|
+
outline: 2px solid
|
|
30
|
+
var(--alert-focus-outline-color, var(--eun-color-primary-500, #3d6fff));
|
|
31
|
+
outline-offset: 2px;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
:host(:not([severity])) {
|
|
@@ -98,7 +104,8 @@ const base = css `
|
|
|
98
104
|
grid-column: 1;
|
|
99
105
|
}
|
|
100
106
|
|
|
101
|
-
:host([appearance="default"]) #alert
|
|
107
|
+
:host([appearance="default"]) #alert,
|
|
108
|
+
:host(:not([appearance])) #alert {
|
|
102
109
|
background: linear-gradient(
|
|
103
110
|
to right,
|
|
104
111
|
var(--alert-border-color, var(--_borderColor)) 4px,
|
|
@@ -7,7 +7,7 @@ export declare const EunomiaDrawerTagName = "eun-drawer";
|
|
|
7
7
|
* Which edge of the viewport the drawer slides in from.
|
|
8
8
|
*/
|
|
9
9
|
export type EunomiaDrawerPosition = "start" | "end";
|
|
10
|
-
declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & typeof LitElement;
|
|
10
|
+
declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
11
11
|
/**
|
|
12
12
|
* A full-height side panel that behaves as a modal overlay, sliding in from
|
|
13
13
|
* an edge of the screen. It's the same idea as a modal turned into a
|
|
@@ -32,8 +32,8 @@ declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").C
|
|
|
32
32
|
* @prop {boolean} [open=false] - Whether the drawer is open
|
|
33
33
|
* @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the drawer requests a close
|
|
34
34
|
* @prop {boolean} [dirty=false] - Marks the drawer as having unsaved changes, requiring confirmation before it closes
|
|
35
|
-
* @prop {string}
|
|
36
|
-
* @attr {string} [
|
|
35
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
36
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
37
37
|
* @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
38
38
|
* @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
39
39
|
* @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
|
|
@@ -98,9 +98,9 @@ export declare class EunomiaDrawer extends EunomiaDrawer_base {
|
|
|
98
98
|
dirty: boolean;
|
|
99
99
|
/**
|
|
100
100
|
* Accessible label of the close (X) button.
|
|
101
|
-
*
|
|
101
|
+
* Falls back to the localized string for the current locale when unset.
|
|
102
102
|
*/
|
|
103
|
-
|
|
103
|
+
closeLabel?: string;
|
|
104
104
|
/**
|
|
105
105
|
* Heading of the internal discard-confirmation dialog.
|
|
106
106
|
* @default Discard changes?
|
|
@@ -12,6 +12,7 @@ import { DirtyCloseEvent } from "../../../events/dirty-close.event.js";
|
|
|
12
12
|
import { handleDialogCommand } from "../../../utils/command.utils.js";
|
|
13
13
|
import { DialogSurfaceMixin } from "../../../mixins/dialog-surface.mixin.js";
|
|
14
14
|
import { drawerStyles } from "./drawer.styles.js";
|
|
15
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
15
16
|
/**
|
|
16
17
|
* Tag name of the drawer component.
|
|
17
18
|
*/
|
|
@@ -40,8 +41,8 @@ export const EunomiaDrawerTagName = "eun-drawer";
|
|
|
40
41
|
* @prop {boolean} [open=false] - Whether the drawer is open
|
|
41
42
|
* @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the drawer requests a close
|
|
42
43
|
* @prop {boolean} [dirty=false] - Marks the drawer as having unsaved changes, requiring confirmation before it closes
|
|
43
|
-
* @prop {string}
|
|
44
|
-
* @attr {string} [
|
|
44
|
+
* @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
45
|
+
* @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
|
|
45
46
|
* @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
46
47
|
* @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
|
|
47
48
|
* @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
|
|
@@ -63,7 +64,7 @@ export const EunomiaDrawerTagName = "eun-drawer";
|
|
|
63
64
|
* @cssprop [--drawer-transition-duration] - Sets the duration of the slide transition
|
|
64
65
|
* @element eun-drawer
|
|
65
66
|
*/
|
|
66
|
-
let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
|
|
67
|
+
let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LocalizableMixin(LitElement)) {
|
|
67
68
|
constructor() {
|
|
68
69
|
super(...arguments);
|
|
69
70
|
/**
|
|
@@ -93,11 +94,6 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
|
|
|
93
94
|
* @default false
|
|
94
95
|
*/
|
|
95
96
|
this.dirty = false;
|
|
96
|
-
/**
|
|
97
|
-
* Accessible label of the close (X) button.
|
|
98
|
-
* @default Close
|
|
99
|
-
*/
|
|
100
|
-
this.ariaLabelClose = "Close";
|
|
101
97
|
/**
|
|
102
98
|
* Heading of the internal discard-confirmation dialog.
|
|
103
99
|
* @default Discard changes?
|
|
@@ -404,7 +400,7 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
|
|
|
404
400
|
appearance="ghost"
|
|
405
401
|
rounded
|
|
406
402
|
size="xs"
|
|
407
|
-
aria-label=${this.
|
|
403
|
+
aria-label=${this.closeLabel ?? this.dictionary.common.close}
|
|
408
404
|
@click=${() => this.requestClose()}
|
|
409
405
|
>
|
|
410
406
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -491,7 +487,7 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
|
|
|
491
487
|
*/
|
|
492
488
|
EunomiaDrawer.styles = drawerStyles;
|
|
493
489
|
__decorate([
|
|
494
|
-
property({ reflect: true })
|
|
490
|
+
property({ reflect: true, useDefault: true })
|
|
495
491
|
], EunomiaDrawer.prototype, "position", void 0);
|
|
496
492
|
__decorate([
|
|
497
493
|
property()
|
|
@@ -509,8 +505,8 @@ __decorate([
|
|
|
509
505
|
property({ type: Boolean, reflect: true })
|
|
510
506
|
], EunomiaDrawer.prototype, "dirty", void 0);
|
|
511
507
|
__decorate([
|
|
512
|
-
property({ attribute: "
|
|
513
|
-
], EunomiaDrawer.prototype, "
|
|
508
|
+
property({ attribute: "close-label" })
|
|
509
|
+
], EunomiaDrawer.prototype, "closeLabel", void 0);
|
|
514
510
|
__decorate([
|
|
515
511
|
property({ attribute: "confirm-close-heading" })
|
|
516
512
|
], EunomiaDrawer.prototype, "confirmCloseHeading", void 0);
|
|
@@ -72,7 +72,7 @@ const base = css `
|
|
|
72
72
|
#surface[closing]::backdrop {
|
|
73
73
|
background-color: rgba(7, 22, 33, 0);
|
|
74
74
|
}
|
|
75
|
-
:host([position="end"]) #surface {
|
|
75
|
+
:host(:is([position="end"], :not([position]))) #surface {
|
|
76
76
|
justify-content: flex-end;
|
|
77
77
|
}
|
|
78
78
|
:host([position="start"]) #surface {
|