@taprootio/espalier 6.11.0 → 6.13.0

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/css/esp-reset.css +17 -0
  3. package/custom-elements.json +36316 -33823
  4. package/dist/button/esp-button.d.ts +10 -1
  5. package/dist/button/esp-button.js +55 -28
  6. package/dist/columns/esp-columns.d.ts +52 -0
  7. package/dist/columns/esp-columns.js +45 -0
  8. package/dist/header/esp-header.d.ts +64 -2
  9. package/dist/header/esp-header.js +285 -44
  10. package/dist/header/header-geometry-controller.js +1 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -1
  13. package/dist/menu/esp-menu-group.d.ts +1 -0
  14. package/dist/menu/esp-menu-group.js +34 -20
  15. package/dist/menu/esp-menu-item.d.ts +31 -1
  16. package/dist/menu/esp-menu-item.js +82 -15
  17. package/dist/menu/esp-menu.d.ts +3 -2
  18. package/dist/menu/esp-menu.js +64 -51
  19. package/dist/menu/menu-presentation.d.ts +1 -0
  20. package/dist/menu/menu-presentation.js +37 -0
  21. package/dist/menu/swipe-reveal-controller.js +1 -1
  22. package/dist/page/bi-directional-sticky-controller.js +1 -1
  23. package/dist/page/esp-page.d.ts +10 -2
  24. package/dist/page/esp-page.js +37 -35
  25. package/dist/page/esp-page.styles.js +36 -0
  26. package/dist/radio-button/esp-radio-button-group.d.ts +4 -1
  27. package/dist/radio-button/esp-radio-button-group.js +5 -5
  28. package/dist/radio-button/esp-radio-button.d.ts +3 -1
  29. package/dist/radio-button/esp-radio-button.js +6 -6
  30. package/dist/row/esp-row.js +3 -26
  31. package/dist/shared/configured-brand.d.ts +3 -1
  32. package/dist/shared/configured-brand.js +5 -5
  33. package/dist/shared/layout-gap.js +5 -0
  34. package/dist/shared/popover-controller.js +1 -1
  35. package/dist/stack/esp-stack.js +3 -26
  36. package/espalier.css-data.json +17 -1
  37. package/espalier.token-manifest.json +25 -1
  38. package/package.json +5 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./box/esp-box.js";export*from"./action-menu/esp-action-menu.js";export*from"./action-menu/esp-action-menu-item.js";export*from"./avatar/esp-avatar.js";export*from"./avatar/esp-profile-chip.js";export*from"./badge/esp-badge.js";export*from"./checkbox/esp-checkbox.js";export*from"./checkbox/esp-checkbox-group.js";export*from"./data-cell/esp-data-cell.js";export*from"./radio-button/esp-radio-button.js";export*from"./radio-button/esp-radio-button-group.js";export*from"./repeater/esp-repeater.js";export*from"./breadcrumbs/esp-breadcrumbs.js";export*from"./button/esp-button.js";export*from"./button/esp-button-group.js";export*from"./color-picker/esp-color-picker.js";export*from"./flyout/esp-flyout.js";export*from"./form/esp-form.js";export*from"./form-item/esp-form-item.js";export*from"./help/esp-help-button.js";export*from"./help/esp-help-provider.js";export*from"./header/index.js";export*from"./page/esp-page.js";export*from"./section/esp-section.js";export*from"./stack/esp-stack.js";export*from"./row/esp-row.js";export*from"./popover/esp-popover.js";export*from"./dialog/esp-dialog.js";export*from"./empty-state/esp-empty-state.js";export*from"./image-upload/esp-image-upload.js";export*from"./image-picker/esp-image-picker.js";export*from"./file-upload/esp-file-upload.js";export*from"./font-picker/esp-font-picker.js";export*from"./focus-picker/esp-focus-picker.js";export*from"./footer/index.js";export*from"./grid/esp-grid.js";export*from"./image/esp-image.js";export*from"./image/image-focus.js";export*from"./video/esp-video.js";export*from"./lightbox/esp-lightbox.js";export*from"./info/esp-info.js";export*from"./input/esp-input.js";export*from"./textarea/esp-textarea.js";export*from"./pickers/esp-pick-one.js";export*from"./pickers/esp-pick-some.js";export*from"./pickers/esp-picker-menu.js";export*from"./pickers/esp-picker-item.js";export*from"./root/esp-root.js";export*from"./menu/index.js";export*from"./burger/esp-burger.js";export*from"./date-picker/esp-date-picker.js";export*from"./details/esp-details.js";export*from"./details/esp-details-group.js";export*from"./tabs/esp-tab.js";export*from"./tabs/esp-tab-group.js";export*from"./slider/esp-slider.js";export*from"./switch/esp-switch.js";export*from"./toaster/esp-toaster.js";export*from"./tooltip/esp-tooltip.js";export*from"./progress/esp-progress.js";export*from"./search/esp-search.js";export*from"./status-indicator/esp-status-indicator.js";export*from"./tree/esp-tree.js";export*from"./tree/esp-tree-item.js";import{DEFAULT_ICON_SPRITE_URL as Io,DEFAULT_ICON_VIEW_BOX as io,INTENT_VARIANTS as Fo,normalizeIntentVariant as lo,getIconHrefForHost as no,getIconSpriteUrl as Ao,getIconSpriteReference as So}from"./shared/intent-values.js";import{EspalierElementBase as Lo}from"./shared/esp-element-base.js";import{VALIDITY_CHANGED_EVENT as Do}from"./shared/validation.js";import{FormFieldController as No}from"./shared/form-field-controller.js";import{traverseToClosest as ho}from"./shared/utilities.js";import{showToast as Po}from"./shared/toast-events.js";import{showFlyout as Oo,closeFlyout as uo}from"./shared/flyout-events.js";import{requestHelp as Co}from"./shared/help-events.js";import{getEspBus as Go}from"./shared/bus-events.js";export*from"./shared/events.js";import{getImageDetails as Wo,releasePreviewUrl as vo}from"./image-upload/image-helpers.js";import{calculateAlbumLayout as wo,DEFAULT_ALBUM_MAX_ROW_HEIGHT_VH as Bo,normalizeAlbumMaxRowHeightVh as zo,normalizeMaxImagesPerRow as Ko}from"./shared/justified-layout.js";import{encodeTheme as qo,parseTheme as Yo,mergePartials as jo,layerThemes as Jo,validateThemePair as Qo,resolveContextTheme as Zo,isObjectRecord as $o,isSemanticColorName as oe,buildTaprootLightTheme as ee,buildTaprootDarkTheme as re,NESTED_THEME_KEYS as te}from"./shared/theme.js";import{auditDataPalette as pe,describePaletteCollision as fe,generateSequentialRamp as Te,generateDivergingRamp as xe,COLOR_VISION_SIMULATIONS as _e,DATA_SERIES_KEYS as Ee,DEFAULT_DATA_PALETTE as ae,DEFAULT_DATA_RAMP_STEPS as Ie,DEFAULT_DIVERGING_NEUTRAL as ie,MAX_DATA_RAMP_STEPS as Fe,MIN_DATA_COLOR_DISTANCE as le,MIN_DATA_RAMP_LIGHTNESS_STEP as ne,MIN_DATA_RAMP_STEPS as Ae}from"./shared/data-colors.js";import{canonicalFontStack as se,classifyFontStack as Le,customWebSafeFont as Re,isDeviceFontStack as De,matchWebSafeFont as ce,parseFontStack as Ne,webSafeFontWeights as ge}from"./shared/font-stacks.js";import{WEIGHT_LABELS as Me,extractWeights as Pe,normalizeWeight as He,bestAvailableWeight as Oe,extractFamily as ue,getFallbackFont as Ue,googleFontStylesheetUrl as Ce,isLocalFontFamily as be,normalizeFontFaceWeight as Ge,removeRuntimeGoogleFontLink as Ve,removeRuntimeGoogleFontLinks as ke,syncRuntimeGoogleFontLink as We,RUNTIME_GOOGLE_FONT_OWNER_ATTR as de}from"./shared/font-helpers.js";import{compileFontPlan as ye,fontFallbackAliases as we,fontFallbackBaseIndexes as Be,fontFaceRequestKey as ze}from"./shared/font-plan.js";import{getGoogleFonts as Xe}from"./font-picker/esp-font-picker.js";import{ROOT_SURFACE as Ye,THEME_FIT_ANCHOR_FIELDS as je,THEME_FIT_APCA_FIELDS as Je,THEME_FIT_DATA_PALETTE_LINT_FIELDS as Qe,THEME_FIT_DATA_PALETTE_LINT_IDS as Ze,THEME_FIT_EXPLICIT_VALUES as $e,THEME_FIT_LINT_FIELDS as or,THEME_FIT_LINT_IDS as er,THEME_FIT_LINT_SEVERITIES as rr,THEME_FIT_PAIRING_VALUES as tr,THEME_FIT_REPORT_FIELDS as mr,THEME_FIT_SUITE_FIELDS as pr,THEME_FIT_TOKEN_FIELDS as fr,themeFitReport as Tr,themeFitRows as xr,themeFitLints as _r,themeFitReportSuite as Er,printThemeFitReport as ar}from"./shared/theme-fit-report.js";import{ICON_SPRITE as ir,ICON_SPRITE_ID as Fr,installIconSprite as lr}from"./icons/index.js";import{deriveLightnessRamp as Ar,themeFromSwatches as Sr}from"./shared/theme-swatches.js";export{_e as COLOR_VISION_SIMULATIONS,Ee as DATA_SERIES_KEYS,Bo as DEFAULT_ALBUM_MAX_ROW_HEIGHT_VH,ae as DEFAULT_DATA_PALETTE,Ie as DEFAULT_DATA_RAMP_STEPS,ie as DEFAULT_DIVERGING_NEUTRAL,Io as DEFAULT_ICON_SPRITE_URL,io as DEFAULT_ICON_VIEW_BOX,Lo as EspalierElementBase,No as FormFieldController,ir as ICON_SPRITE,Fr as ICON_SPRITE_ID,Fo as INTENT_VARIANTS,Fe as MAX_DATA_RAMP_STEPS,le as MIN_DATA_COLOR_DISTANCE,ne as MIN_DATA_RAMP_LIGHTNESS_STEP,Ae as MIN_DATA_RAMP_STEPS,te as NESTED_THEME_KEYS,Ye as ROOT_SURFACE,de as RUNTIME_GOOGLE_FONT_OWNER_ATTR,je as THEME_FIT_ANCHOR_FIELDS,Je as THEME_FIT_APCA_FIELDS,Qe as THEME_FIT_DATA_PALETTE_LINT_FIELDS,Ze as THEME_FIT_DATA_PALETTE_LINT_IDS,$e as THEME_FIT_EXPLICIT_VALUES,or as THEME_FIT_LINT_FIELDS,er as THEME_FIT_LINT_IDS,rr as THEME_FIT_LINT_SEVERITIES,tr as THEME_FIT_PAIRING_VALUES,mr as THEME_FIT_REPORT_FIELDS,pr as THEME_FIT_SUITE_FIELDS,fr as THEME_FIT_TOKEN_FIELDS,Do as VALIDITY_CHANGED_EVENT,Me as WEIGHT_LABELS,pe as auditDataPalette,Oe as bestAvailableWeight,re as buildTaprootDarkTheme,ee as buildTaprootLightTheme,wo as calculateAlbumLayout,se as canonicalFontStack,Le as classifyFontStack,uo as closeFlyout,ye as compileFontPlan,Re as customWebSafeFont,Ar as deriveLightnessRamp,fe as describePaletteCollision,qo as encodeTheme,ue as extractFamily,Pe as extractWeights,ze as fontFaceRequestKey,we as fontFallbackAliases,Be as fontFallbackBaseIndexes,xe as generateDivergingRamp,Te as generateSequentialRamp,Go as getEspBus,Ue as getFallbackFont,Xe as getGoogleFonts,no as getIconHrefForHost,So as getIconSpriteReference,Ao as getIconSpriteUrl,Wo as getImageDetails,Ce as googleFontStylesheetUrl,lr as installIconSprite,De as isDeviceFontStack,be as isLocalFontFamily,$o as isObjectRecord,oe as isSemanticColorName,Jo as layerThemes,ce as matchWebSafeFont,jo as mergePartials,zo as normalizeAlbumMaxRowHeightVh,Ge as normalizeFontFaceWeight,lo as normalizeIntentVariant,Ko as normalizeMaxImagesPerRow,He as normalizeWeight,Ne as parseFontStack,Yo as parseTheme,ar as printThemeFitReport,vo as releasePreviewUrl,Ve as removeRuntimeGoogleFontLink,ke as removeRuntimeGoogleFontLinks,Co as requestHelp,Zo as resolveContextTheme,Oo as showFlyout,Po as showToast,We as syncRuntimeGoogleFontLink,_r as themeFitLints,Tr as themeFitReport,Er as themeFitReportSuite,xr as themeFitRows,Sr as themeFromSwatches,ho as traverseToClosest,Qo as validateThemePair,ge as webSafeFontWeights};
