@taprootio/espalier 7.5.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 +18 -0
- package/custom-elements.json +1190 -1084
- package/dist/box/esp-box.d.ts +4 -2
- package/dist/box/esp-box.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/footer/esp-footer.d.ts +2 -0
- package/dist/footer/esp-footer.js +14 -1
- 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 +36 -7
- 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/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/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/testing/observe-paint.iife.js +2 -2
- package/dist/testing/observe-paint.js +3 -3
- package/espalier.css-data.json +92 -4
- package/espalier.token-manifest.json +849 -60
- package/package.json +1 -1
package/dist/box/esp-box.d.ts
CHANGED
|
@@ -43,9 +43,11 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
|
|
|
43
43
|
*
|
|
44
44
|
* @cssprop --esp-color-box-background - The background color of the box.
|
|
45
45
|
* @cssprop --esp-box-background - Adds a layer in the background of the box. Intended for background images or gradients.
|
|
46
|
-
* @cssprop --esp-box-background-opacity - The opacity of the background layer.
|
|
46
|
+
* @cssprop --esp-box-background-opacity - The opacity of the background layer. Defaults to `--esp-box-background-image-opacity`, then `1`.
|
|
47
|
+
* @cssprop --esp-box-background-image - The theme's box background image, painted when `--esp-box-background` is unset. Defaults to `none`.
|
|
48
|
+
* @cssprop --esp-box-background-image-opacity - The theme's opacity for that image. Defaults to `1`.
|
|
47
49
|
* @cssprop --esp-size-box-padding - The padding inside the box.
|
|
48
|
-
* @cssprop --esp-box-shadow - The box's drop shadow
|
|
50
|
+
* @cssprop --esp-box-shadow - The box's drop shadow: `none`, `1`, `2` or `3` as a theme elevation step. Defaults to `1`.
|
|
49
51
|
*
|
|
50
52
|
* ```html
|
|
51
53
|
* <style>
|
package/dist/box/esp-box.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
<div class=${
|
|
1
|
+
var l=function(t,e,s,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,s,i);else for(var p=t.length-1;p>=0;p--)(n=t[p])&&(o=(a<3?n(o):a>3?n(e,s,o):n(e,s))||o);return a>3&&o&&Object.defineProperty(e,s,o),o};import{paintedSurface as c}from"../shared/surface-layer.js";import{css as b,html as v}from"lit";import{customElement as u,property as x}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{EspalierElementBase as d}from"../shared/esp-element-base.js";let r=class extends d{constructor(){super(...arguments),this.fullScreen=!1}render(){const{fullScreen:e}=this;return v`
|
|
2
|
+
<div class=${f({"esp-box":!0,"full-screen":e})}>
|
|
3
3
|
<div part="box">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
|
-
`}};
|
|
7
|
+
`}};r.styles=[...d.styles,c(1),b`
|
|
8
8
|
:host {
|
|
9
9
|
display: block;
|
|
10
10
|
}
|
|
@@ -25,8 +25,8 @@ var p=function(r,e,s,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnP
|
|
|
25
25
|
top: 0;
|
|
26
26
|
right: 0;
|
|
27
27
|
bottom: 0;
|
|
28
|
-
opacity: var(--esp-box-background-opacity, 1);
|
|
29
|
-
background: var(--esp-box-background,
|
|
28
|
+
opacity: var(--esp-box-background-opacity, var(--esp-box-background-image-opacity, 1));
|
|
29
|
+
background: var(--esp-box-background, var(--esp-box-background-image, none));
|
|
30
30
|
z-index: 0;
|
|
31
31
|
border-radius: var(--esp-size-border-radius);
|
|
32
32
|
}
|
|
@@ -76,4 +76,4 @@ var p=function(r,e,s,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnP
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
`],
|
|
79
|
+
`],l([x({attribute:"full-screen",type:Boolean})],r.prototype,"fullScreen",void 0),r=l([u("esp-box")],r);export{r as EspalierBox};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var u=function(r,t,o,e){var s=arguments.length,n=s<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,o):e,
|
|
1
|
+
var u=function(r,t,o,e){var s=arguments.length,n=s<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,o):e,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,o,e);else for(var i=r.length-1;i>=0;i--)(a=r[i])&&(n=(s<3?a(n):s>3?a(t,o,n):a(t,o))||n);return s>3&&n&&Object.defineProperty(t,o,n),n};import{css as d,html as c,LitElement as h,nothing as b}from"lit";import{customElement as f,property as p}from"lit/decorators.js";const g=["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"];function v(r){const t=r.tagName;return t==="ESP-BUTTON"?!0:t==="ESP-TOOLTIP"?!!r.querySelector("esp-button"):t==="ESP-POPOVER"?!!r.querySelector('esp-button[slot="target"]'):!1}let l=class extends h{constructor(){super(...arguments),this.label="",this.toolbar=!1,this.activeButton=null,this.managedButtons=new Set,this.managedTooltips=new Set,this.groupedButtons=new Set}connectedCallback(){super.connectedCallback(),this.stateObserver??=new MutationObserver(()=>this.applyRovingTabindex()),this.stateObserver.observe(this,{subtree:!0,attributes:!0,attributeFilter:["disabled","loading"]})}disconnectedCallback(){super.disconnectedCallback(),this.stateObserver?.disconnect()}isEnabled(t){return!t.disabled&&!t.loading}handleSlotChange(t){const o=t.target,e=new Set;for(const s of o.assignedElements()){v(s)||console.warn(`<esp-button-group> unexpected child <${s.tagName.toLowerCase()}>. Only <esp-button>, <esp-tooltip>, or <esp-popover> (containing an <esp-button>) are supported.`);let n;const a=s.tagName;a==="ESP-BUTTON"?n=[s]:a==="ESP-POPOVER"?n=Array.from(s.querySelectorAll(':scope > esp-button[slot="target"]')):n=Array.from(s.querySelectorAll(":scope > esp-button"));for(const i of n)i.style.setProperty("--_esp-button-radius","0"),i.style.setProperty("--esp-field-border-width","0px"),i.style.setProperty("--_esp-button-group-border-width","0px"),e.add(i)}for(const s of this.groupedButtons)e.has(s)||s.style.removeProperty("--_esp-button-group-border-width");this.groupedButtons=e,this.applyRovingTabindex()}getButtons(){const t=this.shadowRoot?.querySelector("slot");if(!t)return[];const o=[];for(const e of t.assignedElements()){const s=e.tagName;s==="ESP-BUTTON"?o.push(e):s==="ESP-TOOLTIP"?o.push(...e.querySelectorAll(":scope > esp-button")):s==="ESP-POPOVER"&&o.push(...e.querySelectorAll(':scope > esp-button[slot="target"]'))}return o}getTooltips(){const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements().filter(o=>o.tagName==="ESP-TOOLTIP"):[]}applyTabindexValues(){const t=this.getButtons(),o=new Set(t);for(const e of this.managedButtons)o.has(e)||e.removeAttribute("tabindex");this.managedButtons=o;for(const e of t)e.setAttribute("tabindex",e===this.activeButton?"0":"-1")}syncTooltipOptOut(){const t=this.getTooltips(),o=new Set(t);for(const e of this.managedTooltips)o.has(e)||e.removeAttribute("trigger-tabindex");this.managedTooltips=o;for(const e of t)e.setAttribute("trigger-tabindex","-1")}applyRovingTabindex(){if(!this.toolbar)return;this.syncTooltipOptOut();const t=this.getButtons().filter(o=>this.isEnabled(o));t.length===0?this.activeButton=null:(!this.activeButton||!t.includes(this.activeButton))&&(this.activeButton=t[0]),this.applyTabindexValues()}clearRovingTabindex(){this.activeButton=null;for(const t of this.managedButtons)t.removeAttribute("tabindex");this.managedButtons.clear();for(const t of this.managedTooltips)t.removeAttribute("trigger-tabindex");this.managedTooltips.clear()}handleKeyDown(t){if(!this.toolbar||!g.includes(t.key))return;const o=this.getButtons().filter(n=>this.isEnabled(n));if(o.length===0)return;t.preventDefault();const e=this.activeButton?o.indexOf(this.activeButton):-1;let s;switch(t.key){case"Home":s=0;break;case"End":s=o.length-1;break;case"ArrowRight":case"ArrowDown":s=e===-1?0:(e+1)%o.length;break;default:s=e===-1?0:(e-1+o.length)%o.length}this.activeButton=o[s],this.applyTabindexValues(),this.activeButton.focus()}handleFocusIn(t){if(!this.toolbar)return;const o=t.composedPath(),e=this.getButtons().find(s=>this.isEnabled(s)&&o.includes(s));e&&e!==this.activeButton&&(this.activeButton=e,this.applyTabindexValues())}firstUpdated(){this.applyRovingTabindex()}updated(t){super.updated(t),t.has("toolbar")&&(this.toolbar?this.applyRovingTabindex():this.clearRovingTabindex())}render(){return c`
|
|
2
2
|
<div
|
|
3
3
|
class="button-group"
|
|
4
4
|
role=${this.toolbar?"toolbar":"group"}
|
|
@@ -8,7 +8,7 @@ var u=function(r,t,o,e){var s=arguments.length,n=s<3?t:e===null?e=Object.getOwnP
|
|
|
8
8
|
>
|
|
9
9
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
10
10
|
</div>
|
|
11
|
-
`}};
|
|
11
|
+
`}};l.styles=d`
|
|
12
12
|
:host {
|
|
13
13
|
display: inline-flex;
|
|
14
14
|
}
|
|
@@ -26,7 +26,12 @@ var u=function(r,t,o,e){var s=arguments.length,n=s<3?t:e===null?e=Object.getOwnP
|
|
|
26
26
|
--esp-field-border-width: 0px;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
|
|
30
|
+
::slotted(esp-button) {
|
|
31
|
+
--_esp-button-group-border-width: 0px;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
::slotted(:not(:first-child)) {
|
|
30
35
|
border-left: var(--esp-button-group-divider, 1px dotted var(--esp-color-border));
|
|
31
36
|
}
|
|
32
|
-
`,u([
|
|
37
|
+
`,u([p({type:String})],l.prototype,"label",void 0),u([p({type:Boolean})],l.prototype,"toolbar",void 0),l=u([f("esp-button-group")],l);export{l as EspalierButtonGroup};
|
|
@@ -80,6 +80,9 @@ export type ButtonIconPosition = "left" | "right";
|
|
|
80
80
|
* @csspart label - The text label, excluding icons and new-tab cues.
|
|
81
81
|
* @cssprop --esp-button-padding - The padding inside the button label and icon areas.
|
|
82
82
|
* @cssprop --esp-button-incognito-padding - The padding for the incognito button style.
|
|
83
|
+
* @cssprop --esp-button-border-width - The button's border width, from `0` to `0.5rem`. Defaults to `--esp-field-border-width`, then `1px`.
|
|
84
|
+
* @cssprop --esp-button-shadow - The button's resting shadow, drawn as a drop shadow. Set `none`, `1`, `2` or `3` in `componentProperties`, or raw CSS: `none` or `<x> <y> <blur> <color>` with no spread. Defaults to `none`.
|
|
85
|
+
* @cssprop --esp-button-press-offset - How far the button moves down and right while pressed, from `0` to `0.5rem`, with its shadow dropped. Reduced motion skips the move. Defaults to `0`.
|
|
83
86
|
* @attr incognito - Renders the button with a borderless, transparent treatment
|
|
84
87
|
* for quiet icon or inline actions.
|
|
85
88
|
* @attr aria-pressed - Forwards a toggle's pressed state to the inner native
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var i=function(h,t,
|
|
1
|
+
var i=function(h,t,a,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,a):o,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(h,t,a,o);else for(var c=h.length-1;c>=0;c--)(d=h[c])&&(n=(l<3?d(n):l>3?d(t,a,n):d(t,a))||n);return l>3&&n&&Object.defineProperty(t,a,n),n};import{css as f,html as p,nothing as s}from"lit";import{customElement as m,eventOptions as y,property as r,state as w}from"lit/decorators.js";import{classMap as b}from"lit/directives/class-map.js";import{EspalierElementBase as g}from"../shared/esp-element-base.js";import{ESP_EVENTS as k}from"../shared/events.js";import{ref as x}from"lit/directives/ref.js";import{getIconHrefForHost as T}from"../shared/intent-values.js";import{SlottedIconController as $}from"../shared/slotted-icon-controller.js";import{renderSpriteIcon as S}from"../shared/svgs/render-sprite-icon.js";import{DEFAULT_NEW_TAB_LABEL as E,newTabSuffix as z,renderNewTabCue as C}from"../shared/new-tab-cue.js";import{srOnly as N}from"../shared/style-fragments.js";import{BUTTON_INTERACTION_LIGHTNESS_FACTOR as _}from"./action-state-lightness.js";const v=f`var(--esp-button-padding, var(--_esp-button-default-padding, var(--esp-size-padding)))`,A=p`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
viewBox="0 0 24 24"
|
|
4
4
|
fill="none"
|
|
@@ -10,16 +10,16 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
10
10
|
>
|
|
11
11
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
12
12
|
<path d="M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5" />
|
|
13
|
-
</svg>`;let e=class extends
|
|
13
|
+
</svg>`;let e=class extends g{constructor(){super(...arguments),this.iconSlot=new $(this),this.innerTabindex=null,this.neutralizingTabindex=!1,this.buttonType="button",this.collapsed=!1,this.disabled=!1,this.href="",this.current=!1,this.iconOnly=!1,this.incognito=!1,this.icon="",this.iconPosition="right",this.label="",this.loading=!1,this.target="",this.rel="",this.newTabLabel=E,this.formNoValidate=!1,this.buildIcon=(t,a=!1)=>this.loading&&!a?p` <span>${A}</span> `:p`
|
|
14
14
|
<span>
|
|
15
|
-
<slot ${
|
|
15
|
+
<slot ${x(this.iconSlot.slotRef)} @slotchange=${this.iconSlot.handleSlotChange}></slot>
|
|
16
16
|
${!this.iconSlot.hasSlottedIcon(":scope > :not(slot)")&&t?S(t):s}
|
|
17
17
|
</span>
|
|
18
|
-
`}static get observedAttributes(){return[...super.observedAttributes,"tabindex","aria-pressed","aria-label"]}attributeChangedCallback(t,
|
|
18
|
+
`}static get observedAttributes(){return[...super.observedAttributes,"tabindex","aria-pressed","aria-label"]}attributeChangedCallback(t,a,o){if(super.attributeChangedCallback(t,a,o),t==="aria-pressed"||t==="aria-label"){this.requestUpdate();return}if(t!=="tabindex"||this.neutralizingTabindex)return;const l=o===null?null:Number(o),n=l===null||Number.isNaN(l)?null:l;n!==null&&n>=0?(this.innerTabindex=n,this.writeHostTabindex(null)):n===null&&o!==null?(this.innerTabindex=null,this.writeHostTabindex(null)):this.innerTabindex=n}writeHostTabindex(t){this.getAttribute("tabindex")!==t&&(this.neutralizingTabindex=!0,t===null?this.removeAttribute("tabindex"):this.setAttribute("tabindex",t),this.neutralizingTabindex=!1)}removeAttribute(t){super.removeAttribute(t),t==="tabindex"&&!this.neutralizingTabindex&&(this.innerTabindex=null)}focus(t){this.focusShadowElementAfterUpdate("button, a",t)}handleClick(t){if(this.dispatchEvent(new CustomEvent(k.CLICKED,{detail:{},bubbles:!0,composed:!0})),this.buttonType==="submit"){const a=this.closest("form");if(a){const o=document.createElement("button");o.type="submit",o.hidden=!0,this.formNoValidate&&(o.formNoValidate=!0),a.appendChild(o),a.requestSubmit(o),o.remove()}}else this.buttonType==="reset"&&this.closest("form")?.reset()}render(){const t=T(this.icon,this),a=this.current&&this.href.length>0,o=this.loading&&!a||this.iconSlot.hasSlottedIcon(":scope > :not(slot)")||t.length>0,{collapsed:l,iconOnly:n}=this,d=this.getAttribute("aria-label")||(n?this.label:"")||s,c=this.getAttribute("aria-pressed")||s,u={"esp-field":!0,"icon-only":n,incognito:this.incognito,"is-collapsed":l,"has-icon":o,"icon-left":o&&!n&&this.iconPosition==="left"};return a?p`<div part="wrapper" class=${b(u)}>
|
|
19
19
|
<span part="control" class="current-page" aria-current="page" aria-label=${n?d:s}>
|
|
20
20
|
<span part="label">${this.label??""}</span>${this.buildIcon(t,!0)}
|
|
21
21
|
</span>
|
|
22
|
-
</div>`:this.href.length?
|
|
22
|
+
</div>`:this.href.length?p`
|
|
23
23
|
<div part="wrapper" class=${b(u)}>
|
|
24
24
|
<a
|
|
25
25
|
part="control"
|
|
@@ -28,14 +28,14 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
28
28
|
target=${this.target||s}
|
|
29
29
|
rel=${this.rel||s}
|
|
30
30
|
tabindex=${this.innerTabindex??s}
|
|
31
|
-
aria-label=${d===s?s:`${d}${
|
|
31
|
+
aria-label=${d===s?s:`${d}${z(this.target,this.newTabLabel)}`}
|
|
32
32
|
>
|
|
33
33
|
<span part="label">${this.label??""}</span>
|
|
34
34
|
${this.buildIcon(t)}
|
|
35
|
-
${n?s:
|
|
35
|
+
${n?s:C(this.target,this.newTabLabel)}
|
|
36
36
|
</a>
|
|
37
37
|
</div>
|
|
38
|
-
`:
|
|
38
|
+
`:p`
|
|
39
39
|
<div part="wrapper" class=${b(u)}>
|
|
40
40
|
<button
|
|
41
41
|
part="control"
|
|
@@ -44,13 +44,13 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
44
44
|
type=${this.buttonType}
|
|
45
45
|
tabindex=${this.innerTabindex??s}
|
|
46
46
|
aria-label=${d}
|
|
47
|
-
aria-pressed=${
|
|
47
|
+
aria-pressed=${c}
|
|
48
48
|
>
|
|
49
49
|
<span part="label">${this.label??""}</span>
|
|
50
50
|
${this.buildIcon(t)}
|
|
51
51
|
</button>
|
|
52
52
|
</div>
|
|
53
|
-
`}};e.styles=[...
|
|
53
|
+
`}};e.styles=[...g.styles,N,f`
|
|
54
54
|
:host {
|
|
55
55
|
--_esp-button-radius: var(--esp-size-border-radius);
|
|
56
56
|
}
|
|
@@ -70,6 +70,9 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
70
70
|
|
|
71
71
|
.esp-field {
|
|
72
72
|
border-radius: var(--_esp-button-radius);
|
|
73
|
+
border-width: var(--_esp-button-group-border-width, var(--esp-button-border-width, var(--esp-field-border-width, 1px)));
|
|
74
|
+
|
|
75
|
+
filter: drop-shadow(var(--esp-button-shadow, none));
|
|
73
76
|
|
|
74
77
|
button,
|
|
75
78
|
a,
|
|
@@ -83,7 +86,7 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
83
86
|
cursor: pointer;
|
|
84
87
|
|
|
85
88
|
> span:nth-child(1) {
|
|
86
|
-
padding: ${
|
|
89
|
+
padding: ${v};
|
|
87
90
|
line-height: 1.3;
|
|
88
91
|
font-weight: bold;
|
|
89
92
|
display: flex;
|
|
@@ -94,7 +97,7 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
94
97
|
> span:nth-child(2) {
|
|
95
98
|
display: none;
|
|
96
99
|
place-content: center;
|
|
97
|
-
padding: ${
|
|
100
|
+
padding: ${v};
|
|
98
101
|
|
|
99
102
|
.generated-icon,
|
|
100
103
|
::slotted(svg),
|
|
@@ -195,6 +198,9 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
195
198
|
&.incognito {
|
|
196
199
|
background-color: transparent;
|
|
197
200
|
border-color: transparent;
|
|
201
|
+
border-width: var(--esp-field-border-width, 1px);
|
|
202
|
+
box-shadow: none;
|
|
203
|
+
filter: none;
|
|
198
204
|
color: var(--esp-color-text);
|
|
199
205
|
block-size: 100%;
|
|
200
206
|
|
|
@@ -239,6 +245,22 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
239
245
|
|
|
240
246
|
&:active {
|
|
241
247
|
box-shadow: none;
|
|
248
|
+
filter: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
&:has(> button:enabled:active, > a[href]:not([disabled]):active) {
|
|
253
|
+
|
|
254
|
+
position: relative;
|
|
255
|
+
translate: var(--esp-button-press-offset, none) var(--esp-button-press-offset, none);
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
button::after,
|
|
259
|
+
a::after {
|
|
260
|
+
content: "";
|
|
261
|
+
position: absolute;
|
|
262
|
+
inset: calc(-1 * var(--esp-button-press-offset, 0px)) 0 0 calc(-1 * var(--esp-button-press-offset, 0px));
|
|
263
|
+
}
|
|
242
264
|
}
|
|
243
265
|
|
|
244
266
|
&:has(button:disabled):hover,
|
|
@@ -255,6 +277,18 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
255
277
|
}
|
|
256
278
|
}
|
|
257
279
|
|
|
280
|
+
@media (prefers-reduced-motion: reduce) {
|
|
281
|
+
.esp-field:has(> button:enabled:active, > a[href]:not([disabled]):active) {
|
|
282
|
+
translate: none;
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
button::after,
|
|
286
|
+
a::after {
|
|
287
|
+
content: none;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
258
292
|
@keyframes rotate-360 {
|
|
259
293
|
0% {
|
|
260
294
|
transform: rotate(0deg);
|
|
@@ -263,4 +297,4 @@ var i=function(h,t,r,o){var l=arguments.length,n=l<3?t:o===null?o=Object.getOwnP
|
|
|
263
297
|
transform: rotate(360deg);
|
|
264
298
|
}
|
|
265
299
|
}
|
|
266
|
-
`],i([w()],e.prototype,"innerTabindex",void 0),i([
|
|
300
|
+
`],i([w()],e.prototype,"innerTabindex",void 0),i([r({attribute:"button-type",type:String})],e.prototype,"buttonType",void 0),i([r({type:Boolean})],e.prototype,"collapsed",void 0),i([r({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0),i([r({type:String})],e.prototype,"href",void 0),i([r({type:Boolean,reflect:!0})],e.prototype,"current",void 0),i([r({attribute:"icon-only",type:Boolean})],e.prototype,"iconOnly",void 0),i([r({type:Boolean,reflect:!0})],e.prototype,"incognito",void 0),i([r({type:String})],e.prototype,"icon",void 0),i([r({attribute:"icon-position",type:String})],e.prototype,"iconPosition",void 0),i([r({type:String})],e.prototype,"label",void 0),i([r({type:Boolean,reflect:!0})],e.prototype,"loading",void 0),i([r({type:String})],e.prototype,"target",void 0),i([r({type:String})],e.prototype,"rel",void 0),i([r({type:String,attribute:"new-tab-label"})],e.prototype,"newTabLabel",void 0),i([r({attribute:"formnovalidate",type:Boolean})],e.prototype,"formNoValidate",void 0),i([y({capture:!1,passive:!0})],e.prototype,"handleClick",null),e=i([m("esp-button")],e);export{e as EspalierButton};
|
|
@@ -222,6 +222,8 @@ import "./esp-footer-link-group.js";
|
|
|
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-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.
|
|
225
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)`.
|
|
@@ -235,13 +235,18 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
a.configured-brand {
|
|
238
|
+
transition: transform 0.24s ease;
|
|
238
239
|
text-decoration-line: var(--esp-footer-link-decoration, none);
|
|
239
240
|
text-underline-offset: var(--esp-footer-link-underline-offset, auto);
|
|
240
241
|
text-decoration-thickness: var(--esp-footer-link-underline-thickness, auto);
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
a.configured-brand:hover {
|
|
244
|
-
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);
|
|
245
250
|
color: var(--esp-footer-link-hover-color, var(--esp-color-link-hover));
|
|
246
251
|
text-decoration-line: underline;
|
|
247
252
|
text-underline-offset: var(--esp-footer-link-underline-offset, 0.18em);
|
|
@@ -276,6 +281,14 @@ var n=function(p,e,a,r){var o=arguments.length,l=o<3?e:r===null?r=Object.getOwnP
|
|
|
276
281
|
min-inline-size: 0;
|
|
277
282
|
}
|
|
278
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
|
+
|
|
279
292
|
@container esp-footer (max-width: 64rem) {
|
|
280
293
|
.footer-alignment-profile-probe {
|
|
281
294
|
inline-size: 1px;
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,o);else for(var d=c.length-1;d>=0;d--)(p=c[d])&&(s=(h<3?p(s):h>3?p(e,t,s):p(e,t))||s);return h>3&&s&&Object.defineProperty(e,t,s),s},l;import{footerHeadingFit as A,footerLinkFit as T}from"../shared/footer-ink-styles.js";import{surfaceLayerAttributes as L}from"../shared/surface-layer.js";import{css as D,html as F,LitElement as P}from"lit";import{customElement as O,property as n,state as I}from"lit/decorators.js";import{getEspBus as m}from"../shared/bus-events.js";import{GoverningRootObserver as z}from"../shared/governing-root.js";import{getComponentPropertyAnalysis as S}from"../shared/component-property-normalizer.js";import{addComponentPropertyResets as W}from"../shared/component-property-resets.js";import{ScopedStyleDeclarations as _}from"../shared/scoped-style-declarations.js";import{subscribeToRootEvent as B}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 U,removeRuntimeGoogleFontLinks as x,syncRuntimeGoogleFontLink as G}from"../shared/font-helpers.js";import{computeThemeProperties as M}from"./helpers/compute-theme-properties.js";import{registerImageTexture as H,registeredImageTextures as j}from"../shared/image-texture-registry.js";import{registerImageTexture as he,registeredImageTextures as ae,BUILT_IN_IMAGE_TEXTURES as le}from"../shared/image-texture-registry.js";const E=1e3;let r=l=class extends P{static registerTexture(e,t){H(e,t)}static registeredTextures(){return j()}subscribeScoped(e,t){return B(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 s=t||this.resolveDefaultScheme();h!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),s!==o&&(this.schemeBacker=s,this.requestUpdate("scheme",o),this.themeEventsReady&&(this.resolveThemes(),m().publish("scheme-changed",{scheme:s,correlationId:this.correlationId})))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,o){const h=`${this.correlationId}-${e}`,s=U(t)?"":t;G({owner:`root:${h}`,family:s,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 z(this,(t,o)=>{t!==o&&(this.outerComponentCandidates=void 0,this.applyComponentProperties(),t&&this.outerRootObserver.whenReady(this.syncOuterComponentCandidates))}),this.componentDeclarations=new _(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}=S(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&&W(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(a=>e.has(a)))&&(this.resolveThemes(),this.themeEventsReady&&m().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=this.activeTheme,{root:s,candidates:p}=S(h),d=M(h,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth},{surface:s}),b={};for(const a of p)Object.prototype.hasOwnProperty.call(d,a)&&(b[a]=d[a],delete d[a]);this.componentProperties=b,this.applyComponentProperties();const k=new Set(Object.keys(d));for(const a of this.appliedThemeProperties)k.has(a)||this.style.removeProperty(a);for(const[a,R]of Object.entries(d))this.style.setProperty(a,R);this.appliedThemeProperties=k;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=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 F`<slot></slot>`}};r.connectedRootCount=0,r.handleDocumentClick=c=>{const e=c.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");m().publish("close-popovers",{source:c.target??void 0,skipPopovers:e})},r.lightDomStyles=`
|
|
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
2
|
${L("esp-root [surface-layer]").cssText}
|
|
3
3
|
|
|
4
4
|
|
|
@@ -22,6 +22,16 @@ var i=function(c,e,t,o){var h=arguments.length,s=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 {
|
|
@@ -135,6 +145,25 @@ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnP
|
|
|
135
145
|
}
|
|
136
146
|
|
|
137
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
|
+
|
|
138
167
|
esp-root pre,
|
|
139
168
|
esp-root code {
|
|
140
169
|
font-family: var(--_esp-font-monospace-effective, var(--esp-font-monospace, monospace));
|
|
@@ -143,17 +172,17 @@ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnP
|
|
|
143
172
|
|
|
144
173
|
esp-root code {
|
|
145
174
|
font-size: var(--esp-type-small);
|
|
146
|
-
background: var(--esp-color-layer-1);
|
|
175
|
+
background: var(--esp-code-background, var(--esp-color-layer-1));
|
|
147
176
|
border-radius: var(--esp-size-border-radius);
|
|
148
177
|
padding: 0 0.35em;
|
|
149
178
|
display: inline-block;
|
|
150
|
-
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));
|
|
151
180
|
}
|
|
152
181
|
|
|
153
182
|
esp-root pre {
|
|
154
183
|
background-color: var(--esp-color-layer-1);
|
|
155
184
|
border-radius: var(--esp-size-border-radius);
|
|
156
|
-
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));
|
|
157
186
|
}
|
|
158
187
|
|
|
159
188
|
esp-root pre > code {
|
|
@@ -193,7 +222,7 @@ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnP
|
|
|
193
222
|
|
|
194
223
|
esp-root esp-footer a,
|
|
195
224
|
esp-root esp-footer a:not([class]) {
|
|
196
|
-
${
|
|
225
|
+
${S.cssText}
|
|
197
226
|
color: var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)));
|
|
198
227
|
}
|
|
199
228
|
|
|
@@ -217,7 +246,7 @@ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnP
|
|
|
217
246
|
}
|
|
218
247
|
|
|
219
248
|
esp-root esp-footer a:focus-visible {
|
|
220
|
-
${
|
|
249
|
+
${S.cssText}
|
|
221
250
|
outline: var(
|
|
222
251
|
--esp-footer-focus-outline,
|
|
223
252
|
2px solid var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)))
|
|
@@ -238,4 +267,4 @@ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnP
|
|
|
238
267
|
:host([theme-pending]:not([data-theme-ready])) {
|
|
239
268
|
visibility: hidden;
|
|
240
269
|
}
|
|
241
|
-
`,
|
|
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};
|
|
@@ -32,10 +32,10 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
|
|
|
32
32
|
* meet the band's edges; the band's zone behavior is unaffected.
|
|
33
33
|
*
|
|
34
34
|
* A section may also tint one raster alpha mask behind its content.
|
|
35
|
-
* The component owns clipping,
|
|
36
|
-
*
|
|
37
|
-
* attribute and supply only the image,
|
|
38
|
-
* opacity:
|
|
35
|
+
* The component owns clipping, stacking, and interaction isolation, and the
|
|
36
|
+
* mask does not repeat unless the consumer sets `--esp-section-decoration-repeat`.
|
|
37
|
+
* Consumers opt in with the `decoration` attribute and supply only the image,
|
|
38
|
+
* semantic tint, position, size, repeat, and opacity:
|
|
39
39
|
*
|
|
40
40
|
* ```html
|
|
41
41
|
* <esp-section
|
|
@@ -75,6 +75,7 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
|
|
|
75
75
|
* @cssprop --esp-section-decoration-image - Raster alpha mask painted behind the well when `decoration` is set. Defaults to `none`.
|
|
76
76
|
* @cssprop --esp-section-decoration-color - Semantic tint applied through the mask. Defaults to the local `--esp-color-headings`.
|
|
77
77
|
* @cssprop --esp-section-decoration-position - Mask position, including responsive or bleeding values. Defaults to `center`.
|
|
78
|
+
* @cssprop --esp-section-decoration-repeat - Mask repeat: `no-repeat`, `repeat`, `repeat-x` or `repeat-y`. Defaults to `no-repeat`; the others tile a pattern mask across the band.
|
|
78
79
|
* @cssprop --esp-section-decoration-size - Mask size. Defaults to `contain`.
|
|
79
80
|
* @cssprop --esp-section-decoration-opacity - Decoration opacity from `0` through `1`. Defaults to `1`.
|
|
80
81
|
* @docPageTitle Section
|
|
@@ -30,7 +30,7 @@ var p=function(r,t,o,a){var n=arguments.length,e=n<3?t:a===null?a=Object.getOwnP
|
|
|
30
30
|
--_esp-overlay-texture-mask:
|
|
31
31
|
var(--esp-section-decoration-image, none), linear-gradient(transparent, transparent);
|
|
32
32
|
--_esp-overlay-texture-mask-position: var(--esp-section-decoration-position, center);
|
|
33
|
-
--_esp-overlay-texture-mask-repeat: no-repeat;
|
|
33
|
+
--_esp-overlay-texture-mask-repeat: var(--esp-section-decoration-repeat, no-repeat);
|
|
34
34
|
--_esp-overlay-texture-mask-size: var(--esp-section-decoration-size, contain);
|
|
35
35
|
--_esp-overlay-texture-opacity: var(--esp-section-decoration-opacity, 1);
|
|
36
36
|
}
|