@taprootio/espalier 7.3.0 → 7.6.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.
- package/CHANGELOG.md +27 -0
- package/custom-elements.json +323 -15
- package/dist/badge/esp-badge.d.ts +39 -0
- package/dist/badge/esp-badge.js +35 -6
- package/dist/box/esp-box.d.ts +4 -2
- package/dist/box/esp-box.js +6 -6
- package/dist/breadcrumbs/esp-breadcrumb.d.ts +1 -0
- package/dist/breadcrumbs/esp-breadcrumb.js +11 -3
- package/dist/breadcrumbs/esp-breadcrumbs.js +6 -6
- package/dist/button/esp-button-group.js +8 -3
- package/dist/button/esp-button.d.ts +3 -0
- package/dist/button/esp-button.js +47 -13
- package/dist/cli/theme-check.js +2 -2
- package/dist/footer/esp-footer-link-group.js +11 -8
- package/dist/footer/esp-footer.d.ts +5 -3
- package/dist/footer/esp-footer.js +25 -10
- package/dist/footer/paint-registration.js +1 -1
- package/dist/menu/paint-registration.js +1 -1
- package/dist/root/esp-root.d.ts +13 -0
- package/dist/root/esp-root.js +69 -10
- package/dist/root/helpers/compute-semantic-properties.js +1 -1
- package/dist/root/helpers/compute-theme-properties.js +1 -1
- package/dist/section/esp-section.d.ts +5 -4
- package/dist/section/esp-section.js +1 -1
- package/dist/shared/blockquote-styles.d.ts +5 -1
- package/dist/shared/blockquote-styles.js +8 -4
- package/dist/shared/color-engine.js +1 -1
- package/dist/shared/component-property-compiler.js +1 -1
- package/dist/shared/component-property-diagnostics.js +1 -1
- package/dist/shared/component-property-normalizer.js +1 -1
- package/dist/shared/esp-element-base.js +2 -2
- package/dist/shared/footer-ink-styles.js +18 -0
- package/dist/shared/footer-ink.js +1 -0
- package/dist/shared/paint-catalog.js +1 -1
- package/dist/shared/paint-fit.js +1 -1
- package/dist/shared/paint-types.d.ts +9 -0
- package/dist/shared/public-token-catalog.generated.js +1 -1
- package/dist/shared/scale-engine.js +1 -1
- package/dist/shared/semantic-color-names.js +1 -1
- package/dist/shared/settable-component-properties.js +1 -1
- package/dist/shared/theme-fit-report.d.ts +6 -4
- package/dist/shared/theme-fit-report.js +1 -1
- package/dist/testing/observe-paint.iife.js +2 -2
- package/dist/testing/observe-paint.js +3 -3
- package/espalier.css-data.json +139 -7
- package/espalier.token-manifest.json +1038 -62
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var n=function(
|
|
1
|
+
var n=function(o,e,r,a){var s=arguments.length,l=s<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(o,e,r,a);else for(var g=o.length-1;g>=0;g--)(p=o[g])&&(l=(s<3?p(l):s>3?p(e,r,l):p(e,r))||l);return s>3&&l&&Object.defineProperty(e,r,l),l};import{FooterAlignmentController as m,footerAlignmentStyles as k,footerAlignmentHostStyles as v}from"../shared/footer-alignment.js";import{css as b,html as d,nothing as c}from"lit";import{customElement as x,property as i}from"lit/decorators.js";import{footerHeadingFit as A,footerLinkFit as f}from"../shared/footer-ink-styles.js";import{EspalierElementBase as u}from"../shared/esp-element-base.js";const h="esp-footer-link-group-heading";let t=class extends u{constructor(){super(...arguments),this.alignment=new m(this,"group"),this.heading=""}get inlineAlign(){return this.alignment.get("inline-align")}set inlineAlign(e){this.alignment.set("inlineAlign","inline-align",e,"placement")}get inlineAlignWrapped(){return this.alignment.get("inline-align-wrapped")}set inlineAlignWrapped(e){this.alignment.set("inlineAlignWrapped","inline-align-wrapped",e,"placement")}get inlineAlignStacked(){return this.alignment.get("inline-align-stacked")}set inlineAlignStacked(e){this.alignment.set("inlineAlignStacked","inline-align-stacked",e,"placement")}get blockAlign(){return this.alignment.get("block-align")}set blockAlign(e){this.alignment.set("blockAlign","block-align",e,"placement")}get blockAlignWrapped(){return this.alignment.get("block-align-wrapped")}set blockAlignWrapped(e){this.alignment.set("blockAlignWrapped","block-align-wrapped",e,"placement")}get blockAlignStacked(){return this.alignment.get("block-align-stacked")}set blockAlignStacked(e){this.alignment.set("blockAlignStacked","block-align-stacked",e,"placement")}get textAlign(){return this.alignment.get("text-align")}set textAlign(e){this.alignment.set("textAlign","text-align",e,"text")}get textAlignWrapped(){return this.alignment.get("text-align-wrapped")}set textAlignWrapped(e){this.alignment.set("textAlignWrapped","text-align-wrapped",e,"text")}get textAlignStacked(){return this.alignment.get("text-align-stacked")}set textAlignStacked(e){this.alignment.set("textAlignStacked","text-align-stacked",e,"text")}render(){return d`
|
|
2
2
|
<div class="alignment-scope">
|
|
3
3
|
<nav
|
|
4
4
|
class="alignment-content"
|
|
5
5
|
part="nav"
|
|
6
|
-
aria-labelledby=${this.heading?
|
|
6
|
+
aria-labelledby=${this.heading?h:c}
|
|
7
7
|
aria-label=${this.heading?c:"Footer links"}
|
|
8
8
|
>
|
|
9
|
-
${this.heading?d`<h2 part="heading" id=${
|
|
9
|
+
${this.heading?d`<h2 part="heading" id=${h}>${this.heading}</h2>`:c}
|
|
10
10
|
<div part="links" class="links"><slot></slot></div>
|
|
11
11
|
</nav>
|
|
12
12
|
</div>
|
|
13
|
-
`}};t.styles=[...
|
|
13
|
+
`}};t.styles=[...u.styles,k,v,b`
|
|
14
14
|
:host {
|
|
15
15
|
display: block;
|
|
16
16
|
min-inline-size: 0;
|
|
@@ -33,8 +33,9 @@ var n=function(a,e,r,o){var s=arguments.length,l=s<3?e:o===null?o=Object.getOwnP
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
h2 {
|
|
36
|
+
${A}
|
|
36
37
|
margin: 0;
|
|
37
|
-
color: var(--esp-footer-heading-color, var(--esp-color-headings));
|
|
38
|
+
color: var(--esp-footer-heading-color, var(--_esp-footer-local-fitted-heading-color, var(--esp-color-headings)));
|
|
38
39
|
font-family: var(
|
|
39
40
|
--_esp-font-headings-effective,
|
|
40
41
|
var(
|
|
@@ -56,10 +57,11 @@ var n=function(a,e,r,o){var s=arguments.length,l=s<3?e:o===null?o=Object.getOwnP
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
::slotted(a) {
|
|
60
|
+
${f}
|
|
59
61
|
text-align: var(--_esp-footer-text-css, inherit);
|
|
60
62
|
inline-size: fit-content;
|
|
61
63
|
max-inline-size: 100%;
|
|
62
|
-
color: var(--esp-footer-link-color, var(--esp-color-link));
|
|
64
|
+
color: var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)));
|
|
63
65
|
overflow-wrap: anywhere;
|
|
64
66
|
text-decoration: none;
|
|
65
67
|
text-underline-offset: 0.18em;
|
|
@@ -71,11 +73,12 @@ var n=function(a,e,r,o){var s=arguments.length,l=s<3?e:o===null?o=Object.getOwnP
|
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
::slotted(a:focus-visible) {
|
|
76
|
+
${f}
|
|
74
77
|
border-radius: var(--esp-size-border-radius);
|
|
75
78
|
outline: var(
|
|
76
79
|
--esp-footer-focus-outline,
|
|
77
|
-
2px solid var(--esp-footer-link-color, var(--esp-color-link))
|
|
80
|
+
2px solid var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)))
|
|
78
81
|
);
|
|
79
82
|
outline-offset: 3px;
|
|
80
83
|
}
|
|
81
|
-
`],n([i({attribute:"inline-align",reflect:!0})],t.prototype,"inlineAlign",null),n([i({attribute:"inline-align-wrapped",reflect:!0})],t.prototype,"inlineAlignWrapped",null),n([i({attribute:"inline-align-stacked",reflect:!0})],t.prototype,"inlineAlignStacked",null),n([i({attribute:"block-align",reflect:!0})],t.prototype,"blockAlign",null),n([i({attribute:"block-align-wrapped",reflect:!0})],t.prototype,"blockAlignWrapped",null),n([i({attribute:"block-align-stacked",reflect:!0})],t.prototype,"blockAlignStacked",null),n([i({attribute:"text-align",reflect:!0})],t.prototype,"textAlign",null),n([i({attribute:"text-align-wrapped",reflect:!0})],t.prototype,"textAlignWrapped",null),n([i({attribute:"text-align-stacked",reflect:!0})],t.prototype,"textAlignStacked",null),n([i({type:String})],t.prototype,"heading",void 0),t=n([
|
|
84
|
+
`],n([i({attribute:"inline-align",reflect:!0})],t.prototype,"inlineAlign",null),n([i({attribute:"inline-align-wrapped",reflect:!0})],t.prototype,"inlineAlignWrapped",null),n([i({attribute:"inline-align-stacked",reflect:!0})],t.prototype,"inlineAlignStacked",null),n([i({attribute:"block-align",reflect:!0})],t.prototype,"blockAlign",null),n([i({attribute:"block-align-wrapped",reflect:!0})],t.prototype,"blockAlignWrapped",null),n([i({attribute:"block-align-stacked",reflect:!0})],t.prototype,"blockAlignStacked",null),n([i({attribute:"text-align",reflect:!0})],t.prototype,"textAlign",null),n([i({attribute:"text-align-wrapped",reflect:!0})],t.prototype,"textAlignWrapped",null),n([i({attribute:"text-align-stacked",reflect:!0})],t.prototype,"textAlignStacked",null),n([i({type:String})],t.prototype,"heading",void 0),t=n([x("esp-footer-link-group")],t);export{t as EspalierFooterLinkGroup};
|
|
@@ -213,16 +213,18 @@ import "./esp-footer-link-group.js";
|
|
|
213
213
|
* @csspart bottom - The final legal/utility region.
|
|
214
214
|
* @cssprop --esp-footer-background - Base footer color. Defaults to `var(--esp-color-layer-2)`.
|
|
215
215
|
* @cssprop --esp-footer-color - Body text color. Defaults to `var(--esp-color-text)`.
|
|
216
|
-
* @cssprop --esp-footer-heading-color - Heading and configured-brand color.
|
|
216
|
+
* @cssprop --esp-footer-heading-color - Heading and configured-brand color. The theme fits its headings color to the default footer surface.
|
|
217
217
|
* @cssprop --esp-footer-heading-size - Size step for link-group headings and slotted `h2` headings: `small`, `normal`, `medium`, `big`, or `large`. Defaults to `normal`.
|
|
218
218
|
* @cssprop --esp-footer-heading-font-size - Font size derived from the authored heading step. Defaults to `var(--esp-type-normal)`.
|
|
219
|
-
* @cssprop --esp-footer-link-color - Link color.
|
|
219
|
+
* @cssprop --esp-footer-link-color - Link color. The theme fits its link color to the default footer surface.
|
|
220
220
|
* @cssprop --esp-footer-link-decoration - Resting decoration of bare footer links and the configured brand link: `none` or `underline`. Bare links default to `underline` and the brand defaults to `none`. All supported links underline on hover.
|
|
221
221
|
* @cssprop --esp-footer-link-underline-offset - Underline offset of supported links, from `0em` to `0.5em`. Defaults to `0.18em` for group links and brand hover, and `auto` elsewhere.
|
|
222
222
|
* @cssprop --esp-footer-link-underline-thickness - Underline thickness of supported links, from `0em` to `0.2em` or `auto`. Defaults to `auto`.
|
|
223
223
|
* @cssprop --esp-footer-link-hover-color - Hovered link color. Defaults to `var(--esp-color-link-hover)`.
|
|
224
224
|
* @cssprop --esp-footer-link-hover-bg - Hovered link background. Defaults to `var(--esp-color-link-hover-bg)`.
|
|
225
|
-
* @cssprop --esp-footer-
|
|
225
|
+
* @cssprop --esp-footer-brand-hover-background - Hovered configured-brand background. Defaults to `--esp-footer-link-hover-bg`, so other footer links are unaffected.
|
|
226
|
+
* @cssprop --esp-footer-brand-hover-transform - Hovered configured-brand transform, animated like the header brand and dropped under reduced motion. Defaults to `none`. A hook, not a settable property: Taproot drives it from its footer `brandHoverGrow` setting, like the header hook.
|
|
227
|
+
* @cssprop --esp-footer-focus-outline - Focus-visible outline for footer links. Defaults to a 2px solid outline in the footer link color.
|
|
226
228
|
* @cssprop --esp-footer-border - Block-start footer border. Defaults to `1px solid var(--esp-color-border)`.
|
|
227
229
|
* @cssprop --esp-footer-padding-block - Content block padding. Defaults to `var(--esp-size-padding-page)`.
|
|
228
230
|
* @cssprop --esp-footer-padding-inline - Content inline padding. Defaults to `var(--esp-size-padding-page)`.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,a):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(p,e,a,r);else for(var d=p.length-1;d>=0;d--)(s=p[d])&&(l=(o<3?s(l):o>3?s(e,a,l):s(e,a))||l);return o>3&&l&&Object.defineProperty(e,a,l),l};import{FooterAlignmentController as h,footerAlignmentStyles as k}from"../shared/footer-alignment.js";import{FooterLogoGeometryController as x,footerNaturalLogoStyles as
|
|
1
|
+
var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,a):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(p,e,a,r);else for(var d=p.length-1;d>=0;d--)(s=p[d])&&(l=(o<3?s(l):o>3?s(e,a,l):s(e,a))||l);return o>3&&l&&Object.defineProperty(e,a,l),l};import{FooterAlignmentController as h,footerAlignmentStyles as k}from"../shared/footer-alignment.js";import{FooterLogoGeometryController as x,footerNaturalLogoStyles as v,normalizeFooterLogoSizing as A}from"../shared/footer-logo-geometry.js";import{footerHeadingFit as y,footerInkLayerStyles as S,footerLinkFit as w}from"../shared/footer-ink-styles.js";import{paintedSurface as B}from"../shared/surface-layer.js";import{css as _,html as z,nothing as T}from"lit";import{customElement as W,property as i,state as I}from"lit/decorators.js";import{styleMap as g}from"lit/directives/style-map.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as L,configuredBrandLogoGeometry as C,renderConfiguredBrand as $,resolveConfiguredBrand as O}from"../shared/configured-brand.js";import{syncNormalizedAttribute as c}from"../shared/attribute-helpers.js";import{EspalierElementBase as b}from"../shared/esp-element-base.js";import{slotHasContent as m}from"../shared/slot-content.js";import{renderVisualOverlay as N,visualOverlayStyles as E}from"../shared/visual-overlay.js";import"./esp-footer-column.js";import"./esp-footer-link-group.js";const u={media:!1,brand:!1,groups:!1,aside:!1,bottom:!1};let t=class extends b{get layout(){return this.alignment.layout}constructor(){super(),this.alignment=new h(this,"footer"),this.brandLogoSizingBacker="fixed",this.slotContent={...u},this.brandText="",this.brandLogo="",this.lightBrandLogo="",this.darkBrandLogo="",this.brandHref="",this.brandAlt="",this.brandColor="",this.lightBrandColor="",this.darkBrandColor="",this.brandSpanBacker=1,this.asideSpanBacker=1,this.fullBleedContent=!1,this.landmarkLabel="",this.handleSlotChange=e=>{if(!(e.target instanceof HTMLSlotElement))return;const a=this.slotRegion(e.target);if(!a)return;const r=m(e.target);this.slotContent[a]!==r&&(this.slotContent={...this.slotContent,[a]:r})},new x(this,()=>({sizing:this.brandLogoSizing,scheme:this.scheme,lightSource:this.lightBrandLogo||this.brandLogo,darkSource:this.darkBrandLogo||this.brandLogo}))}get inlineAlign(){return this.alignment.get("inline-align")}set inlineAlign(e){this.alignment.set("inlineAlign","inline-align",e,"placement")}get inlineAlignWrapped(){return this.alignment.get("inline-align-wrapped")}set inlineAlignWrapped(e){this.alignment.set("inlineAlignWrapped","inline-align-wrapped",e,"placement")}get inlineAlignStacked(){return this.alignment.get("inline-align-stacked")}set inlineAlignStacked(e){this.alignment.set("inlineAlignStacked","inline-align-stacked",e,"placement")}get blockAlign(){return this.alignment.get("block-align")}set blockAlign(e){this.alignment.set("blockAlign","block-align",e,"placement")}get blockAlignWrapped(){return this.alignment.get("block-align-wrapped")}set blockAlignWrapped(e){this.alignment.set("blockAlignWrapped","block-align-wrapped",e,"placement")}get blockAlignStacked(){return this.alignment.get("block-align-stacked")}set blockAlignStacked(e){this.alignment.set("blockAlignStacked","block-align-stacked",e,"placement")}get textAlign(){return this.alignment.get("text-align")}set textAlign(e){this.alignment.set("textAlign","text-align",e,"text")}get textAlignWrapped(){return this.alignment.get("text-align-wrapped")}set textAlignWrapped(e){this.alignment.set("textAlignWrapped","text-align-wrapped",e,"text")}get textAlignStacked(){return this.alignment.get("text-align-stacked")}set textAlignStacked(e){this.alignment.set("textAlignStacked","text-align-stacked",e,"text")}get brandInlineAlign(){return this.alignment.get("brand-inline-align")}set brandInlineAlign(e){this.alignment.set("brandInlineAlign","brand-inline-align",e,"placement")}get brandInlineAlignWrapped(){return this.alignment.get("brand-inline-align-wrapped")}set brandInlineAlignWrapped(e){this.alignment.set("brandInlineAlignWrapped","brand-inline-align-wrapped",e,"placement")}get brandInlineAlignStacked(){return this.alignment.get("brand-inline-align-stacked")}set brandInlineAlignStacked(e){this.alignment.set("brandInlineAlignStacked","brand-inline-align-stacked",e,"placement")}get brandBlockAlign(){return this.alignment.get("brand-block-align")}set brandBlockAlign(e){this.alignment.set("brandBlockAlign","brand-block-align",e,"placement")}get brandBlockAlignWrapped(){return this.alignment.get("brand-block-align-wrapped")}set brandBlockAlignWrapped(e){this.alignment.set("brandBlockAlignWrapped","brand-block-align-wrapped",e,"placement")}get brandBlockAlignStacked(){return this.alignment.get("brand-block-align-stacked")}set brandBlockAlignStacked(e){this.alignment.set("brandBlockAlignStacked","brand-block-align-stacked",e,"placement")}get brandTextAlign(){return this.alignment.get("brand-text-align")}set brandTextAlign(e){this.alignment.set("brandTextAlign","brand-text-align",e,"text")}get brandTextAlignWrapped(){return this.alignment.get("brand-text-align-wrapped")}set brandTextAlignWrapped(e){this.alignment.set("brandTextAlignWrapped","brand-text-align-wrapped",e,"text")}get brandTextAlignStacked(){return this.alignment.get("brand-text-align-stacked")}set brandTextAlignStacked(e){this.alignment.set("brandTextAlignStacked","brand-text-align-stacked",e,"text")}get asideInlineAlign(){return this.alignment.get("aside-inline-align")}set asideInlineAlign(e){this.alignment.set("asideInlineAlign","aside-inline-align",e,"placement")}get asideInlineAlignWrapped(){return this.alignment.get("aside-inline-align-wrapped")}set asideInlineAlignWrapped(e){this.alignment.set("asideInlineAlignWrapped","aside-inline-align-wrapped",e,"placement")}get asideInlineAlignStacked(){return this.alignment.get("aside-inline-align-stacked")}set asideInlineAlignStacked(e){this.alignment.set("asideInlineAlignStacked","aside-inline-align-stacked",e,"placement")}get asideBlockAlign(){return this.alignment.get("aside-block-align")}set asideBlockAlign(e){this.alignment.set("asideBlockAlign","aside-block-align",e,"placement")}get asideBlockAlignWrapped(){return this.alignment.get("aside-block-align-wrapped")}set asideBlockAlignWrapped(e){this.alignment.set("asideBlockAlignWrapped","aside-block-align-wrapped",e,"placement")}get asideBlockAlignStacked(){return this.alignment.get("aside-block-align-stacked")}set asideBlockAlignStacked(e){this.alignment.set("asideBlockAlignStacked","aside-block-align-stacked",e,"placement")}get asideTextAlign(){return this.alignment.get("aside-text-align")}set asideTextAlign(e){this.alignment.set("asideTextAlign","aside-text-align",e,"text")}get asideTextAlignWrapped(){return this.alignment.get("aside-text-align-wrapped")}set asideTextAlignWrapped(e){this.alignment.set("asideTextAlignWrapped","aside-text-align-wrapped",e,"text")}get asideTextAlignStacked(){return this.alignment.get("aside-text-align-stacked")}set asideTextAlignStacked(e){this.alignment.set("asideTextAlignStacked","aside-text-align-stacked",e,"text")}get bottomInlineAlign(){return this.alignment.get("bottom-inline-align")}set bottomInlineAlign(e){this.alignment.set("bottomInlineAlign","bottom-inline-align",e,"placement")}get bottomInlineAlignWrapped(){return this.alignment.get("bottom-inline-align-wrapped")}set bottomInlineAlignWrapped(e){this.alignment.set("bottomInlineAlignWrapped","bottom-inline-align-wrapped",e,"placement")}get bottomInlineAlignStacked(){return this.alignment.get("bottom-inline-align-stacked")}set bottomInlineAlignStacked(e){this.alignment.set("bottomInlineAlignStacked","bottom-inline-align-stacked",e,"placement")}get bottomTextAlign(){return this.alignment.get("bottom-text-align")}set bottomTextAlign(e){this.alignment.set("bottomTextAlign","bottom-text-align",e,"text")}get bottomTextAlignWrapped(){return this.alignment.get("bottom-text-align-wrapped")}set bottomTextAlignWrapped(e){this.alignment.set("bottomTextAlignWrapped","bottom-text-align-wrapped",e,"text")}get bottomTextAlignStacked(){return this.alignment.get("bottom-text-align-stacked")}set bottomTextAlignStacked(e){this.alignment.set("bottomTextAlignStacked","bottom-text-align-stacked",e,"text")}get brandLogoSizing(){return this.brandLogoSizingBacker}set brandLogoSizing(e){const a=this.brandLogoSizingBacker;this.brandLogoSizingBacker=A(e),this.requestUpdate("brandLogoSizing",this.hasAttribute("brand-logo-sizing")?a:void 0),c(this,"brand-logo-sizing",this.brandLogoSizingBacker)}get brandSpan(){return this.brandSpanBacker}set brandSpan(e){const a=this.brandSpanBacker;this.brandSpanBacker=Number.isInteger(e)&&e>=1&&e<=3?e:1,this.requestUpdate("brandSpan",this.hasAttribute("brand-span")?a:void 0),c(this,"brand-span",String(this.brandSpanBacker))}get asideSpan(){return this.asideSpanBacker}set asideSpan(e){const a=this.asideSpanBacker;this.asideSpanBacker=Number.isInteger(e)&&e>=1&&e<=2?e:1,this.requestUpdate("asideSpan",this.hasAttribute("aside-span")?a:void 0),c(this,"aside-span",String(this.asideSpanBacker))}slotRegion(e){return e.name?["media","brand","aside","bottom"].includes(e.name)?e.name:null:"groups"}firstUpdated(e){super.firstUpdated(e);const a={...u};for(const r of this.shadowRoot?.querySelectorAll("slot")??[]){const o=this.slotRegion(r);o&&(a[o]=m(r))}Object.entries(a).some(([r,o])=>this.slotContent[r]!==o)&&(this.slotContent=a)}render(){const{media:e,brand:a,groups:r,aside:o,bottom:l}=this.slotContent,s=O({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor}),d=a||!!(s.brandLogo||this.brandText),f=d||r||o;return z`
|
|
2
2
|
<footer
|
|
3
3
|
part="footer"
|
|
4
|
-
aria-label=${this.landmarkLabel||
|
|
4
|
+
aria-label=${this.landmarkLabel||T}
|
|
5
5
|
style=${g({"--_esp-footer-brand-color":s.brandColor||null})}
|
|
6
6
|
>
|
|
7
|
-
${
|
|
7
|
+
${N({className:"background",rootPart:"background"})}
|
|
8
8
|
<div part="content" class="content-frame">
|
|
9
9
|
<div class="content">
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
22
22
|
>
|
|
23
23
|
<div class="alignment-content">
|
|
24
24
|
<slot name="brand" @slotchange=${this.handleSlotChange}
|
|
25
|
-
>${
|
|
25
|
+
>${$({brandLogo:s.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt})}</slot
|
|
26
26
|
>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
@@ -54,7 +54,7 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</footer>
|
|
57
|
-
`}};t.styles=[...b.styles,
|
|
57
|
+
`}};t.styles=[...b.styles,B(2),S,C,k,v,_`
|
|
58
58
|
:host {
|
|
59
59
|
display: block;
|
|
60
60
|
min-inline-size: 0;
|
|
@@ -201,6 +201,7 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
.configured-brand {
|
|
204
|
+
${y}
|
|
204
205
|
|
|
205
206
|
display: var(--_esp-footer-lockup-display, inline-flex);
|
|
206
207
|
align-items: var(--_esp-footer-lockup-block, center);
|
|
@@ -208,7 +209,7 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
208
209
|
max-inline-size: 100%;
|
|
209
210
|
color: var(
|
|
210
211
|
--_esp-footer-brand-color,
|
|
211
|
-
var(--esp-footer-heading-color, var(--esp-color-headings))
|
|
212
|
+
var(--esp-footer-heading-color, var(--_esp-footer-local-fitted-heading-color, var(--esp-color-headings)))
|
|
212
213
|
);
|
|
213
214
|
font-family: var(
|
|
214
215
|
--_esp-font-brand-effective,
|
|
@@ -234,23 +235,29 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
a.configured-brand {
|
|
238
|
+
transition: transform 0.24s ease;
|
|
237
239
|
text-decoration-line: var(--esp-footer-link-decoration, none);
|
|
238
240
|
text-underline-offset: var(--esp-footer-link-underline-offset, auto);
|
|
239
241
|
text-decoration-thickness: var(--esp-footer-link-underline-thickness, auto);
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
a.configured-brand:hover {
|
|
243
|
-
background: var(
|
|
245
|
+
background: var(
|
|
246
|
+
--esp-footer-brand-hover-background,
|
|
247
|
+
var(--esp-footer-link-hover-bg, var(--esp-color-link-hover-bg))
|
|
248
|
+
);
|
|
249
|
+
transform: var(--esp-footer-brand-hover-transform, none);
|
|
244
250
|
color: var(--esp-footer-link-hover-color, var(--esp-color-link-hover));
|
|
245
251
|
text-decoration-line: underline;
|
|
246
252
|
text-underline-offset: var(--esp-footer-link-underline-offset, 0.18em);
|
|
247
253
|
}
|
|
248
254
|
|
|
249
255
|
a.configured-brand:focus-visible {
|
|
256
|
+
${w}
|
|
250
257
|
border-radius: var(--esp-size-border-radius);
|
|
251
258
|
outline: var(
|
|
252
259
|
--esp-footer-focus-outline,
|
|
253
|
-
2px solid var(--esp-footer-link-color, var(--esp-color-link))
|
|
260
|
+
2px solid var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)))
|
|
254
261
|
);
|
|
255
262
|
outline-offset: 3px;
|
|
256
263
|
}
|
|
@@ -258,7 +265,7 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
258
265
|
.brand-logo {
|
|
259
266
|
|
|
260
267
|
aspect-ratio: auto
|
|
261
|
-
var(--esp-footer-brand-logo-aspect-ratio, ${
|
|
268
|
+
var(--esp-footer-brand-logo-aspect-ratio, ${L});
|
|
262
269
|
display: block;
|
|
263
270
|
inline-size: auto;
|
|
264
271
|
|
|
@@ -274,6 +281,14 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
274
281
|
min-inline-size: 0;
|
|
275
282
|
}
|
|
276
283
|
|
|
284
|
+
@media (prefers-reduced-motion: reduce) {
|
|
285
|
+
a.configured-brand,
|
|
286
|
+
a.configured-brand:hover {
|
|
287
|
+
transition: none;
|
|
288
|
+
transform: none;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
277
292
|
@container esp-footer (max-width: 64rem) {
|
|
278
293
|
.footer-alignment-profile-probe {
|
|
279
294
|
inline-size: 1px;
|
|
@@ -316,4 +331,4 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
316
331
|
);
|
|
317
332
|
}
|
|
318
333
|
}
|
|
319
|
-
|
|
334
|
+
`,E],n([i({attribute:"inline-align",reflect:!0})],t.prototype,"inlineAlign",null),n([i({attribute:"inline-align-wrapped",reflect:!0})],t.prototype,"inlineAlignWrapped",null),n([i({attribute:"inline-align-stacked",reflect:!0})],t.prototype,"inlineAlignStacked",null),n([i({attribute:"block-align",reflect:!0})],t.prototype,"blockAlign",null),n([i({attribute:"block-align-wrapped",reflect:!0})],t.prototype,"blockAlignWrapped",null),n([i({attribute:"block-align-stacked",reflect:!0})],t.prototype,"blockAlignStacked",null),n([i({attribute:"text-align",reflect:!0})],t.prototype,"textAlign",null),n([i({attribute:"text-align-wrapped",reflect:!0})],t.prototype,"textAlignWrapped",null),n([i({attribute:"text-align-stacked",reflect:!0})],t.prototype,"textAlignStacked",null),n([i({attribute:"brand-inline-align",reflect:!0})],t.prototype,"brandInlineAlign",null),n([i({attribute:"brand-inline-align-wrapped",reflect:!0})],t.prototype,"brandInlineAlignWrapped",null),n([i({attribute:"brand-inline-align-stacked",reflect:!0})],t.prototype,"brandInlineAlignStacked",null),n([i({attribute:"brand-block-align",reflect:!0})],t.prototype,"brandBlockAlign",null),n([i({attribute:"brand-block-align-wrapped",reflect:!0})],t.prototype,"brandBlockAlignWrapped",null),n([i({attribute:"brand-block-align-stacked",reflect:!0})],t.prototype,"brandBlockAlignStacked",null),n([i({attribute:"brand-text-align",reflect:!0})],t.prototype,"brandTextAlign",null),n([i({attribute:"brand-text-align-wrapped",reflect:!0})],t.prototype,"brandTextAlignWrapped",null),n([i({attribute:"brand-text-align-stacked",reflect:!0})],t.prototype,"brandTextAlignStacked",null),n([i({attribute:"aside-inline-align",reflect:!0})],t.prototype,"asideInlineAlign",null),n([i({attribute:"aside-inline-align-wrapped",reflect:!0})],t.prototype,"asideInlineAlignWrapped",null),n([i({attribute:"aside-inline-align-stacked",reflect:!0})],t.prototype,"asideInlineAlignStacked",null),n([i({attribute:"aside-block-align",reflect:!0})],t.prototype,"asideBlockAlign",null),n([i({attribute:"aside-block-align-wrapped",reflect:!0})],t.prototype,"asideBlockAlignWrapped",null),n([i({attribute:"aside-block-align-stacked",reflect:!0})],t.prototype,"asideBlockAlignStacked",null),n([i({attribute:"aside-text-align",reflect:!0})],t.prototype,"asideTextAlign",null),n([i({attribute:"aside-text-align-wrapped",reflect:!0})],t.prototype,"asideTextAlignWrapped",null),n([i({attribute:"aside-text-align-stacked",reflect:!0})],t.prototype,"asideTextAlignStacked",null),n([i({attribute:"bottom-inline-align",reflect:!0})],t.prototype,"bottomInlineAlign",null),n([i({attribute:"bottom-inline-align-wrapped",reflect:!0})],t.prototype,"bottomInlineAlignWrapped",null),n([i({attribute:"bottom-inline-align-stacked",reflect:!0})],t.prototype,"bottomInlineAlignStacked",null),n([i({attribute:"bottom-text-align",reflect:!0})],t.prototype,"bottomTextAlign",null),n([i({attribute:"bottom-text-align-wrapped",reflect:!0})],t.prototype,"bottomTextAlignWrapped",null),n([i({attribute:"bottom-text-align-stacked",reflect:!0})],t.prototype,"bottomTextAlignStacked",null),n([i({attribute:"brand-logo-sizing",reflect:!0,useDefault:!0})],t.prototype,"brandLogoSizing",null),n([I()],t.prototype,"slotContent",void 0),n([i({attribute:"brand-text",type:String})],t.prototype,"brandText",void 0),n([i({attribute:"brand-logo",type:String})],t.prototype,"brandLogo",void 0),n([i({attribute:"light-brand-logo",type:String})],t.prototype,"lightBrandLogo",void 0),n([i({attribute:"dark-brand-logo",type:String})],t.prototype,"darkBrandLogo",void 0),n([i({attribute:"brand-href",type:String})],t.prototype,"brandHref",void 0),n([i({attribute:"brand-alt",type:String})],t.prototype,"brandAlt",void 0),n([i({attribute:"brand-color",type:String})],t.prototype,"brandColor",void 0),n([i({attribute:"light-brand-color",type:String})],t.prototype,"lightBrandColor",void 0),n([i({attribute:"dark-brand-color",type:String})],t.prototype,"darkBrandColor",void 0),n([i({attribute:"brand-span",type:Number,reflect:!0})],t.prototype,"brandSpan",null),n([i({attribute:"aside-span",type:Number,reflect:!0})],t.prototype,"asideSpan",null),n([i({attribute:"full-bleed-content",type:Boolean,reflect:!0})],t.prototype,"fullBleedContent",void 0),n([i({attribute:"landmark-label",type:String})],t.prototype,"landmarkLabel",void 0),t=n([W("esp-footer")],t);export{t as EspalierFooter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PAINT_INTERACTIONS as
|
|
1
|
+
import{PAINT_INTERACTIONS as p,closestPaintElement as i,configuredBrandColor as T,isPaintFocus as N,isPaintHover as E}from"../menu/navigation-paint.js";import{FOOTER_HEADING_INK as l,FOOTER_INK_PROPERTIES as b,FOOTER_LINK_INK as s,FOOTER_INK_MODE as k}from"../shared/footer-ink.js";import{parsePaintColor as f}from"../shared/paint-color.js";import{TOKEN_PAIRINGS as c}from"../shared/token-pairings.js";const h={foregroundDerivations:[l],foregroundAliases:["headings"]},m={foregroundDerivations:[s],foregroundAliases:["link"]},O=({element:e,source:o})=>{const n=i(e,".brand .configured-brand");if(!(!n||!i(n,"esp-footer"))){if(o==="outline"&&e===n&&n.matches("a[href]"))return{element:"brand-link",owner:n,...m};if(o==="text"&&i(e,".brand-text"))return{element:"brand-text",owner:n,...n.matches("a[href]")?{}:{state:()=>"rest"},...n.matches("a[href]:hover")?v(u):{},...n.matches("a[href]:hover")?{}:{brandColor:T(n,"--_esp-footer-brand-color"),...h}}}};function I(e){const o=e.ownerDocument,n=o.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=o.createRange();for(let t=n.nextNode();t;t=n.nextNode()){const a=t.parentElement;if(!(!a||!t.textContent?.trim()||a.closest("svg, [hidden], .sr-only"))&&o.defaultView?.getComputedStyle(a).visibility==="visible"&&(r.selectNodeContents(t),Array.from(r.getClientRects()).some(({width:d,height:x})=>d>0&&x>0)))return!0}return!1}const R=({element:e,source:o})=>{if(!i(e,"esp-footer")||i(e,"esp-button"))return;const n=i(e,"a[href]");if(n&&!n.classList.contains("configured-brand")&&(o==="text"||o==="outline"&&e===n&&I(n)))return{element:"footer-link",owner:n,...o==="outline"||!n.matches(":hover")?m:{},...o==="text"&&n.matches(":hover")?v(g):{}};if(o!=="text")return;const r=i(e,"h1, h2, h3, h4, h5, h6");if(r)return{element:"footer-heading",owner:r,state:()=>"rest",...h};if(i(e,".aside, .bottom, esp-footer-link-group"))return{element:"footer-body",owner:e,state:()=>"rest"}},g="footer-link-hover-background",u="footer-brand-hover-background",v=e=>({backgroundDerivations:[e],backgroundAliases:[c.linkHover.bg]}),C={derivations:{[g]:({readProperty:e,readColor:o})=>f(e("--esp-footer-link-hover-bg")??o(c.linkHover.bg)??""),[u]:({readProperty:e,readColor:o})=>f(e("--esp-footer-brand-hover-background")??e("--esp-footer-link-hover-bg")??o(c.linkHover.bg)??""),[l]:({readProperty:e,readColor:o})=>f(e("--esp-footer-heading-color")??(e(k)==="semantic"?void 0:e(b.headings))??o("headings")??""),[s]:({readProperty:e,readColor:o})=>f(e("--esp-footer-link-color")??(e(k)==="semantic"?void 0:e(b.link))??o("link")??"")},entriesByRole:{footer:[{element:"footer-heading",foreground:l,background:"layer2",state:"rest",kind:"text",flags:["footerHeadings"]},{element:"footer-body",foreground:"text",background:"layer2",state:"rest",kind:"text",flags:["footerBody"]},...p.flatMap(e=>{const o=E(e),n=N(e),r={foreground:o?"linkHover":s,background:o?g:"layer2",state:e,kind:"text"},t=[{...r,element:"footer-link",flags:["footerLinks"]},{...r,element:"brand-text",foreground:o?"linkHover":"brand-color",background:o?u:"layer2",flags:e==="rest"?["brandText"]:["brandText","brandLink"]}];if(n)for(const[a,d]of[["footer-link","footerLinks"],["brand-link","brandLink"]])t.push({element:a,foreground:s,background:"layer2",state:e,kind:"ring",flags:[d]});return t})]},targets:{footer:[O,R]}};export{C as footerPaintRegistration};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TOKEN_PAIRINGS as
|
|
1
|
+
import{parsePaintColor as N}from"../shared/paint-color.js";import{TOKEN_PAIRINGS as _}from"../shared/token-pairings.js";import{PAINT_INTERACTIONS as h,closestPaintElement as d,configuredBrandColor as q,isPaintFocus as k,isPaintHover as x,navigationPaintFlags as y,navigationPaintPlacement as P,navigationPaintState as l}from"./navigation-paint.js";const S=_.linkHover.bg,I="nav-hover-indicator-ink",H="nav-active-indicator-ink",D=["inline","inline-panel","panel","full-screen"];function b(n,r){switch(n){case"inline":return{...r,depth:"top-level"};case"inline-panel":return{...r,depth:"nested"};default:return r}}const F=({element:n,source:r})=>{const e=d(n,".item:not(.button-appearance)"),i=e&&d(e,"esp-menu-item");if(!e||!i||!d(i,"esp-header"))return;const t=e.querySelector(":scope > :is(a, button, [aria-current=page])");if(!t)return;const a=t.matches("[aria-current=page]"),o=P(e),s=o!=="inline"&&e.matches(":hover,:focus-within"),c=g=>a?l(o,s?"current-hover":"current"):l(o,s&&g==="rest"?"row-active":g);if(r==="shadow")return a&&n===e?{element:"nav-current-indicator",owner:t,state:c,foregroundDerivations:[H],foregroundAliases:["link"]}:!a&&n===t?{element:"nav-hover-indicator",owner:t,state:c,foregroundDerivations:[I],foregroundAliases:["headingsHover"]}:void 0;if((r==="fill"||r==="stroke")&&d(n,".icon-area"))return{element:"nav-item-icon",owner:t,state:c};if(r==="outline"&&n===t||r==="text"&&d(n,'[part="menu-text"]'))return{element:t.matches("button")?"nav-item":"nav-link",owner:t,state:c,...r==="outline"&&o==="inline"&&t.matches(":hover")?{excludeBackdropEdge:{edge:"bottom",depth:2}}:{}}},L=({element:n,source:r})=>{const e=d(n,".group-header"),i=e&&d(e,"esp-menu-group");if(!e||!i||!d(i,"esp-header"))return;const t=P(e),a=(r==="fill"||r==="stroke")&&d(n,".group-icon");if(a){const u=e.querySelector(".group-toggle");return u?{element:"nav-group-icon",owner:u,state:v=>l(t,a.matches(":hover")?k(v)?"hover-focus":"hover":v)}:void 0}const o=d(n,".group-link, .group-toggle, [aria-current=page]");if(!o)return;const s=o.matches("[aria-current=page]"),c=(t==="panel"||t==="inline-panel")&&e.matches(":hover,:focus-within"),g=u=>s?l(t,c?"current-row-active":"current"):l(t,c&&u==="rest"?"row-active":u);if(r==="shape"&&n.matches(".indicator"))return{element:"nav-group-disclosure",owner:o,state:g};if(r==="text"&&d(n,".group-label-text"))return{element:"nav-group-label",owner:o,state:g};if(r==="outline"&&n===o)return{element:"nav-group-control",owner:o,state:g}},O=({element:n,source:r})=>{const e=d(n,".drawer-brand .configured-brand");if(!e||!d(e,"esp-header"))return;const i=P(e),t=e.matches("a[href]"),a=o=>l(i,t?o:"rest");if(r==="outline"&&n===e&&t)return{element:"drawer-brand-link",owner:e,state:a};if(r==="text"&&d(n,".brand-text"))return{element:"drawer-brand-text",owner:e,state:a,brandColor:q(e,"--_esp-menu-drawer-brand-color")}};function z(n){const r=y(n),e=n==="inline",i=n==="full-screen",t=e?"layer2":"layer1",a=b(n,{kind:"plain",anchor:!0}),o=b(n,{kind:"plain",anchor:!1}),s=[!0,!1].flatMap(u=>{const v=u?"nav-link":"nav-item",A=u?a:o;return(e?h:[...h,"row-active"]).flatMap(f=>{const m=f==="row-active",w=!m&&x(f),B=!m&&k(f),C=w||B||m,T=u&&w?"linkHover":!e&&C?"headingsHover":"text",G=u&&w&&!e&&!i?S:!i&&C?"layer2":t,M=l(n,f),p={element:v,foreground:T,background:G,state:M,kind:"text",flags:r,navigation:A},E={...p,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...A,icon:!0}};if(!B)return[p,E];const R={...p,foreground:"link",kind:"ring"};return[p,E,R]})}),c={element:"nav-link",foreground:"link",background:i?"layer1":"layer2",state:l(n,"current"),kind:"text",flags:r,navigation:b(n,{kind:"plain",canBeCurrent:!0})},g={...c,element:"nav-item-icon",kind:"graphic",background:"layer2",navigation:{...c.navigation,icon:!0}};return s.push(c,g),e?s.push({element:"nav-hover-indicator",foreground:I,background:"layer2",state:"hover",kind:"graphic",flags:r,navigation:{kind:"plain",depth:"top-level"}},{...c,element:"nav-current-indicator",kind:"graphic",foreground:H,flags:[...r,"headerPaint:standard"]}):s.push({...c,foreground:"headingsHover",state:l(n,"current-hover")},{...g,foreground:"headingsHover",state:l(n,"current-hover")}),s}function K(n){const r=y(n),e=b(n,{kind:"group"}),i=o=>n==="full-screen"?"layer1":n==="inline"||o?"layer2":"layer1",t={element:"nav-group-label",foreground:"link",background:i(!1),state:l(n,"current"),kind:"text",flags:r,navigation:{...e,canBeCurrent:!0}},a=h.flatMap(o=>{const s=k(o),c=i(s||x(o)),g=l(n,o),u={foreground:"text",background:c,state:g,flags:r,navigation:e},v=[{...u,element:"nav-group-label",kind:"text"},{...u,element:"nav-group-disclosure",kind:"graphic"},{...u,element:"nav-group-icon",kind:"graphic",background:"layer2",navigation:{...e,icon:!0}}];return s&&v.push({...u,element:"nav-group-control",foreground:"link",kind:"ring"}),v});if(a.push(t),n==="inline-panel"||n==="panel"){const o=i(!0),s={foreground:"text",background:o,state:l(n,"row-active"),flags:r,navigation:e};a.push({...s,element:"nav-group-label",kind:"text"},{...s,element:"nav-group-disclosure",kind:"graphic"},{...t,background:o,state:l(n,"current-row-active")})}return a}const V={derivations:{[I]:({readProperty:n,readColor:r})=>N(n("--esp-menu-item-hover-indicator-color")??n("--esp-menu-item-hover-color")??r("headingsHover")??""),[H]:({readProperty:n,readColor:r})=>N(n("--esp-menu-item-active-indicator-color")??n("--esp-menu-item-active-color")??r("link")??"")},entriesByRole:{header:[...D.flatMap(n=>[...z(n),...K(n)]),...h.flatMap(n=>{const r=l("full-screen",n),e=y("full-screen"),i=k(n),t=x(n),a={element:"drawer-brand-text",foreground:"brand-color",background:t?S:"layer1",state:r,kind:"text",flags:[...e,"brandText",...t||i?["brandLink"]:[]]};return i?[a,{element:"drawer-brand-link",foreground:"link",background:"layer1",state:r,kind:"ring",flags:[...e,"brandLink"]}]:[a]})]},targets:{header:[F,L,O]}};export{V as menuPaintRegistration};
|
package/dist/root/esp-root.d.ts
CHANGED
|
@@ -70,6 +70,19 @@ export type { SchemeEvents } from "../shared/bus-events.js";
|
|
|
70
70
|
* @cssprop --esp-heading-2-color - Color of native light-DOM h2 headings. Defaults to `var(--esp-color-headings)`.
|
|
71
71
|
* @cssprop --esp-heading-3-color - Color of native light-DOM h3 headings. Defaults to `var(--esp-color-headings)`.
|
|
72
72
|
* @cssprop --esp-heading-4-color - Color of native light-DOM h4 headings. Defaults to `var(--esp-color-headings)`.
|
|
73
|
+
* @cssprop --esp-heading-1-mark-color - Color of a text-decoration mark beneath native light-DOM h1 headings. Unset by default, which paints no mark. Takes effect only through a theme's `componentProperties`, which sets the enable toggle; a raw CSS declaration alone paints nothing.
|
|
74
|
+
* @cssprop --esp-heading-2-mark-color - Color of a text-decoration mark beneath native light-DOM h2 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing.
|
|
75
|
+
* @cssprop --esp-heading-3-mark-color - Color of a text-decoration mark beneath native light-DOM h3 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing.
|
|
76
|
+
* @cssprop --esp-heading-4-mark-color - Color of a text-decoration mark beneath native light-DOM h4 headings. Unset by default. Theme `componentProperties` only; a raw CSS declaration paints nothing.
|
|
77
|
+
* @cssprop --esp-heading-mark-height - Thickness of the heading mark, from `0` (no visible mark) through thin underlines to `0.6em` (a highlighter). Defaults to `0.35em`.
|
|
78
|
+
* @cssprop --esp-ordered-list-marker-style - Numbering style of native light-DOM ordered lists: `decimal`, `decimal-leading-zero`, `lower-alpha`, `upper-alpha`, `lower-roman` or `upper-roman`. Defaults to `decimal`.
|
|
79
|
+
* @cssprop --esp-list-marker-color - Color of list bullets and numbers. Defaults to the list item's text color.
|
|
80
|
+
* @cssprop --esp-code-border-style - Border style of inline code and `pre` blocks: `dotted`, `dashed`, `solid` or `none`. Defaults to `dotted`.
|
|
81
|
+
* @cssprop --esp-code-border-color - Border color of inline code and `pre` blocks. Defaults to `var(--esp-color-border)`.
|
|
82
|
+
* @cssprop --esp-code-background - Background of inline code. Defaults to `var(--esp-color-layer-1)`.
|
|
83
|
+
* @cssprop --esp-shadow-1-geometry - Offsets and optional blur of the first elevation step, as `<inline> <block> [<blur>]` in `px`, `rem` or `em`. Defaults to `1px 1px 4px`.
|
|
84
|
+
* @cssprop --esp-shadow-2-geometry - Offsets and optional blur of the second elevation step. Defaults to `0 2px 8px`.
|
|
85
|
+
* @cssprop --esp-shadow-3-geometry - Offsets and optional blur of the third elevation step. Defaults to `0 6px 20px`.
|
|
73
86
|
* @cssprop --esp-font-brand - Consumer-authored brand family. Emitted only when configured; brand recipes otherwise fall back through headings to `--esp-font-body`.
|
|
74
87
|
* @cssprop --esp-font-menu - Consumer-authored navigation family. Emitted only when configured; menu items otherwise fall back to `--esp-font-body`, never to headings.
|
|
75
88
|
* @cssprop --esp-font-weight-menu - Font weight for horizontal navigation menu items. Defaults to `bold`.
|
package/dist/root/esp-root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,e,t,o);else for(var d=c.length-1;d>=0;d--)(m=c[d])&&(r=(h<3?m(r):h>3?m(e,t,r):m(e,t))||r);return h>3&&r&&Object.defineProperty(e,t,r),r},l;import{surfaceLayerAttributes as x}from"../shared/surface-layer.js";import{css as A,html as L,LitElement as D}from"lit";import{customElement as P,property as n,state as F}from"lit/decorators.js";import{getEspBus as p}from"../shared/bus-events.js";import{GoverningRootObserver as O}from"../shared/governing-root.js";import{getComponentPropertyAnalysis as k}from"../shared/component-property-normalizer.js";import{addComponentPropertyResets as I}from"../shared/component-property-resets.js";import{ScopedStyleDeclarations as z}from"../shared/scoped-style-declarations.js";import{subscribeToRootEvent as W}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as v,DEFAULT_DARK_THEME as y,encodeTheme as T,parseTheme as f,mergeTheme as w}from"../shared/theme-core.js";import{extractFamily as u,isLocalFontFamily as B,removeRuntimeGoogleFontLinks as C,syncRuntimeGoogleFontLink as _}from"../shared/font-helpers.js";import{computeThemeProperties as U}from"./helpers/compute-theme-properties.js";import{registerImageTexture as G,registeredImageTextures as M}from"../shared/image-texture-registry.js";import{registerImageTexture as re,registeredImageTextures as ie,BUILT_IN_IMAGE_TEXTURES as ne}from"../shared/image-texture-registry.js";const E=1e3;let s=l=class extends D{static registerTexture(e,t){G(e,t)}static registeredTextures(){return M()}subscribeScoped(e,t){return W(this,e,t)}get virtualViewportWidth(){return this.virtualViewportWidthBacker}set virtualViewportWidth(e){const t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,o=this.virtualViewportWidthBacker;this.virtualViewportWidthBacker=t,t===void 0?this.hasAttribute("virtual-viewport-width")&&this.removeAttribute("virtual-viewport-width"):this.getAttribute("virtual-viewport-width")!==String(t)&&this.setAttribute("virtual-viewport-width",String(t)),this.requestUpdate("virtualViewportWidth",o)}get lightTheme(){return this.lightThemeAttr?f(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?T(e):""}get darkTheme(){return this.darkThemeAttr?f(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?T(e):""}get themeSettled(){return this.themeReadyState}whenThemeSettled(){return this.themeReadyState?Promise.resolve():new Promise(e=>{this.themeSettleWaiters.push(e)})}get hasAuthorTheme(){return!!(this.scheme==="dark"?this.darkThemeAttr:this.lightThemeAttr)}settleTheme(){if(this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.themeReadyState)return;this.themeReadyState=!0;const e=this.themeSettleWaiters;this.themeSettleWaiters=[];for(const t of e)t()}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,h=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const r=t||this.resolveDefaultScheme();h!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),r!==o&&(this.schemeBacker=r,this.requestUpdate("scheme",o),this.themeEventsReady&&(this.resolveThemes(),p().publish("scheme-changed",{scheme:r,correlationId:this.correlationId})))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,o){const h=`${this.correlationId}-${e}`,r=B(t)?"":t;_({owner:`root:${h}`,family:r,weight:o,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",u(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",u(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",u(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",u(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",u(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){C(`root:${this.correlationId}-`),C(`picker:${this.correlationId}:`,this.ownerDocument)}constructor(){super(),this.outerRootObserver=new O(this,(t,o)=>{t!==o&&(this.outerComponentCandidates=void 0,this.applyComponentProperties(),t&&this.outerRootObserver.whenReady(this.syncOuterComponentCandidates))}),this.componentDeclarations=new z(this),this.componentProperties={},this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightThemeAttr="",this.resolvedDarkThemeAttr="",this.resolvedLightTheme={...v},this.resolvedDarkTheme={...y},this.appliedThemeProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.themePending=!1,this.themeReadyState=!1,this.themeSettleWaiters=[],this.warnedThemeSettleTimeout=!1,this.defaultScheme="light",this.syncOuterComponentCandidates=t=>{const{candidates:o}=k(t.activeTheme);o!==this.outerComponentCandidates&&(this.outerComponentCandidates=o,this.applyComponentProperties())},this.resizeObserver=new ResizeObserver(()=>{p().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=t=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=t.matches?"dark":"light",this.resolvingDefaultScheme=!1)};const e=()=>{const t=this.outerRootObserver.root;t&&this.syncOuterComponentCandidates(t)};this.outerRootObserver.subscribe("scheme-changed",e),this.outerRootObserver.subscribe("theme-changed",e)}applyComponentProperties(){const e={...this.componentProperties};this.outerComponentCandidates&&I(e,this.outerComponentCandidates),this.componentDeclarations.apply(e)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){if(this.lightThemeAttr!==this.resolvedLightThemeAttr){this.resolvedLightThemeAttr=this.lightThemeAttr;const e=f(this.lightThemeAttr);this.resolvedLightTheme=e?w(v,e):{...v}}if(this.darkThemeAttr!==this.resolvedDarkThemeAttr){this.resolvedDarkThemeAttr=this.darkThemeAttr;const e=f(this.darkThemeAttr);this.resolvedDarkTheme=e?w(y,e):{...y}}}connectedCallback(){super.connectedCallback(),this.outerRootObserver.connect(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks(),this.hasAuthorTheme||this.startThemeSettleTimer())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(a=>e.has(a)))&&(this.resolveThemes(),this.themeEventsReady&&p().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=this.activeTheme,{root:r,candidates:m}=k(h),d=U(h,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth},{surface:r}),S={};for(const a of m)Object.prototype.hasOwnProperty.call(d,a)&&(S[a]=d[a],delete d[a]);this.componentProperties=S,this.applyComponentProperties();const b=new Set(Object.keys(d));for(const a of this.appliedThemeProperties)b.has(a)||this.style.removeProperty(a);for(const[a,R]of Object.entries(d))this.style.setProperty(a,R);this.appliedThemeProperties=b;const g=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==g&&p().publish("seed-color-changed",{seedColor:g,correlationId:this.correlationId}),this.lastSeedColor=g,this.themeEventsReady&&e.has("iconSpriteUrl")&&p().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=l.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0,this.startThemeSettleTimer()}startThemeSettleTimer(){if(this.themeReadyState||this.themeSettleTimer!==void 0)return;this.themeSettleDeadline??=performance.now()+E;const e=Math.max(0,this.themeSettleDeadline-performance.now());if(e===0){this.closeThemeWindow();return}this.themeSettleTimer=setTimeout(()=>this.closeThemeWindow(),e)}closeThemeWindow(){this.themeSettleTimer=void 0,this.themePending&&!this.warnedThemeSettleTimeout&&(this.warnedThemeSettleTimeout=!0,console.warn(`Espalier root: theme-pending was declared but no ${this.scheme} theme arrived within ${E}ms, so the default palette is rendering. Assign ${this.scheme==="dark"?"darkTheme":"lightTheme"} (or remove theme-pending).`)),this.settleTheme()}updated(e){this.toggleAttribute("data-theme-ready",this.themeReadyState),(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.outerRootObserver.disconnect(),this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,l.connectedRootCount+=1,l.connectedRootCount===1&&document.addEventListener("click",l.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,l.connectedRootCount=Math.max(0,l.connectedRootCount-1),l.connectedRootCount===0&&document.removeEventListener("click",l.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return L`<slot></slot>`}};s.connectedRootCount=0,s.handleDocumentClick=c=>{const e=c.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");p().publish("close-popovers",{source:c.target??void 0,skipPopovers:e})},s.lightDomStyles=`
|
|
2
|
-
${
|
|
1
|
+
var s=function(n,e,t,o){var h=arguments.length,i=h<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,o);else for(var c=n.length-1;c>=0;c--)(p=n[c])&&(i=(h<3?p(i):h>3?p(e,t,i):p(e,t))||i);return h>3&&i&&Object.defineProperty(e,t,i),i},d;import{footerHeadingFit as A,footerLinkFit as S}from"../shared/footer-ink-styles.js";import{surfaceLayerAttributes as L}from"../shared/surface-layer.js";import{css as D,html as P,LitElement as F}from"lit";import{customElement as _,property as a,state as O}from"lit/decorators.js";import{getEspBus as m}from"../shared/bus-events.js";import{GoverningRootObserver as I}from"../shared/governing-root.js";import{getComponentPropertyAnalysis as T}from"../shared/component-property-normalizer.js";import{addComponentPropertyResets as z}from"../shared/component-property-resets.js";import{ScopedStyleDeclarations as W}from"../shared/scoped-style-declarations.js";import{subscribeToRootEvent as $}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as v,DEFAULT_DARK_THEME as y,encodeTheme as w,parseTheme as f,mergeTheme as C}from"../shared/theme-core.js";import{extractFamily as u,isLocalFontFamily as B,removeRuntimeGoogleFontLinks as x,syncRuntimeGoogleFontLink as U}from"../shared/font-helpers.js";import{computeThemeProperties as G}from"./helpers/compute-theme-properties.js";import{registerImageTexture as M,registeredImageTextures as H}from"../shared/image-texture-registry.js";const j=[["h1","--_esp-heading-1-mark-on","--esp-heading-1-mark-color"],["h2","--_esp-heading-2-mark-on","--esp-heading-2-mark-color"],["h3","--_esp-heading-3-mark-on","--esp-heading-3-mark-color"],["h4","--_esp-heading-4-mark-on","--esp-heading-4-mark-color"]];import{registerImageTexture as he,registeredImageTextures as le,BUILT_IN_IMAGE_TEXTURES as de}from"../shared/image-texture-registry.js";const E=1e3;let r=d=class extends F{static registerTexture(e,t){M(e,t)}static registeredTextures(){return H()}subscribeScoped(e,t){return $(this,e,t)}get virtualViewportWidth(){return this.virtualViewportWidthBacker}set virtualViewportWidth(e){const t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,o=this.virtualViewportWidthBacker;this.virtualViewportWidthBacker=t,t===void 0?this.hasAttribute("virtual-viewport-width")&&this.removeAttribute("virtual-viewport-width"):this.getAttribute("virtual-viewport-width")!==String(t)&&this.setAttribute("virtual-viewport-width",String(t)),this.requestUpdate("virtualViewportWidth",o)}get lightTheme(){return this.lightThemeAttr?f(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?w(e):""}get darkTheme(){return this.darkThemeAttr?f(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?w(e):""}get themeSettled(){return this.themeReadyState}whenThemeSettled(){return this.themeReadyState?Promise.resolve():new Promise(e=>{this.themeSettleWaiters.push(e)})}get hasAuthorTheme(){return!!(this.scheme==="dark"?this.darkThemeAttr:this.lightThemeAttr)}settleTheme(){if(this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.themeReadyState)return;this.themeReadyState=!0;const e=this.themeSettleWaiters;this.themeSettleWaiters=[];for(const t of e)t()}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,h=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const i=t||this.resolveDefaultScheme();h!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),i!==o&&(this.schemeBacker=i,this.requestUpdate("scheme",o),this.themeEventsReady&&(this.resolveThemes(),m().publish("scheme-changed",{scheme:i,correlationId:this.correlationId})))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,o){const h=`${this.correlationId}-${e}`,i=B(t)?"":t;U({owner:`root:${h}`,family:i,weight:o,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",u(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",u(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",u(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",u(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",u(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){x(`root:${this.correlationId}-`),x(`picker:${this.correlationId}:`,this.ownerDocument)}constructor(){super(),this.outerRootObserver=new I(this,(t,o)=>{t!==o&&(this.outerComponentCandidates=void 0,this.applyComponentProperties(),t&&this.outerRootObserver.whenReady(this.syncOuterComponentCandidates))}),this.componentDeclarations=new W(this),this.componentProperties={},this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightThemeAttr="",this.resolvedDarkThemeAttr="",this.resolvedLightTheme={...v},this.resolvedDarkTheme={...y},this.appliedThemeProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.themePending=!1,this.themeReadyState=!1,this.themeSettleWaiters=[],this.warnedThemeSettleTimeout=!1,this.defaultScheme="light",this.syncOuterComponentCandidates=t=>{const{candidates:o}=T(t.activeTheme);o!==this.outerComponentCandidates&&(this.outerComponentCandidates=o,this.applyComponentProperties())},this.resizeObserver=new ResizeObserver(()=>{m().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=t=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=t.matches?"dark":"light",this.resolvingDefaultScheme=!1)};const e=()=>{const t=this.outerRootObserver.root;t&&this.syncOuterComponentCandidates(t)};this.outerRootObserver.subscribe("scheme-changed",e),this.outerRootObserver.subscribe("theme-changed",e)}applyComponentProperties(){const e={...this.componentProperties};this.outerComponentCandidates&&z(e,this.outerComponentCandidates),this.componentDeclarations.apply(e)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){if(this.lightThemeAttr!==this.resolvedLightThemeAttr){this.resolvedLightThemeAttr=this.lightThemeAttr;const e=f(this.lightThemeAttr);this.resolvedLightTheme=e?C(v,e):{...v}}if(this.darkThemeAttr!==this.resolvedDarkThemeAttr){this.resolvedDarkThemeAttr=this.darkThemeAttr;const e=f(this.darkThemeAttr);this.resolvedDarkTheme=e?C(y,e):{...y}}}connectedCallback(){super.connectedCallback(),this.outerRootObserver.connect(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks(),this.hasAuthorTheme||this.startThemeSettleTimer())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(l=>e.has(l)))&&(this.resolveThemes(),this.themeEventsReady&&m().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=this.activeTheme,{root:i,candidates:p}=T(h),c=G(h,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth},{surface:i}),k={};for(const l of p)Object.prototype.hasOwnProperty.call(c,l)&&(k[l]=c[l],delete c[l]);this.componentProperties=k,this.applyComponentProperties();const b=new Set(Object.keys(c));for(const l of this.appliedThemeProperties)b.has(l)||this.style.removeProperty(l);for(const[l,R]of Object.entries(c))this.style.setProperty(l,R);this.appliedThemeProperties=b;const g=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==g&&m().publish("seed-color-changed",{seedColor:g,correlationId:this.correlationId}),this.lastSeedColor=g,this.themeEventsReady&&e.has("iconSpriteUrl")&&m().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=d.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0,this.startThemeSettleTimer()}startThemeSettleTimer(){if(this.themeReadyState||this.themeSettleTimer!==void 0)return;this.themeSettleDeadline??=performance.now()+E;const e=Math.max(0,this.themeSettleDeadline-performance.now());if(e===0){this.closeThemeWindow();return}this.themeSettleTimer=setTimeout(()=>this.closeThemeWindow(),e)}closeThemeWindow(){this.themeSettleTimer=void 0,this.themePending&&!this.warnedThemeSettleTimeout&&(this.warnedThemeSettleTimeout=!0,console.warn(`Espalier root: theme-pending was declared but no ${this.scheme} theme arrived within ${E}ms, so the default palette is rendering. Assign ${this.scheme==="dark"?"darkTheme":"lightTheme"} (or remove theme-pending).`)),this.settleTheme()}updated(e){this.toggleAttribute("data-theme-ready",this.themeReadyState),(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.outerRootObserver.disconnect(),this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,d.connectedRootCount+=1,d.connectedRootCount===1&&document.addEventListener("click",d.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,d.connectedRootCount=Math.max(0,d.connectedRootCount-1),d.connectedRootCount===0&&document.removeEventListener("click",d.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return P`<slot></slot>`}};r.connectedRootCount=0,r.handleDocumentClick=n=>{const e=n.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");m().publish("close-popovers",{source:n.target??void 0,skipPopovers:e})},r.lightDomStyles=`
|
|
2
|
+
${L("esp-root [surface-layer]").cssText}
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
esp-root {
|
|
@@ -22,6 +22,16 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
:where(esp-root :is(ul, ol) li)::marker {
|
|
26
|
+
color: var(--esp-list-marker-color, currentcolor);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
:where(esp-root ol:not([type], [role="list"])) {
|
|
31
|
+
list-style-type: var(--esp-ordered-list-marker-style, decimal);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
25
35
|
esp-root input,
|
|
26
36
|
esp-root select,
|
|
27
37
|
esp-root button {
|
|
@@ -48,6 +58,33 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
|
|
61
|
+
esp-root a[data-esp-badge-link]:has(> esp-badge[linked]:defined) {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
esp-root a[data-esp-badge-link]:focus-visible:has(> esp-badge[linked]:defined) {
|
|
67
|
+
outline: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
esp-root a:focus-visible > esp-badge[linked]::part(badge) {
|
|
71
|
+
background: var(--esp-badge-link-focus-background, var(--esp-color-link-hover-bg));
|
|
72
|
+
border-color: var(--esp-badge-link-focus-border-color, var(--esp-color-link-hover));
|
|
73
|
+
color: var(--esp-badge-link-focus-color, var(--esp-color-link-hover));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
esp-root a[data-esp-badge-link]:focus-visible > esp-badge[linked]:defined::part(badge) {
|
|
77
|
+
outline: 2px solid var(--esp-badge-link-focus-ring-color, var(--esp-color-link));
|
|
78
|
+
outline-offset: 3px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (forced-colors: active) {
|
|
82
|
+
esp-root a[data-esp-badge-link]:focus-visible > esp-badge[linked]:defined::part(badge) {
|
|
83
|
+
outline-color: Highlight;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
51
88
|
esp-root input,
|
|
52
89
|
esp-root button,
|
|
53
90
|
esp-root textarea,
|
|
@@ -108,6 +145,25 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
108
145
|
}
|
|
109
146
|
|
|
110
147
|
|
|
148
|
+
${j.map(([n,e,t])=>`
|
|
149
|
+
:where(esp-root ${n}) {
|
|
150
|
+
text-decoration-line: var(${e}) underline;
|
|
151
|
+
text-decoration-color: var(${e}) var(${t});
|
|
152
|
+
text-decoration-thickness: var(${e}) var(--esp-heading-mark-height, 0.35em);
|
|
153
|
+
text-underline-offset: var(${e}) calc(0.1em - var(--esp-heading-mark-height, 0.35em));
|
|
154
|
+
text-decoration-skip-ink: var(${e}) none;
|
|
155
|
+
}
|
|
156
|
+
:where(esp-root ${n} *) {
|
|
157
|
+
text-underline-offset: var(${e}) auto;
|
|
158
|
+
text-decoration-skip-ink: var(${e}) auto;
|
|
159
|
+
}
|
|
160
|
+
@media (forced-colors: active) {
|
|
161
|
+
:where(esp-root ${n}) {
|
|
162
|
+
text-decoration-line: var(${e}) none;
|
|
163
|
+
}
|
|
164
|
+
}`).join("")}
|
|
165
|
+
|
|
166
|
+
|
|
111
167
|
esp-root pre,
|
|
112
168
|
esp-root code {
|
|
113
169
|
font-family: var(--_esp-font-monospace-effective, var(--esp-font-monospace, monospace));
|
|
@@ -116,17 +172,17 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
116
172
|
|
|
117
173
|
esp-root code {
|
|
118
174
|
font-size: var(--esp-type-small);
|
|
119
|
-
background: var(--esp-color-layer-1);
|
|
175
|
+
background: var(--esp-code-background, var(--esp-color-layer-1));
|
|
120
176
|
border-radius: var(--esp-size-border-radius);
|
|
121
177
|
padding: 0 0.35em;
|
|
122
178
|
display: inline-block;
|
|
123
|
-
border: 1px dotted var(--esp-color-border);
|
|
179
|
+
border: 1px var(--esp-code-border-style, dotted) var(--esp-code-border-color, var(--esp-color-border));
|
|
124
180
|
}
|
|
125
181
|
|
|
126
182
|
esp-root pre {
|
|
127
183
|
background-color: var(--esp-color-layer-1);
|
|
128
184
|
border-radius: var(--esp-size-border-radius);
|
|
129
|
-
border: 1px dotted var(--esp-color-border);
|
|
185
|
+
border: 1px var(--esp-code-border-style, dotted) var(--esp-code-border-color, var(--esp-color-border));
|
|
130
186
|
}
|
|
131
187
|
|
|
132
188
|
esp-root pre > code {
|
|
@@ -156,7 +212,8 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
156
212
|
}
|
|
157
213
|
|
|
158
214
|
esp-root esp-footer :is(h1, h2, h3, h4, h5, h6) {
|
|
159
|
-
|
|
215
|
+
${A.cssText}
|
|
216
|
+
color: var(--esp-footer-heading-color, var(--_esp-footer-local-fitted-heading-color, var(--esp-color-headings)));
|
|
160
217
|
}
|
|
161
218
|
|
|
162
219
|
esp-root esp-footer h2 {
|
|
@@ -165,7 +222,8 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
165
222
|
|
|
166
223
|
esp-root esp-footer a,
|
|
167
224
|
esp-root esp-footer a:not([class]) {
|
|
168
|
-
|
|
225
|
+
${S.cssText}
|
|
226
|
+
color: var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)));
|
|
169
227
|
}
|
|
170
228
|
|
|
171
229
|
esp-root esp-footer a:not([class]) {
|
|
@@ -188,9 +246,10 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
188
246
|
}
|
|
189
247
|
|
|
190
248
|
esp-root esp-footer a:focus-visible {
|
|
249
|
+
${S.cssText}
|
|
191
250
|
outline: var(
|
|
192
251
|
--esp-footer-focus-outline,
|
|
193
|
-
2px solid var(--esp-footer-link-color, var(--esp-color-link))
|
|
252
|
+
2px solid var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)))
|
|
194
253
|
);
|
|
195
254
|
outline-offset: 3px;
|
|
196
255
|
}
|
|
@@ -199,7 +258,7 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
199
258
|
esp-root esp-footer a:not([class]):focus-visible {
|
|
200
259
|
border-radius: var(--esp-size-border-radius);
|
|
201
260
|
}
|
|
202
|
-
`,
|
|
261
|
+
`,r.styles=D`
|
|
203
262
|
:host {
|
|
204
263
|
display: block;
|
|
205
264
|
}
|
|
@@ -208,4 +267,4 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
|
|
|
208
267
|
:host([theme-pending]:not([data-theme-ready])) {
|
|
209
268
|
visibility: hidden;
|
|
210
269
|
}
|
|
211
|
-
`,
|
|
270
|
+
`,s([a({attribute:!1})],r.prototype,"correlationId",void 0),s([a({attribute:"virtual-viewport-width",noAccessor:!0,converter:{fromAttribute:n=>{const e=n?.trim()??"";return/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}}})],r.prototype,"virtualViewportWidth",null),s([a({attribute:"light-theme"})],r.prototype,"lightThemeAttr",void 0),s([a({attribute:"dark-theme"})],r.prototype,"darkThemeAttr",void 0),s([a({attribute:!1})],r.prototype,"lightTheme",null),s([a({attribute:!1})],r.prototype,"darkTheme",null),s([a({attribute:"font-css-root",type:String})],r.prototype,"fontCSSRoot",void 0),s([a({attribute:"font-definitions-url",type:String})],r.prototype,"fontDefinitionsUrl",void 0),s([a({attribute:"google-font-loading",type:String})],r.prototype,"googleFontLoading",void 0),s([a({attribute:"icon-sprite-url",type:String})],r.prototype,"iconSpriteUrl",void 0),s([a({attribute:"theme-pending",reflect:!0,type:Boolean})],r.prototype,"themePending",void 0),s([O()],r.prototype,"themeReadyState",void 0),s([a({attribute:"default-scheme",type:String,reflect:!0})],r.prototype,"defaultScheme",void 0),s([a({attribute:"scheme",type:String,reflect:!0})],r.prototype,"scheme",null),r=d=s([_("esp-root")],r);export{de as BUILT_IN_IMAGE_TEXTURES,r as EspalierRoot,he as registerImageTexture,le as registeredImageTextures};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{deriveSemantic as
|
|
1
|
+
import{deriveSemantic as A,deriveSemanticWithContrast as K,parseOklch as P,serializeOklch as N}from"../../shared/color-engine.js";import{SEMANTIC_COLOR_NAMES as _,TOKEN_PAIRINGS as S,resolveLightnessReference as x,semanticToCSS as R}from"../../shared/theme-core.js";import{FOOTER_INK_PROPERTIES as j}from"../../shared/footer-ink.js";import{resolveMappingSource as q}from"./compute-variants.js";function G(n,u,c,t,i,m,p){return[n.l,n.c,n.h,u,c,t,i.l,i.c,i.h,m,p].join("|")}function W(n,u,c={}){const t={},i={},m=new Map,p=c.trace!==void 0||c.footerTrace!==void 0,O=(e,o,r,s,a,g,l=!1)=>{const v=n.semanticMappings[e],d=n.chroma[e],f=T(e,v.source),C=x(n.lightness,n.tones,v.lightness),E=G(f.color,C,d.min,d.max,s,a,l);let h=m.get(E);if(!h){let M;const k=K(f.color,C,d.min,d.max,s,a,p?y=>{M=y}:void 0,l);h={requested:M,semantic:k},m.set(E,h)}const{requested:F,semantic:I}=h;return t[o]=N(I),g?.push({token:e,property:o,resolved:t[o],source:f.source,lightness:v.lightness,sourceResolved:f.resolved,base:f.color,requested:F,contrast:{against:r,background:s,targetLc:a}}),I},T=(e,o)=>{const r=c.effectiveSource?.(e,o)??o,s=q(r,u,n.anchors);return s||c.onUnresolvedSource?.(r),{color:s??u.primary,resolved:s!==null,source:r}};for(const e of _){if(S[e])continue;const o=n.semanticMappings[e],r=n.chroma[e],s=T(e,o.source),a=x(n.lightness,n.tones,o.lightness),g=A(s.color,a,r.min,r.max),l=R(e);i[e]=g,t[l]=N(g),c.trace&&c.trace.push({token:e,property:l,resolved:t[l],source:s.source,lightness:o.lightness,sourceResolved:s.resolved,base:s.color})}for(const e of _){const o=S[e];o&&(i[e]=O(e,R(e),o.bg,i[o.bg],o.targetLc,c.trace))}if(c.includeFooterInk!==!1){const e=P(t[R("layer2")]);for(const[o,r]of Object.entries(j)){const s=o;O(s,r,"layer2",e,S[s].targetLc,c.footerTrace,!0)}}return t}export{W as computeSemanticProperties};
|