1
+ export*from"./box/esp-box.js";export*from"./action-menu/esp-action-menu.js";export*from"./action-menu/esp-action-menu-item.js";export*from"./avatar/esp-avatar.js";export*from"./avatar/esp-profile-chip.js";export*from"./badge/esp-badge.js";export*from"./checkbox/esp-checkbox.js";export*from"./checkbox/esp-checkbox-group.js";export*from"./data-cell/esp-data-cell.js";export*from"./radio-button/esp-radio-button.js";export*from"./radio-button/esp-radio-button-group.js";export*from"./repeater/esp-repeater.js";export*from"./breadcrumbs/esp-breadcrumbs.js";export*from"./button/esp-button.js";export*from"./button/esp-button-group.js";export*from"./color-picker/esp-color-picker.js";export*from"./flyout/esp-flyout.js";export*from"./form/esp-form.js";export*from"./form-item/esp-form-item.js";export*from"./help/esp-help-button.js";export*from"./help/esp-help-provider.js";export*from"./header/index.js";export*from"./page/esp-page.js";export*from"./section/esp-section.js";export*from"./stack/esp-stack.js";export*from"./row/esp-row.js";export*from"./columns/esp-columns.js";export*from"./popover/esp-popover.js";export*from"./dialog/esp-dialog.js";export*from"./empty-state/esp-empty-state.js";export*from"./image-upload/esp-image-upload.js";export*from"./image-picker/esp-image-picker.js";export*from"./file-upload/esp-file-upload.js";export*from"./font-picker/esp-font-picker.js";export*from"./focus-picker/esp-focus-picker.js";export*from"./footer/index.js";export*from"./grid/esp-grid.js";export*from"./image/esp-image.js";export*from"./image/image-focus.js";export*from"./video/esp-video.js";export*from"./lightbox/esp-lightbox.js";export*from"./info/esp-info.js";export*from"./input/esp-input.js";export*from"./textarea/esp-textarea.js";export*from"./pickers/esp-pick-one.js";export*from"./pickers/esp-pick-some.js";export*from"./pickers/esp-picker-menu.js";export*from"./pickers/esp-picker-item.js";export*from"./root/esp-root.js";export*from"./menu/index.js";export*from"./burger/esp-burger.js";export*from"./date-picker/esp-date-picker.js";export*from"./details/esp-details.js";export*from"./details/esp-details-group.js";export*from"./tabs/esp-tab.js";export*from"./tabs/esp-tab-group.js";export*from"./slider/esp-slider.js";export*from"./switch/esp-switch.js";export*from"./toaster/esp-toaster.js";export*from"./tooltip/esp-tooltip.js";export*from"./progress/esp-progress.js";export*from"./search/esp-search.js";export*from"./status-indicator/esp-status-indicator.js";export*from"./tree/esp-tree.js";export*from"./tree/esp-tree-item.js";import{DEFAULT_ICON_SPRITE_URL as io,DEFAULT_ICON_VIEW_BOX as Fo,INTENT_VARIANTS as lo,normalizeIntentVariant as no,getIconHrefForHost as Ao,getIconSpriteUrl as So,getIconSpriteReference as so}from"./shared/intent-values.js";import{EspalierElementBase as Ro}from"./shared/esp-element-base.js";import{VALIDITY_CHANGED_EVENT as co}from"./shared/validation.js";import{FormFieldController as go}from"./shared/form-field-controller.js";import{traverseToClosest as Mo}from"./shared/utilities.js";import{showToast as Ho}from"./shared/toast-events.js";import{showFlyout as uo,closeFlyout as Uo}from"./shared/flyout-events.js";import{requestHelp as bo}from"./shared/help-events.js";import{getEspBus as Vo}from"./shared/bus-events.js";export*from"./shared/events.js";import{getImageDetails as vo,releasePreviewUrl as yo}from"./image-upload/image-helpers.js";import{calculateAlbumLayout as Bo,DEFAULT_ALBUM_MAX_ROW_HEIGHT_VH as zo,normalizeAlbumMaxRowHeightVh as Ko,normalizeMaxImagesPerRow as Xo}from"./shared/justified-layout.js";import{encodeTheme as Yo,parseTheme as jo,mergePartials as Jo,layerThemes as Qo,validateThemePair as Zo,resolveContextTheme as $o,isObjectRecord as oe,isSemanticColorName as ee,buildTaprootLightTheme as re,buildTaprootDarkTheme as te,NESTED_THEME_KEYS as me}from"./shared/theme.js";import{auditDataPalette as fe,describePaletteCollision as xe,generateSequentialRamp as Te,generateDivergingRamp as _e,COLOR_VISION_SIMULATIONS as Ee,DATA_SERIES_KEYS as ae,DEFAULT_DATA_PALETTE as Ie,DEFAULT_DATA_RAMP_STEPS as ie,DEFAULT_DIVERGING_NEUTRAL as Fe,MAX_DATA_RAMP_STEPS as le,MIN_DATA_COLOR_DISTANCE as ne,MIN_DATA_RAMP_LIGHTNESS_STEP as Ae,MIN_DATA_RAMP_STEPS as Se}from"./shared/data-colors.js";import{canonicalFontStack as Le,classifyFontStack as Re,customWebSafeFont as De,isDeviceFontStack as ce,matchWebSafeFont as Ne,parseFontStack as ge,webSafeFontWeights as he}from"./shared/font-stacks.js";import{WEIGHT_LABELS as Pe,extractWeights as He,normalizeWeight as Oe,bestAvailableWeight as ue,extractFamily as Ue,getFallbackFont as Ce,googleFontStylesheetUrl as be,isLocalFontFamily as Ge,normalizeFontFaceWeight as Ve,removeRuntimeGoogleFontLink as ke,removeRuntimeGoogleFontLinks as We,syncRuntimeGoogleFontLink as de,RUNTIME_GOOGLE_FONT_OWNER_ATTR as ve}from"./shared/font-helpers.js";import{compileFontPlan as we,fontFallbackAliases as Be,fontFallbackBaseIndexes as ze,fontFaceRequestKey as Ke}from"./shared/font-plan.js";import{getGoogleFonts as qe}from"./font-picker/esp-font-picker.js";import{ROOT_SURFACE as je,THEME_FIT_ANCHOR_FIELDS as Je,THEME_FIT_APCA_FIELDS as Qe,THEME_FIT_DATA_PALETTE_LINT_FIELDS as Ze,THEME_FIT_DATA_PALETTE_LINT_IDS as $e,THEME_FIT_EXPLICIT_VALUES as or,THEME_FIT_LINT_FIELDS as er,THEME_FIT_LINT_IDS as rr,THEME_FIT_LINT_SEVERITIES as tr,THEME_FIT_PAIRING_VALUES as mr,THEME_FIT_REPORT_FIELDS as pr,THEME_FIT_SUITE_FIELDS as fr,THEME_FIT_TOKEN_FIELDS as xr,themeFitReport as Tr,themeFitRows as _r,themeFitLints as Er,themeFitReportSuite as ar,printThemeFitReport as Ir}from"./shared/theme-fit-report.js";import{ICON_SPRITE as Fr,ICON_SPRITE_ID as lr,installIconSprite as nr}from"./icons/index.js";import{deriveLightnessRamp as Sr,themeFromSwatches as sr}from"./shared/theme-swatches.js";export{Ee as COLOR_VISION_SIMULATIONS,ae as DATA_SERIES_KEYS,zo as DEFAULT_ALBUM_MAX_ROW_HEIGHT_VH,Ie as DEFAULT_DATA_PALETTE,ie as DEFAULT_DATA_RAMP_STEPS,Fe as DEFAULT_DIVERGING_NEUTRAL,io as DEFAULT_ICON_SPRITE_URL,Fo as DEFAULT_ICON_VIEW_BOX,Ro as EspalierElementBase,go as FormFieldController,Fr as ICON_SPRITE,lr as ICON_SPRITE_ID,lo as INTENT_VARIANTS,le as MAX_DATA_RAMP_STEPS,ne as MIN_DATA_COLOR_DISTANCE,Ae as MIN_DATA_RAMP_LIGHTNESS_STEP,Se as MIN_DATA_RAMP_STEPS,me as NESTED_THEME_KEYS,je as ROOT_SURFACE,ve as RUNTIME_GOOGLE_FONT_OWNER_ATTR,Je as THEME_FIT_ANCHOR_FIELDS,Qe as THEME_FIT_APCA_FIELDS,Ze as THEME_FIT_DATA_PALETTE_LINT_FIELDS,$e as THEME_FIT_DATA_PALETTE_LINT_IDS,or as THEME_FIT_EXPLICIT_VALUES,er as THEME_FIT_LINT_FIELDS,rr as THEME_FIT_LINT_IDS,tr as THEME_FIT_LINT_SEVERITIES,mr as THEME_FIT_PAIRING_VALUES,pr as THEME_FIT_REPORT_FIELDS,fr as THEME_FIT_SUITE_FIELDS,xr as THEME_FIT_TOKEN_FIELDS,co as VALIDITY_CHANGED_EVENT,Pe as WEIGHT_LABELS,fe as auditDataPalette,ue as bestAvailableWeight,te as buildTaprootDarkTheme,re as buildTaprootLightTheme,Bo as calculateAlbumLayout,Le as canonicalFontStack,Re as classifyFontStack,Uo as closeFlyout,we as compileFontPlan,De as customWebSafeFont,Sr as deriveLightnessRamp,xe as describePaletteCollision,Yo as encodeTheme,Ue as extractFamily,He as extractWeights,Ke as fontFaceRequestKey,Be as fontFallbackAliases,ze as fontFallbackBaseIndexes,_e as generateDivergingRamp,Te as generateSequentialRamp,Vo as getEspBus,Ce as getFallbackFont,qe as getGoogleFonts,Ao as getIconHrefForHost,so as getIconSpriteReference,So as getIconSpriteUrl,vo as getImageDetails,be as googleFontStylesheetUrl,nr as installIconSprite,ce as isDeviceFontStack,Ge as isLocalFontFamily,oe as isObjectRecord,ee as isSemanticColorName,Qo as layerThemes,Ne as matchWebSafeFont,Jo as mergePartials,Ko as normalizeAlbumMaxRowHeightVh,Ve as normalizeFontFaceWeight,no as normalizeIntentVariant,Xo as normalizeMaxImagesPerRow,Oe as normalizeWeight,ge as parseFontStack,jo as parseTheme,Ir as printThemeFitReport,yo as releasePreviewUrl,ke as removeRuntimeGoogleFontLink,We as removeRuntimeGoogleFontLinks,bo as requestHelp,$o as resolveContextTheme,uo as showFlyout,Ho as showToast,de as syncRuntimeGoogleFontLink,Er as themeFitLints,Tr as themeFitReport,ar as themeFitReportSuite,_r as themeFitRows,sr as themeFromSwatches,Mo as traverseToClosest,Zo as validateThemePair,he as webSafeFontWeights};
@@ -90,6 +90,7 @@ export declare class EspalierMenuGroup extends EspalierElementBase {
90
90
  urlPrefix: string;
91
91
  connectedCallback(): void;
92
92
  disconnectedCallback(): void;
93
+ protected willUpdate(changedProperties: PropertyValues): void;
93
94
  protected firstUpdated(_changedProperties: PropertyValues): void;
94
95
  protected updated(changedProperties: PropertyValues): void;
95
96
  protected render(): TemplateResult<1>;
@@ -1,12 +1,12 @@
1
- var i=function(l,e,o,a){var p=arguments.length,s=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,o):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(l,e,o,a);else for(var c=l.length-1;c>=0;c--)(d=l[c])&&(s=(p<3?d(s):p>3?d(e,o,s):d(e,o))||s);return p>3&&s&&Object.defineProperty(e,o,s),s},u;import{css as b,html as n,nothing as h}from"lit";import{customElement as y,property as r,state as w}from"lit/decorators.js";import{classMap as k}from"lit/directives/class-map.js";import{createRef as m,ref as g}from"lit/directives/ref.js";import{EspalierElementBase as f}from"../shared/esp-element-base.js";import{ESP_EVENTS as x}from"../shared/events.js";import{getIconHrefForHost as z}from"../shared/intent-values.js";import{pathStartsWithSegment as v,pathsMatch as L}from"../shared/path-matching.js";import{SlottedIconController as S}from"../shared/slotted-icon-controller.js";import{renderSpriteIcon as $}from"../shared/svgs/render-sprite-icon.js";import{DEFAULT_NEW_TAB_LABEL as E,renderNewTabCue as T}from"../shared/new-tab-cue.js";import{srOnly as C}from"../shared/style-fragments.js";import{EspalierMenuItem as D}from"./esp-menu-item.js";let t=u=class extends f{constructor(){super(...arguments),this.itemsSlot=m(),this.toggleButton=m(),this.iconSlot=new S(this),this.openedByUrlPrefix=!1,this.dismissedUrlPrefix=!1,this.label="",this.url="",this.target="",this.rel="",this.newTabLabel=E,this.icon="",this.open=!1,this.mode="vertical",this.depth=0,this.touchDevice=!1,this.fullScreenPresentation=!1,this.active=!1,this.urlPrefix="",this.globalListenersActive=!1,this.handleDocumentClick=e=>{this.open&&(e.composedPath().includes(this)||this.setOpen(!1))},this.handleDocumentKeydown=e=>{!this.open||e.key!=="Escape"||(e.preventDefault(),this.setOpen(!1),this.toggleButton.value?.focus())}}connectedCallback(){super.connectedCallback(),this.checkActive()}disconnectedCallback(){super.disconnectedCallback(),this.removeGlobalDismissListeners()}firstUpdated(e){super.firstUpdated(e),this.propagateToChildren()}updated(e){super.updated(e),(e.has("mode")||e.has("depth")||e.has("touchDevice"))&&this.propagateToChildren(),(e.has("mode")||e.has("depth")||e.has("urlPrefix"))&&this.syncUrlPrefixExpansion(),e.has("url")&&this.checkActive(),e.has("open")&&!this.open&&(this.openedByUrlPrefix=!1),(e.has("open")||e.has("mode"))&&(this.open&&this.isHorizontalTopLevel?this.addGlobalDismissListeners():this.removeGlobalDismissListeners())}checkActive(){if(!this.url){this.active=!1;return}this.active=L(this.url)}get isHorizontalTopLevel(){return this.mode==="horizontal"&&this.depth===0}get childMode(){return this.mode==="horizontal"?"vertical":this.mode}syncUrlPrefixExpansion(){const e=v(location.pathname,this.urlPrefix);if(e||(this.dismissedUrlPrefix=!1),e&&!this.dismissedUrlPrefix&&!this.isHorizontalTopLevel){this.open||(this.open=!0,this.openedByUrlPrefix=!0);return}this.openedByUrlPrefix&&(this.open=!1,this.openedByUrlPrefix=!1)}getChildren(){return this.itemsSlot.value?Array.from(this.itemsSlot.value.assignedElements()):[]}propagateToChildren(){for(const e of this.getChildren())e instanceof D?(e.mode=this.childMode,e.depth=this.depth+1,e.touchDevice=this.touchDevice):e instanceof u&&(e.mode=this.childMode,e.depth=this.depth+1,e.touchDevice=this.touchDevice)}handleSlotChange(){this.propagateToChildren()}setOpen(e){this.open!==e&&(this.openedByUrlPrefix=!1,this.dismissedUrlPrefix=!e&&v(location.pathname,this.urlPrefix),this.open=e,this.dispatchEvent(new CustomEvent(x.MENU_GROUP_TOGGLE,{detail:{open:this.open},bubbles:!0,composed:!0})))}handleHeaderClick(e){this.mode==="drawer"&&!e.composedPath().some(o=>o instanceof HTMLElement&&o.classList.contains("group-icon"))||this.toggleOpen()}handleLinkClick(e){e.stopPropagation()}handleToggleClick(e){e.stopPropagation(),this.toggleOpen()}toggleOpen(){this.setOpen(!this.open)}handleGroupKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.setOpen(!1),this.toggleButton.value?.focus())}addGlobalDismissListeners(){this.globalListenersActive||(document.addEventListener("click",this.handleDocumentClick,!0),document.addEventListener("keydown",this.handleDocumentKeydown),this.globalListenersActive=!0)}removeGlobalDismissListeners(){this.globalListenersActive&&(document.removeEventListener("click",this.handleDocumentClick,!0),document.removeEventListener("keydown",this.handleDocumentKeydown),this.globalListenersActive=!1)}renderIcon(){const e=z(this.icon,this),o=this.iconSlot.hasSlottedIcon();return n`
1
+ var i=function(d,e,t,r){var a=arguments.length,n=a<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(d,e,t,r);else for(var l=d.length-1;l>=0;l--)(h=d[l])&&(n=(a<3?h(n):a>3?h(e,t,n):h(e,t))||n);return a>3&&n&&Object.defineProperty(e,t,n),n},g;import{MENU_SOURCE_CHANGED as w}from"./menu-presentation.js";import{css as x,html as p,nothing as c}from"lit";import{customElement as P,property as s,state as k}from"lit/decorators.js";import{classMap as S}from"lit/directives/class-map.js";import{createRef as m,ref as u}from"lit/directives/ref.js";import{EspalierElementBase as f}from"../shared/esp-element-base.js";import{ESP_EVENTS as z}from"../shared/events.js";import{getIconHrefForHost as E}from"../shared/intent-values.js";import{pathStartsWithSegment as v,pathsMatch as C}from"../shared/path-matching.js";import{SlottedIconController as L}from"../shared/slotted-icon-controller.js";import{renderSpriteIcon as $}from"../shared/svgs/render-sprite-icon.js";import{DEFAULT_NEW_TAB_LABEL as T,renderNewTabCue as D}from"../shared/new-tab-cue.js";import{PopoverController as U}from"../shared/popover-controller.js";import{viewportSize as B}from"../shared/viewport.js";import{srOnly as O}from"../shared/style-fragments.js";import{EspalierMenuItem as _}from"./esp-menu-item.js";let o=g=class extends f{constructor(){super(...arguments),this.itemsSlot=m(),this.toggleButton=m(),this.panel=m(),this.scrollPanelPresented=!1,this.panelPosition=new U({host:this,closeStrategy:"source-identity",isOpen:()=>this.scrollPanelPresented&&this.open,onShouldClose:()=>{},onPositionUpdate:()=>this.positionScrollPanel(),getPositionElements:()=>[this.toggleButton.value,this.panel.value,this.parentElement],trackShadowScroll:!0}),this.iconSlot=new L(this),this.openedByUrlPrefix=!1,this.dismissedUrlPrefix=!1,this.label="",this.url="",this.target="",this.rel="",this.newTabLabel=T,this.icon="",this.open=!1,this.mode="vertical",this.depth=0,this.scrollPanelEnabled=!1,this.touchDevice=!1,this.fullScreenPresentation=!1,this.active=!1,this.urlPrefix="",this.globalListenersActive=!1,this.handleDocumentClick=e=>{this.open&&(e.composedPath().includes(this)||this.setOpen(!1))},this.handleDocumentKeydown=e=>{!this.open||e.key!=="Escape"||(e.preventDefault(),this.setOpen(!1),this.toggleButton.value?.focus())}}connectedCallback(){super.connectedCallback(),this.checkActive()}disconnectedCallback(){const e=this.scrollPanelEnabled||this.scrollPanelPresented;this.closeScrollPanel(),e&&(this.scrollPanelEnabled=!1,this.open=!1),super.disconnectedCallback(),this.removeGlobalDismissListeners()}willUpdate(e){super.willUpdate(e),!this.usesScrollPanel&&(this.scrollPanelPresented||e.get("scrollPanelEnabled")===!0)&&(this.closeScrollPanel(),this.setOpen(!1))}firstUpdated(e){super.firstUpdated(e),this.propagateToChildren()}updated(e){super.updated(e),["label","url","target","rel","newTabLabel","icon","open"].some(t=>e.has(t))&&this.dispatchEvent(new CustomEvent(w,{bubbles:!0,composed:!0})),(e.has("mode")||e.has("depth")||e.has("touchDevice"))&&this.propagateToChildren(),(e.has("mode")||e.has("depth")||e.has("urlPrefix"))&&this.syncUrlPrefixExpansion(),e.has("url")&&this.checkActive(),e.has("open")&&!this.open&&(this.openedByUrlPrefix=!1),this.syncScrollPanel(),(e.has("open")||e.has("mode")||e.has("depth"))&&(this.open&&this.isHorizontalTopLevel?this.addGlobalDismissListeners():this.removeGlobalDismissListeners())}checkActive(){if(!this.url){this.active=!1;return}this.active=C(this.url)}get isHorizontalTopLevel(){return this.mode==="horizontal"&&this.depth===0}get usesScrollPanel(){return this.scrollPanelEnabled&&this.isHorizontalTopLevel}syncScrollPanel(){if(!this.open||!this.usesScrollPanel||!this.isConnected){this.closeScrollPanel();return}const e=this.panel.value;if(!(!e||this.scrollPanelPresented)){try{e.showPopover()}catch{this.setOpen(!1);return}this.scrollPanelPresented=!0,this.positionScrollPanel(),this.panelPosition.startTracking()}}closeScrollPanel(){if(this.panelPosition.stopTracking(),!this.scrollPanelPresented)return;this.scrollPanelPresented=!1;const e=this.panel.value;try{e?.hidePopover()}catch{}e?.style.removeProperty("left"),e?.style.removeProperty("top"),e?.style.removeProperty("max-height")}positionScrollPanel(){const e=this.panel.value,t=this.toggleButton.value;if(!this.scrollPanelPresented||!e||!t)return;const r=t.getBoundingClientRect(),a=B(),n=Math.max(0,a.height-r.bottom),h=Math.max(0,r.top);e.style.maxHeight=`min(70vh, 36rem, ${Math.max(h,n)}px)`;const l=e.getBoundingClientRect(),b=getComputedStyle(this).direction==="rtl"?r.right-l.width:r.left,y=l.height<=n||n>=h?r.bottom:r.top-l.height;e.style.left=`${Math.max(0,Math.min(b,a.width-l.width))}px`,e.style.top=`${Math.max(0,Math.min(y,a.height-l.height))}px`}get childMode(){return this.mode==="horizontal"?"vertical":this.mode}syncUrlPrefixExpansion(){const e=v(location.pathname,this.urlPrefix);if(e||(this.dismissedUrlPrefix=!1),e&&!this.dismissedUrlPrefix&&!this.isHorizontalTopLevel){this.open||(this.open=!0,this.openedByUrlPrefix=!0);return}this.openedByUrlPrefix&&(this.open=!1,this.openedByUrlPrefix=!1)}getChildren(){return this.itemsSlot.value?Array.from(this.itemsSlot.value.assignedElements()):[]}propagateToChildren(){for(const e of this.getChildren())e instanceof _?(e.mode=this.childMode,e.depth=this.depth+1,e.touchDevice=this.touchDevice):e instanceof g&&(e.mode=this.childMode,e.depth=this.depth+1,e.touchDevice=this.touchDevice)}handleSlotChange(){this.propagateToChildren()}setOpen(e){this.open!==e&&(this.openedByUrlPrefix=!1,this.dismissedUrlPrefix=!e&&v(location.pathname,this.urlPrefix),this.open=e,this.dispatchEvent(new CustomEvent(z.MENU_GROUP_TOGGLE,{detail:{open:this.open},bubbles:!0,composed:!0})))}handleHeaderClick(e){this.mode==="drawer"&&!e.composedPath().some(t=>t instanceof HTMLElement&&t.classList.contains("group-icon"))||this.toggleOpen()}handleLinkClick(e){e.stopPropagation()}handleToggleClick(e){e.stopPropagation(),this.toggleOpen()}toggleOpen(){this.setOpen(!this.open)}handleGroupKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.setOpen(!1),this.toggleButton.value?.focus())}addGlobalDismissListeners(){this.globalListenersActive||(document.addEventListener("click",this.handleDocumentClick,!0),document.addEventListener("keydown",this.handleDocumentKeydown),this.globalListenersActive=!0)}removeGlobalDismissListeners(){this.globalListenersActive&&(document.removeEventListener("click",this.handleDocumentClick,!0),document.removeEventListener("keydown",this.handleDocumentKeydown),this.globalListenersActive=!1)}renderIcon(){const e=E(this.icon,this),t=this.iconSlot.hasSlottedIcon();return p`
2
2
  <slot
3
3
  name="icon"
4
- ${g(this.iconSlot.slotRef)}
4
+ ${u(this.iconSlot.slotRef)}
5
5
  @slotchange=${this.iconSlot.handleSlotChange}
6
6
  ></slot>
7
- ${!o&&e?$(e):h}
8
- `}renderToggle(e){return n`<button
9
- ${g(this.toggleButton)}
7
+ ${!t&&e?$(e):c}
8
+ `}renderToggle(e){return p`<button
9
+ ${u(this.toggleButton)}
10
10
  class="group-toggle"
11
11
  type="button"
12
12
  aria-expanded=${this.open?"true":"false"}
@@ -14,38 +14,40 @@ var i=function(l,e,o,a){var p=arguments.length,s=p<3?e:a===null?a=Object.getOwnP
14
14
  @click=${this.handleToggleClick}
15
15
  >
16
16
  ${e}<span class="indicator" aria-hidden="true"></span>
17
- </button>`}render(){const e={group:!0,"is-horizontal":this.isHorizontalTopLevel,"is-vertical":!this.isHorizontalTopLevel,"is-nested":this.depth>0,"is-drawer":this.mode==="drawer","is-open":this.open,"is-active":this.active,"has-icon":this.icon.length>0||this.iconSlot.hasSlottedIcon()},o=n`<span class="group-label-text" part="menu-text">${this.label}</span>`,a=this.url?this.active?n`
18
- <span class="current-page" aria-current="page">${o}</span>
19
- ${this.renderToggle(n`<span class="sr-only">Toggle ${this.label}</span>`)}
20
- `:n`
17
+ </button>`}render(){const e={group:!0,"is-horizontal":this.isHorizontalTopLevel,"is-vertical":!this.isHorizontalTopLevel,"is-nested":this.depth>0,"is-drawer":this.mode==="drawer","is-open":this.open,"is-active":this.active,"has-icon":this.icon.length>0||this.iconSlot.hasSlottedIcon()},t=p`<span class="group-label-text" part="menu-text">${this.label}</span>`,r=this.url?this.active?p`
18
+ <span class="current-page" aria-current="page">${t}</span>
19
+ ${this.renderToggle(p`<span class="sr-only">Toggle ${this.label}</span>`)}
20
+ `:p`
21
21
  <a
22
22
  class="group-link"
23
23
  href=${this.url}
24
- target=${this.target||h}
25
- rel=${this.rel||h}
24
+ target=${this.target||c}
25
+ rel=${this.rel||c}
26
26
  @click=${this.handleLinkClick}
27
- >${o}${T(this.target,this.newTabLabel)}</a
27
+ >${t}${D(this.target,this.newTabLabel)}</a
28
28
  >
29
- ${this.renderToggle(n`<span class="sr-only">Toggle ${this.label}</span>`)}
30
- `:this.renderToggle(o);return n`
31
- <div class=${k(e)} @keydown=${this.handleGroupKeydown}>
29
+ ${this.renderToggle(p`<span class="sr-only">Toggle ${this.label}</span>`)}
30
+ `:this.renderToggle(t);return p`
31
+ <div class=${S(e)} @keydown=${this.handleGroupKeydown}>
32
32
  <div class="group-header" @click=${this.handleHeaderClick}>
33
- <span class="group-label">${a}</span>
33
+ <span class="group-label">${r}</span>
34
34
  <span class="group-icon" aria-hidden="true">${this.renderIcon()}</span>
35
35
  </div>
36
36
  <div
37
37
  id="group-items"
38
+ ${u(this.panel)}
38
39
  class="group-items"
40
+ popover=${this.usesScrollPanel?"manual":c}
39
41
  ?hidden=${this.isHorizontalTopLevel&&!this.open}
40
42
  ?inert=${!this.open}
41
- aria-hidden=${this.open?h:"true"}
43
+ aria-hidden=${this.open?c:"true"}
42
44
  >
43
45
  <div class="group-items-inner">
44
- <slot ${g(this.itemsSlot)} @slotchange=${this.handleSlotChange}></slot>
46
+ <slot ${u(this.itemsSlot)} @slotchange=${this.handleSlotChange}></slot>
45
47
  </div>
46
48
  </div>
47
49
  </div>
48
- `}};t.styles=[...f.styles,C,b`
50
+ `}};o.styles=[...f.styles,O,x`
49
51
  :host {
50
52
  display: block;
51
53
  position: relative;
@@ -275,6 +277,18 @@ var i=function(l,e,o,a){var p=arguments.length,s=p<3?e:a===null?a=Object.getOwnP
275
277
  box-shadow: var(--esp-menu-group-panel-shadow, 0 4px 12px var(--esp-color-shadow));
276
278
  }
277
279
 
280
+ .is-horizontal > .group-items[popover] {
281
+ position: fixed;
282
+ inset: auto;
283
+ margin: 0;
284
+ padding: 0;
285
+ box-sizing: border-box;
286
+ }
287
+
288
+ .is-horizontal > .group-items[popover]:not(:popover-open) {
289
+ display: none;
290
+ }
291
+
278
292
  .is-horizontal > .group-items[hidden] {
279
293
  display: none;
280
294
  }
@@ -290,4 +304,4 @@ var i=function(l,e,o,a){var p=arguments.length,s=p<3?e:a===null?a=Object.getOwnP
290
304
  transition: none;
291
305
  }
292
306
  }
293
- `],i([r({type:String})],t.prototype,"label",void 0),i([r({type:String})],t.prototype,"url",void 0),i([r({type:String})],t.prototype,"target",void 0),i([r({type:String})],t.prototype,"rel",void 0),i([r({type:String,attribute:"new-tab-label"})],t.prototype,"newTabLabel",void 0),i([r({type:String})],t.prototype,"icon",void 0),i([r({type:Boolean,reflect:!0})],t.prototype,"open",void 0),i([r({attribute:!1,type:String})],t.prototype,"mode",void 0),i([r({attribute:!1,type:Number})],t.prototype,"depth",void 0),i([r({attribute:!1,type:Boolean})],t.prototype,"touchDevice",void 0),i([r({attribute:"full-screen-presentation",type:Boolean,reflect:!0})],t.prototype,"fullScreenPresentation",void 0),i([w()],t.prototype,"active",void 0),i([r({type:String,attribute:"url-prefix"})],t.prototype,"urlPrefix",void 0),t=u=i([y("esp-menu-group")],t);export{t as EspalierMenuGroup};
307
+ `],i([s({type:String})],o.prototype,"label",void 0),i([s({type:String})],o.prototype,"url",void 0),i([s({type:String})],o.prototype,"target",void 0),i([s({type:String})],o.prototype,"rel",void 0),i([s({type:String,attribute:"new-tab-label"})],o.prototype,"newTabLabel",void 0),i([s({type:String})],o.prototype,"icon",void 0),i([s({type:Boolean,reflect:!0})],o.prototype,"open",void 0),i([s({attribute:!1,type:String})],o.prototype,"mode",void 0),i([s({attribute:!1,type:Number})],o.prototype,"depth",void 0),i([s({attribute:!1})],o.prototype,"scrollPanelEnabled",void 0),i([s({attribute:!1,type:Boolean})],o.prototype,"touchDevice",void 0),i([s({attribute:"full-screen-presentation",type:Boolean,reflect:!0})],o.prototype,"fullScreenPresentation",void 0),i([k()],o.prototype,"active",void 0),i([s({type:String,attribute:"url-prefix"})],o.prototype,"urlPrefix",void 0),o=g=i([P("esp-menu-group")],o);export{o as EspalierMenuGroup};
@@ -1,11 +1,19 @@
1
1
  import { type PropertyValues } from "lit";
2
2
  import { EspalierElementBase } from "../shared/esp-element-base.js";
3
+ import { type MenuItemAppearance } from "./menu-presentation.js";
4
+ import "../button/esp-button.js";
3
5
  import type { EspalierMenuMode } from "./esp-menu.js";
6
+ export type { MenuItemAppearance } from "./menu-presentation.js";
4
7
  /**
5
8
  * A navigation item for [`<esp-menu>`](/components/menu/).
6
9
  *
7
10
  * Items render as links when `url` is provided and as buttons when
8
- * no URL is present. Button-style items dispatch `esp-clicked`.
11
+ * no URL is present. URL-less action items dispatch `esp-clicked`.
12
+ * `appearance="button"` gives either kind button chrome while preserving its
13
+ * link or action semantics. Current-page links remain noninteractive.
14
+ *
15
+ * Button appearance supports esp-button's public `--esp-button-padding` token.
16
+ * Incognito padding does not apply.
9
17
  *
10
18
  * To give readers that run no JavaScript a real link, write a plain
11
19
  * `<a slot="link">` beside the attributes, with the same `href`, `target`,
@@ -32,6 +40,7 @@ import type { EspalierMenuMode } from "./esp-menu.js";
32
40
  *
33
41
  * @event {CustomEvent} esp-clicked - Fired when the item is rendered as a button (no `url`) and activated.
34
42
  *
43
+ * @csspart menu-text - The label in either appearance, including composed button labels.
35
44
  * @cssprop --esp-menu-item-color - Text color.
36
45
  * @cssprop --esp-menu-item-background - Background color.
37
46
  * @cssprop --esp-menu-item-border-color - Border color.
@@ -62,6 +71,11 @@ export declare class EspalierMenuItem extends EspalierElementBase {
62
71
  label: string;
63
72
  /** Resource to link to. When empty, the item renders as a button. */
64
73
  url: string;
74
+ /**
75
+ * Visual treatment independent of URL and header-end placement. Invalid
76
+ * values resolve to Link and normalize on the next update.
77
+ */
78
+ appearance: MenuItemAppearance;
65
79
  /** Target browsing context for the link. Empty omits the attribute. */
66
80
  target: string;
67
81
  /** Link relationship, passed through unchanged. Empty omits the attribute. */
@@ -74,6 +88,20 @@ export declare class EspalierMenuItem extends EspalierElementBase {
74
88
  newTabLabel: string;
75
89
  /** Optional icon name from the configured Espalier SVG sprite. */
76
90
  icon: string;
91
+ /**
92
+ * Prefer logical inline end before the header controls. Only direct links
93
+ * in an owning header's primary horizontal menu are promoted. Standalone,
94
+ * nested and button items remain ordinary menu content. Collapsed links
95
+ * return to the same drawer in their original source order.
96
+ * Put shared navigation tokens and context on the header or a common ancestor.
97
+ * Menu/item inline public presentation tokens and explicit typography are
98
+ * forwarded; their variables
99
+ * must resolve through that shared chain or the forwarded public tokens.
100
+ * Source-only selectors, stylesheet typography, context/intent zones and
101
+ * non-public variables local to the menu/item are not forwarded.
102
+ * @default false
103
+ */
104
+ headerEnd: boolean;
77
105
  /** Render mode supplied by the parent `esp-menu` or `esp-menu-group`. */
78
106
  mode: EspalierMenuMode;
79
107
  /** Nesting depth supplied by the parent. */
@@ -84,6 +112,8 @@ export declare class EspalierMenuItem extends EspalierElementBase {
84
112
  */
85
113
  touchDevice: boolean;
86
114
  connectedCallback(): void;
115
+ disconnectedCallback(): void;
116
+ protected willUpdate(changedProperties: PropertyValues): void;
87
117
  protected updated(changedProperties: PropertyValues): void;
88
118
  protected render(): import("lit-html").TemplateResult<1>;
89
119
  static styles: import("lit").CSSResult[];
@@ -1,15 +1,33 @@
1
- var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,a):s,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,t,a,s);else for(var h=p.length-1;h>=0;h--)(n=p[h])&&(o=(c<3?n(o):c>3?n(t,a,o):n(t,a))||o);return c>3&&o&&Object.defineProperty(t,a,o),o};import{css as m,html as l,nothing as d}from"lit";import{customElement as v,property as i,state as b}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{ref as g}from"lit/directives/ref.js";import{getIconHrefForHost as y}from"../shared/intent-values.js";import{EspalierElementBase as u}from"../shared/esp-element-base.js";import{ESP_EVENTS as w}from"../shared/events.js";import{pathsMatch as k}from"../shared/path-matching.js";import{SlottedIconController as z}from"../shared/slotted-icon-controller.js";import{renderSpriteIcon as x}from"../shared/svgs/render-sprite-icon.js";import{DEFAULT_NEW_TAB_LABEL as S,renderNewTabCue as $}from"../shared/new-tab-cue.js";import{srOnly as _}from"../shared/style-fragments.js";let e=class extends u{constructor(){super(...arguments),this.iconSlot=new z(this),this.label="",this.url="",this.target="",this.rel="",this.newTabLabel=S,this.icon="",this.mode="vertical",this.depth=0,this.touchDevice=!1,this.active=!1}connectedCallback(){super.connectedCallback(),this.checkActive()}updated(t){super.updated(t),t.has("url")&&this.checkActive()}checkActive(){if(!this.url){this.active=!1;return}this.active=k(this.url)}handleButtonClick(){this.dispatchEvent(new CustomEvent(w.CLICKED,{detail:{},bubbles:!0,composed:!0}))}render(){const t=y(this.icon,this),a=this.iconSlot.hasSlottedIcon(":scope > :not([slot]), :scope > [slot='']"),s=a||t.length>0,c={item:!0,"is-horizontal":this.mode==="horizontal"&&this.depth===0,"is-vertical":this.mode!=="horizontal"||this.depth>0,"is-drawer":this.mode==="drawer","is-nested":this.depth>0,"has-icon":s,"is-active":this.active},o=l`<span part="menu-text">${this.label}</span>`,n=l`<span class="icon-area" aria-hidden=${s?"true":d}>
2
- <slot ${g(this.iconSlot.slotRef)} @slotchange=${this.iconSlot.handleSlotChange}></slot>
3
- ${!a&&t?x(t):d}
4
- </span>`;return l`<div class=${f(c)}>
5
- ${this.active?l`<span class="current-page" aria-current="page">${o}${n}</span>`:this.url?l`<a href=${this.url} target=${this.target||d} rel=${this.rel||d}
6
- >${o}${n}${$(this.target,this.newTabLabel)}</a
7
- >`:l`<button type="button" @click=${this.handleButtonClick}>${o}${n}</button>`}
8
- </div>`}};e.styles=[...u.styles,_,m`
1
+ var o=function(d,e,r,s){var p=arguments.length,n=p<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(d,e,r,s);else for(var c=d.length-1;c>=0;c--)(i=d[c])&&(n=(p<3?i(n):p>3?i(e,r,n):i(e,r))||n);return p>3&&n&&Object.defineProperty(e,r,n),n};import{css as f,html as l,nothing as h}from"lit";import{customElement as g,property as a,state as u}from"lit/decorators.js";import{classMap as y}from"lit/directives/class-map.js";import{ref as m}from"lit/directives/ref.js";import{getIconHrefForHost as w}from"../shared/intent-values.js";import{EspalierElementBase as v}from"../shared/esp-element-base.js";import{ESP_EVENTS as k}from"../shared/events.js";import{pathsMatch as z}from"../shared/path-matching.js";import{SlottedIconController as x}from"../shared/slotted-icon-controller.js";import{renderSpriteIcon as $}from"../shared/svgs/render-sprite-icon.js";import{DEFAULT_NEW_TAB_LABEL as E,renderNewTabCue as S}from"../shared/new-tab-cue.js";import{srOnly as C}from"../shared/style-fragments.js";import{MENU_SOURCE_CHANGED as _,resolveMenuItemAppearance as b}from"./menu-presentation.js";import"../button/esp-button.js";let t=class extends v{constructor(){super(...arguments),this.iconSlot=new x(this),this.label="",this.url="",this.appearance="link",this.target="",this.rel="",this.newTabLabel=E,this.icon="",this.headerEnd=!1,this.promotedForHeader=!1,this.mode="vertical",this.depth=0,this.touchDevice=!1,this.active=!1}get headerEndPromoted(){return this.promotedForHeader}setHeaderEndPromoted(e){this.promotedForHeader=e,this.toggleAttribute("data-esp-header-end-promoted",e)}connectedCallback(){this.setHeaderEndPromoted(!1),super.connectedCallback(),this.checkActive()}disconnectedCallback(){this.setHeaderEndPromoted(!1),super.disconnectedCallback()}willUpdate(e){super.willUpdate(e),e.has("appearance")&&(this.appearance=b(this.appearance))}updated(e){super.updated(e),["label","url","target","rel","newTabLabel","icon","headerEnd","appearance"].some(r=>e.has(r))&&this.dispatchEvent(new CustomEvent(_,{bubbles:!0,composed:!0})),e.has("url")&&this.checkActive()}checkActive(){if(!this.url){this.active=!1;return}this.active=z(this.url)}handleButtonClick(){this.dispatchEvent(new CustomEvent(k.CLICKED,{detail:{},bubbles:!0,composed:!0}))}render(){const e=w(this.icon,this),r=this.iconSlot.hasSlottedIcon(":scope > :not([slot]), :scope > [slot='']"),s=r||e.length>0,p=b(this.appearance)==="button",n={item:!0,"button-appearance":p,"is-horizontal":this.mode==="horizontal"&&this.depth===0,"is-vertical":this.mode!=="horizontal"||this.depth>0,"is-drawer":this.mode==="drawer","is-nested":this.depth>0,"has-icon":s,"is-active":this.active},i=l`<span part="menu-text">${this.label}</span>`,c=l`<span class="icon-area" aria-hidden=${s?"true":h}>
2
+ <slot ${m(this.iconSlot.slotRef)} @slotchange=${this.iconSlot.handleSlotChange}></slot>
3
+ ${!r&&e?$(e):h}
4
+ </span>`;return l`<div class=${y(n)} ?hidden=${this.headerEndPromoted}>
5
+ ${p?l`<esp-button
6
+ collapsed
7
+ exportparts="label: menu-text"
8
+ .label=${this.label}
9
+ .href=${this.url}
10
+ .target=${this.target}
11
+ .rel=${this.rel}
12
+ .newTabLabel=${this.newTabLabel}
13
+ .current=${this.active}
14
+ .icon=${this.icon}
15
+ ><slot ${m(this.iconSlot.slotRef)} @slotchange=${this.iconSlot.handleSlotChange}></slot></esp-button>`:this.active?l`<span class="current-page" aria-current="page">${i}${c}</span>`:this.url?l`<a href=${this.url} target=${this.target||h} rel=${this.rel||h}
16
+ >${i}${c}${S(this.target,this.newTabLabel)}</a
17
+ >`:l`<button type="button" @click=${this.handleButtonClick}>${i}${c}</button>`}
18
+ </div>`}};t.styles=[...v.styles,C,f`
9
19
  :host {
10
20
  display: block;
11
21
  }
12
22
 
23
+ :host([data-esp-header-end-promoted]) {
24
+ display: none !important;
25
+ }
26
+
27
+ .item[hidden] {
28
+ display: none;
29
+ }
30
+
13
31
  .item {
14
32
  color: var(--esp-menu-item-color, var(--esp-color-text));
15
33
  background-color: var(--esp-menu-item-background, transparent);
@@ -28,6 +46,55 @@ var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnP
28
46
  white-space: nowrap;
29
47
  }
30
48
 
49
+ .button-appearance {
50
+ color: inherit;
51
+ background: transparent;
52
+ }
53
+
54
+ .button-appearance > esp-button {
55
+ display: inline-block;
56
+ inline-size: fit-content;
57
+ max-inline-size: 100%;
58
+ vertical-align: middle;
59
+ font: inherit;
60
+ }
61
+
62
+ .button-appearance > esp-button::part(wrapper) {
63
+ inline-size: fit-content;
64
+ max-inline-size: 100%;
65
+ }
66
+
67
+ .button-appearance > esp-button::part(wrapper),
68
+ .button-appearance > esp-button::part(control),
69
+ .button-appearance > esp-button::part(label) {
70
+ font: inherit;
71
+ letter-spacing: inherit;
72
+ word-spacing: inherit;
73
+ text-transform: inherit;
74
+ }
75
+
76
+ .button-appearance.is-horizontal {
77
+ display: flex;
78
+ align-items: center;
79
+ height: var(--esp-header-height, calc(4.5 * var(--esp-size-small)));
80
+ font-weight: var(--esp-menu-item-font-weight, var(--esp-font-weight-menu, 700));
81
+ }
82
+
83
+ .button-appearance.is-nested {
84
+ font-weight: 400;
85
+ }
86
+
87
+ .button-appearance.is-active {
88
+ font-weight: var(--esp-menu-item-active-font-weight, var(--esp-font-weight-headings));
89
+ }
90
+
91
+ .button-appearance ::slotted(svg),
92
+ .button-appearance ::slotted(img) {
93
+ height: var(--esp-menu-item-icon-size, calc(1 * var(--esp-size-font)));
94
+ width: var(--esp-menu-item-icon-size, calc(1 * var(--esp-size-font)));
95
+ object-fit: contain;
96
+ }
97
+
31
98
  a,
32
99
  button,
33
100
  .current-page {
@@ -123,21 +190,21 @@ var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnP
123
190
  padding-inline: var(--esp-menu-item-padding, var(--esp-size-padding));
124
191
  }
125
192
 
126
- .is-vertical {
193
+ .is-vertical:not(.button-appearance) {
127
194
  --_esp-surface-layer: 1;
128
195
  border-right: 1px solid var(--esp-menu-item-border-color, var(--esp-color-border));
129
196
  border-bottom: 1px solid var(--esp-menu-item-border-color, var(--esp-color-border));
130
197
  background-color: var(--esp-menu-item-background, var(--esp-color-layer-1));
131
198
  }
132
199
 
133
- .is-vertical:hover,
134
- .is-vertical:focus-within {
200
+ .is-vertical:not(.button-appearance):hover,
201
+ .is-vertical:not(.button-appearance):focus-within {
135
202
  --_esp-surface-layer: 2;
136
203
  color: var(--esp-menu-item-hover-color, var(--esp-color-headings-hover));
137
204
  background-color: var(--esp-menu-item-hover-background, var(--esp-color-layer-2));
138
205
  }
139
206
 
140
- .is-nested {
207
+ .is-nested:not(.button-appearance) {
141
208
  --_esp-surface-layer: 1;
142
209
  border-bottom: none;
143
210
  background-color: var(--esp-menu-item-background, var(--esp-color-layer-1));
@@ -149,7 +216,7 @@ var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnP
149
216
  font-weight: 400;
150
217
  }
151
218
 
152
- .is-active {
219
+ .is-active:not(.button-appearance) {
153
220
  --_esp-surface-layer: 2;
154
221
  color: var(--esp-menu-item-active-color, var(--esp-color-link));
155
222
  background-color: var(--esp-menu-item-active-background, var(--esp-color-layer-2));
@@ -161,7 +228,7 @@ var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnP
161
228
  font-weight: var(--esp-menu-item-active-font-weight, var(--esp-font-weight-headings));
162
229
  }
163
230
 
164
- .is-horizontal.is-active {
231
+ .is-horizontal.is-active:not(.button-appearance) {
165
232
  background-color: var(--esp-menu-item-active-background, transparent);
166
233
  box-shadow: inset 0 -2px 0
167
234
  var(
@@ -206,4 +273,4 @@ var r=function(p,t,a,s){var c=arguments.length,o=c<3?t:s===null?s=Object.getOwnP
206
273
  width: var(--esp-menu-item-icon-size, calc(1 * var(--esp-size-font)));
207
274
  object-fit: contain;
208
275
  }
209
- `],r([i({type:String})],e.prototype,"label",void 0),r([i({type:String})],e.prototype,"url",void 0),r([i({type:String})],e.prototype,"target",void 0),r([i({type:String})],e.prototype,"rel",void 0),r([i({type:String,attribute:"new-tab-label"})],e.prototype,"newTabLabel",void 0),r([i({type:String})],e.prototype,"icon",void 0),r([i({attribute:!1,type:String})],e.prototype,"mode",void 0),r([i({attribute:!1,type:Number})],e.prototype,"depth",void 0),r([i({attribute:!1,type:Boolean})],e.prototype,"touchDevice",void 0),r([b()],e.prototype,"active",void 0),e=r([v("esp-menu-item")],e);export{e as EspalierMenuItem};
276
+ `],o([a({type:String})],t.prototype,"label",void 0),o([a({type:String})],t.prototype,"url",void 0),o([a({type:String,reflect:!0})],t.prototype,"appearance",void 0),o([a({type:String})],t.prototype,"target",void 0),o([a({type:String})],t.prototype,"rel",void 0),o([a({type:String,attribute:"new-tab-label"})],t.prototype,"newTabLabel",void 0),o([a({type:String})],t.prototype,"icon",void 0),o([a({type:Boolean,attribute:"header-end",reflect:!0})],t.prototype,"headerEnd",void 0),o([u()],t.prototype,"promotedForHeader",void 0),o([a({attribute:!1,type:String})],t.prototype,"mode",void 0),o([a({attribute:!1,type:Number})],t.prototype,"depth",void 0),o([a({attribute:!1,type:Boolean})],t.prototype,"touchDevice",void 0),o([u()],t.prototype,"active",void 0),t=o([g("esp-menu-item")],t);export{t as EspalierMenuItem};
@@ -1,4 +1,4 @@
1
- import { type PropertyValues, type TemplateResult } from "lit";
1
+ import { type PropertyValues } from "lit";
2
2
  import { EspalierElementBase } from "../shared/esp-element-base.js";
3
3
  import { type ConfiguredBrandOptions } from "../shared/configured-brand.js";
4
4
  import "./esp-menu-item.js";
@@ -176,6 +176,7 @@ export declare class EspalierMenu extends EspalierElementBase {
176
176
  connectedCallback(): void;
177
177
  disconnectedCallback(): void;
178
178
  protected firstUpdated(props: PropertyValues): void;
179
+ protected willUpdate(changedProperties: PropertyValues): void;
179
180
  protected updated(changedProperties: PropertyValues): void;
180
181
  /**
181
182
  * Open the drawer overlay when this menu is drawer-capable.
@@ -194,7 +195,7 @@ export declare class EspalierMenu extends EspalierElementBase {
194
195
  getWidth: () => number;
195
196
  /** Called by SwipeRevealController when the drawer state changes. */
196
197
  onSwipeRevealChanged(open: boolean): void;
197
- protected render(): TemplateResult<1>;
198
+ protected render(): import("lit-html").TemplateResult<1>;
198
199
  static styles: import("lit").CSSResult[];
199
200
  }
200
201
  declare global {