@taprootio/espalier 7.0.0 → 7.1.1

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.
@@ -1,12 +1,14 @@
1
- var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,o):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(p,e,o,a);else for(var l=p.length-1;l>=0;l--)(d=p[l])&&(s=(i<3?d(s):i>3?d(e,o,s):d(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};import{paintedSurface as v}from"../shared/surface-layer.js";import{css as u,html as y,nothing as k}from"lit";import{customElement as S,property as n,state as x}from"lit/decorators.js";import{styleMap as c}from"lit/directives/style-map.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as z,configuredBrandLogoGeometry as B,renderConfiguredBrand as C,resolveConfiguredBrand as _}from"../shared/configured-brand.js";import{syncNormalizedAttribute as f}from"../shared/attribute-helpers.js";import{EspalierElementBase as b}from"../shared/esp-element-base.js";import{slotHasContent as g}from"../shared/slot-content.js";import{renderVisualOverlay as w,visualOverlayStyles as L}from"../shared/visual-overlay.js";import"./esp-footer-column.js";import"./esp-footer-link-group.js";const m={media:!1,brand:!1,groups:!1,aside:!1,bottom:!1};let t=class extends b{constructor(){super(...arguments),this.slotContent={...m},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 o=this.slotRegion(e.target);if(!o)return;const a=g(e.target);this.slotContent[o]!==a&&(this.slotContent={...this.slotContent,[o]:a})}}get brandSpan(){return this.brandSpanBacker}set brandSpan(e){const o=this.brandSpanBacker;this.brandSpanBacker=Number.isInteger(e)&&e>=1&&e<=3?e:1,this.requestUpdate("brandSpan",this.hasAttribute("brand-span")?o:void 0),f(this,"brand-span",String(this.brandSpanBacker))}get asideSpan(){return this.asideSpanBacker}set asideSpan(e){const o=this.asideSpanBacker;this.asideSpanBacker=Number.isInteger(e)&&e>=1&&e<=2?e:1,this.requestUpdate("asideSpan",this.hasAttribute("aside-span")?o:void 0),f(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 o={...m};for(const a of this.shadowRoot?.querySelectorAll("slot")??[]){const i=this.slotRegion(a);i&&(o[i]=g(a))}Object.entries(o).some(([a,i])=>this.slotContent[a]!==i)&&(this.slotContent=o)}render(){const{media:e,brand:o,groups:a,aside:i,bottom:s}=this.slotContent,d=_({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor}),l=o||!!(d.brandLogo||this.brandText),h=l||a||i;return y`
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 f,footerAlignmentStyles as k}from"../shared/footer-alignment.js";import{FooterLogoGeometryController as x,footerNaturalLogoStyles as A,normalizeFooterLogoSizing as v}from"../shared/footer-logo-geometry.js";import{paintedSurface as y}from"../shared/surface-layer.js";import{css as S,html as w,nothing as B}from"lit";import{customElement as _,property as i,state as z}from"lit/decorators.js";import{styleMap as g}from"lit/directives/style-map.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as T,configuredBrandLogoGeometry as W,renderConfiguredBrand as C,resolveConfiguredBrand as I}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 L,visualOverlayStyles as $}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 f(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=v(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=I({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),h=d||r||o;return w`
2
2
  <footer
3
3
  part="footer"
4
- aria-label=${this.landmarkLabel||k}
5
- style=${c({"--_esp-footer-brand-color":d.brandColor||null})}
4
+ aria-label=${this.landmarkLabel||B}
5
+ style=${g({"--_esp-footer-brand-color":s.brandColor||null})}
6
6
  >
7
- ${w({className:"background",rootPart:"background"})}
7
+ ${L({className:"background",rootPart:"background"})}
8
8
  <div part="content" class="content-frame">
9
9
  <div class="content">
10
+
11
+ <span class="footer-alignment-profile-probe" aria-hidden="true"></span>
10
12
  <div part="media" class="media" ?hidden=${!e}>
11
13
  <slot name="media" @slotchange=${this.handleSlotChange}></slot>
12
14
  </div>
@@ -14,34 +16,45 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
14
16
  <div part="primary" class="primary" ?hidden=${!h}>
15
17
  <div
16
18
  part="brand"
17
- class="brand"
18
- style=${c({"--_esp-footer-span":String(this.brandSpan)})}
19
- ?hidden=${!l}
19
+ class="brand alignment-scope"
20
+ style=${g({...this.alignment.styles("brand"),"--_esp-footer-span":String(this.brandSpan)})}
21
+ ?hidden=${!d}
20
22
  >
21
- <slot name="brand" @slotchange=${this.handleSlotChange}
22
- >${C({brandLogo:d.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt})}</slot
23
- >
23
+ <div class="alignment-content">
24
+ <slot name="brand" @slotchange=${this.handleSlotChange}
25
+ >${C({brandLogo:s.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt})}</slot
26
+ >
27
+ </div>
24
28
  </div>
25
29
 
26
30
  <slot @slotchange=${this.handleSlotChange}></slot>
27
31
 
28
32
  <div
29
33
  part="aside"
30
- class="aside"
31
- style=${c({"--_esp-footer-span":String(this.asideSpan)})}
32
- ?hidden=${!i}
34
+ class="aside alignment-scope"
35
+ style=${g({...this.alignment.styles("aside"),"--_esp-footer-span":String(this.asideSpan)})}
36
+ ?hidden=${!o}
33
37
  >
34
- <slot name="aside" @slotchange=${this.handleSlotChange}></slot>
38
+ <div class="alignment-content">
39
+ <slot name="aside" @slotchange=${this.handleSlotChange}></slot>
40
+ </div>
35
41
  </div>
36
42
  </div>
37
43
 
38
- <div part="bottom" class="bottom" ?hidden=${!s}>
39
- <slot name="bottom" @slotchange=${this.handleSlotChange}></slot>
44
+ <div
45
+ part="bottom"
46
+ class="bottom alignment-scope"
47
+ style=${g(this.alignment.styles("bottom"))}
48
+ ?hidden=${!l}
49
+ >
50
+ <div class="alignment-content">
51
+ <slot name="bottom" @slotchange=${this.handleSlotChange}></slot>
52
+ </div>
40
53
  </div>
41
54
  </div>
42
55
  </div>
43
56
  </footer>
44
- `}};t.styles=[...b.styles,v(2),B,u`
57
+ `}};t.styles=[...b.styles,y(2),W,k,A,S`
45
58
  :host {
46
59
  display: block;
47
60
  min-inline-size: 0;
@@ -98,6 +111,46 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
98
111
  padding-inline: var(--esp-footer-padding-inline, var(--esp-size-padding-page));
99
112
  }
100
113
 
114
+ .footer-alignment-profile-probe {
115
+ position: absolute;
116
+ visibility: hidden;
117
+ pointer-events: none;
118
+ inline-size: 0px;
119
+ block-size: 1px;
120
+ }
121
+
122
+ .brand,
123
+ .aside,
124
+ .bottom {
125
+ display: var(--_esp-footer-region-display, block);
126
+ flex-direction: var(--_esp-footer-region-direction, row);
127
+ align-self: var(--_esp-footer-block-self, auto);
128
+ }
129
+ .alignment-content {
130
+ display: var(--_esp-footer-wrapper-display, block);
131
+ min-inline-size: 0;
132
+ max-inline-size: 100%;
133
+ inline-size: var(--_esp-footer-content-width, auto);
134
+ align-self: var(--_esp-footer-content-self, auto);
135
+ text-align: var(--_esp-footer-text-css, inherit);
136
+ }
137
+ .aside ::slotted(p),
138
+ .bottom ::slotted(p) {
139
+ text-align: var(--_esp-footer-prose-css, inherit);
140
+ text-align-last: var(--_esp-footer-prose-last-line, inherit);
141
+ word-spacing: var(--_esp-footer-prose-word-spacing, inherit);
142
+ }
143
+ .brand {
144
+ --_esp-footer-logo-size: var(--esp-footer-brand-logo-size, 3rem);
145
+ --_esp-footer-logo-max-width: var(--esp-footer-brand-logo-max-width, 12rem);
146
+ --_esp-footer-image-inline-start: left;
147
+ --_esp-footer-image-inline-end: right;
148
+ }
149
+ :host(:dir(rtl)) .brand {
150
+ --_esp-footer-image-inline-start: right;
151
+ --_esp-footer-image-inline-end: left;
152
+ }
153
+
101
154
  .media,
102
155
  .primary,
103
156
  .brand,
@@ -148,8 +201,9 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
148
201
  }
149
202
 
150
203
  .configured-brand {
151
- display: inline-flex;
152
- align-items: center;
204
+
205
+ display: var(--_esp-footer-lockup-display, inline-flex);
206
+ align-items: var(--_esp-footer-lockup-block, center);
153
207
  gap: var(--esp-size-small);
154
208
  max-inline-size: 100%;
155
209
  color: var(
@@ -198,19 +252,26 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
198
252
  .brand-logo {
199
253
 
200
254
  aspect-ratio: auto
201
- var(--esp-footer-brand-logo-aspect-ratio, ${z});
255
+ var(--esp-footer-brand-logo-aspect-ratio, ${T});
202
256
  display: block;
203
257
  inline-size: auto;
204
- max-inline-size: min(var(--esp-footer-brand-logo-max-width, 12rem), 100%);
205
- block-size: var(--esp-footer-brand-logo-size, 3rem);
258
+
259
+ max-inline-size: var(--_esp-footer-image-cap, min(var(--_esp-footer-logo-max-width), 100%));
260
+ min-inline-size: var(--_esp-footer-image-min, auto);
261
+ block-size: var(--_esp-footer-logo-size);
206
262
  object-fit: contain;
263
+ object-position: var(--_esp-footer-image-x, center) var(--_esp-footer-image-y, center);
207
264
  }
208
265
 
209
266
  .brand-text {
267
+ text-align: var(--_esp-footer-text-css, inherit);
210
268
  min-inline-size: 0;
211
269
  }
212
270
 
213
271
  @container esp-footer (max-width: 64rem) {
272
+ .footer-alignment-profile-probe {
273
+ inline-size: 1px;
274
+ }
214
275
  .primary {
215
276
  flex-wrap: wrap;
216
277
  }
@@ -221,6 +282,9 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
221
282
  }
222
283
 
223
284
  @container esp-footer (max-width: 48rem) {
285
+ .footer-alignment-profile-probe {
286
+ inline-size: 2px;
287
+ }
224
288
  .brand,
225
289
  .aside,
226
290
  .primary ::slotted(esp-footer-column),
@@ -235,18 +299,15 @@ var r=function(p,e,o,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnP
235
299
  );
236
300
  }
237
301
 
238
- .brand-logo {
239
- block-size: var(
302
+ .brand {
303
+ --_esp-footer-logo-size: var(
240
304
  --esp-footer-brand-logo-size-compact,
241
305
  var(--esp-footer-brand-logo-size, 3rem)
242
306
  );
243
- max-inline-size: min(
244
- var(
245
- --esp-footer-brand-logo-max-width-compact,
246
- var(--esp-footer-brand-logo-max-width, 12rem)
247
- ),
248
- 100%
307
+ --_esp-footer-logo-max-width: var(
308
+ --esp-footer-brand-logo-max-width-compact,
309
+ var(--esp-footer-brand-logo-max-width, 12rem)
249
310
  );
250
311
  }
251
312
  }
252
- `,L],r([x()],t.prototype,"slotContent",void 0),r([n({attribute:"brand-text",type:String})],t.prototype,"brandText",void 0),r([n({attribute:"brand-logo",type:String})],t.prototype,"brandLogo",void 0),r([n({attribute:"light-brand-logo",type:String})],t.prototype,"lightBrandLogo",void 0),r([n({attribute:"dark-brand-logo",type:String})],t.prototype,"darkBrandLogo",void 0),r([n({attribute:"brand-href",type:String})],t.prototype,"brandHref",void 0),r([n({attribute:"brand-alt",type:String})],t.prototype,"brandAlt",void 0),r([n({attribute:"brand-color",type:String})],t.prototype,"brandColor",void 0),r([n({attribute:"light-brand-color",type:String})],t.prototype,"lightBrandColor",void 0),r([n({attribute:"dark-brand-color",type:String})],t.prototype,"darkBrandColor",void 0),r([n({attribute:"brand-span",type:Number,reflect:!0})],t.prototype,"brandSpan",null),r([n({attribute:"aside-span",type:Number,reflect:!0})],t.prototype,"asideSpan",null),r([n({attribute:"full-bleed-content",type:Boolean,reflect:!0})],t.prototype,"fullBleedContent",void 0),r([n({attribute:"landmark-label",type:String})],t.prototype,"landmarkLabel",void 0),t=r([S("esp-footer")],t);export{t as EspalierFooter};
313
+ `,$],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([z()],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([_("esp-footer")],t);export{t as EspalierFooter};
@@ -1,3 +1,5 @@
1
1
  export * from "./esp-footer-column.js";
2
2
  export * from "./esp-footer-link-group.js";
3
3
  export * from "./esp-footer.js";
4
+ export type { FooterPlacement, FooterTextAlign, FooterLayout, FooterLayoutChangedDetail, } from "../shared/footer-alignment.js";
5
+ export type { FooterLogoSizing } from "../shared/footer-logo-geometry.js";
@@ -148,6 +148,9 @@ var l=function(y,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnP
148
148
 
149
149
  .scrim {
150
150
  position: fixed;
151
+
152
+ width: auto;
153
+ height: auto;
151
154
  top: var(--esp-menu-top-offset, 0px);
152
155
  left: 0;
153
156
  right: 0;
@@ -162,6 +162,16 @@ export declare class EspalierRoot extends LitElement implements SeedColorRoot {
162
162
  * @param handler Callback invoked with that event's typed payload.
163
163
  */
164
164
  subscribeScoped<K extends keyof SchemeEvents>(event: K, handler: (payload: SchemeEvents[K]) => void): () => void;
165
+ /**
166
+ * Optional viewport width in CSS pixels for nested previews. Freezes only
167
+ * design-system scale viewport terms; rem still follows the HTML root.
168
+ * Does not resize the frame, affect queries or caller-authored vw, change
169
+ * the theme, or load fonts. Missing/invalid/non-positive values use ordinary
170
+ * browser-viewport scaling. Positive finite fractional widths are supported.
171
+ * Attributes accept trimmed decimal/scientific notation with an optional sign.
172
+ */
173
+ get virtualViewportWidth(): number | undefined;
174
+ set virtualViewportWidth(value: number | undefined);
165
175
  /**
166
176
  * Base64-encoded JSON partial theme for the **light** scheme.
167
177
  *
@@ -1,5 +1,5 @@
1
- var r=function(m,e,t,i){var h=arguments.length,s=h<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(m,e,t,i);else for(var l=m.length-1;l>=0;l--)(c=m[l])&&(s=(h<3?c(s):h>3?c(e,t,s):c(e,t))||s);return h>3&&s&&Object.defineProperty(e,t,s),s},a;import{surfaceLayerAttributes as b}from"../shared/surface-layer.js";import{css as w,html as E,LitElement as C}from"lit";import{customElement as R,property as n,state as x}from"lit/decorators.js";import{getEspBus as d}from"../shared/bus-events.js";import{subscribeToRootEvent as L}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as f,DEFAULT_DARK_THEME as g,encodeTheme as y,parseTheme as u,mergeTheme as v}from"../shared/theme.js";import{extractFamily as p,isLocalFontFamily as A,removeRuntimeGoogleFontLinks as S,syncRuntimeGoogleFontLink as D}from"../shared/font-helpers.js";import{computeThemeProperties as F}from"./helpers/compute-theme-properties.js";import{registerImageTexture as I,registeredImageTextures as z}from"../shared/image-texture-registry.js";import{registerImageTexture as N,registeredImageTextures as V,BUILT_IN_IMAGE_TEXTURES as q}from"../shared/image-texture-registry.js";const T=1e3;let o=a=class extends C{constructor(){super(...arguments),this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightTheme={...f},this.resolvedDarkTheme={...g},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.resizeObserver=new ResizeObserver(()=>{d().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=e=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=e.matches?"dark":"light",this.resolvingDefaultScheme=!1)}}static registerTexture(e,t){I(e,t)}static registeredTextures(){return z()}subscribeScoped(e,t){return L(this,e,t)}get lightTheme(){return this.lightThemeAttr?u(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?y(e):""}get darkTheme(){return this.darkThemeAttr?u(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?y(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":"",i=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!==i&&(this.schemeBacker=s,this.requestUpdate("scheme",i),this.themeEventsReady&&d().publish("scheme-changed",{scheme:s,correlationId:this.correlationId}))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,i){const h=`${this.correlationId}-${e}`,s=A(t)?"":t;D({owner:`root:${h}`,family:s,weight:i,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",p(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",p(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",p(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",p(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",p(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){S(`root:${this.correlationId}-`),S(`picker:${this.correlationId}:`)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){const e=this.lightThemeAttr?u(this.lightThemeAttr):null;this.resolvedLightTheme=e?v(f,e):{...f};const t=this.darkThemeAttr?u(this.darkThemeAttr):null;this.resolvedDarkTheme=t?v(g,t):{...g}}connectedCallback(){super.connectedCallback(),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&&d().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=F(this.activeTheme,this.scheme==="dark"?"dark":"light"),s=new Set(Object.keys(h));for(const l of this.appliedThemeProperties)s.has(l)||this.style.removeProperty(l);for(const[l,k]of Object.entries(h))this.style.setProperty(l,k);this.appliedThemeProperties=s;const c=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==c&&d().publish("seed-color-changed",{seedColor:c,correlationId:this.correlationId}),this.lastSeedColor=c,this.themeEventsReady&&e.has("iconSpriteUrl")&&d().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 i=document.createElement("link");i.rel="stylesheet",i.href=t,document.head.appendChild(i)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=a.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()+T;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 ${T}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.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,a.connectedRootCount+=1,a.connectedRootCount===1&&document.addEventListener("click",a.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,a.connectedRootCount=Math.max(0,a.connectedRootCount-1),a.connectedRootCount===0&&document.removeEventListener("click",a.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 E`<slot></slot>`}};o.connectedRootCount=0,o.handleDocumentClick=m=>{const e=m.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");d().publish("close-popovers",{source:m.target??void 0,skipPopovers:e})},o.lightDomStyles=`
2
- ${b("esp-root [surface-layer]").cssText}
1
+ var r=function(c,e,t,s){var h=arguments.length,i=h<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(c,e,t,s);else for(var l=c.length-1;l>=0;l--)(d=c[l])&&(i=(h<3?d(i):h>3?d(e,t,i):d(e,t))||i);return h>3&&i&&Object.defineProperty(e,t,i),i},a;import{surfaceLayerAttributes as T}from"../shared/surface-layer.js";import{css as w,html as E,LitElement as C}from"lit";import{customElement as R,property as n,state as x}from"lit/decorators.js";import{getEspBus as m}from"../shared/bus-events.js";import{subscribeToRootEvent as A}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as f,DEFAULT_DARK_THEME as g,encodeTheme as v,parseTheme as u,mergeTheme as y}from"../shared/theme.js";import{extractFamily as p,isLocalFontFamily as L,removeRuntimeGoogleFontLinks as S,syncRuntimeGoogleFontLink as D}from"../shared/font-helpers.js";import{computeThemeProperties as F}from"./helpers/compute-theme-properties.js";import{registerImageTexture as I,registeredImageTextures as W}from"../shared/image-texture-registry.js";import{registerImageTexture as Q,registeredImageTextures as N,BUILT_IN_IMAGE_TEXTURES as q}from"../shared/image-texture-registry.js";const k=1e3;let o=a=class extends C{constructor(){super(...arguments),this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightTheme={...f},this.resolvedDarkTheme={...g},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.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=e=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=e.matches?"dark":"light",this.resolvingDefaultScheme=!1)}}static registerTexture(e,t){I(e,t)}static registeredTextures(){return W()}subscribeScoped(e,t){return A(this,e,t)}get virtualViewportWidth(){return this.virtualViewportWidthBacker}set virtualViewportWidth(e){const t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,s=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",s)}get lightTheme(){return this.lightThemeAttr?u(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?v(e):""}get darkTheme(){return this.darkThemeAttr?u(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?v(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":"",s=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!==s&&(this.schemeBacker=i,this.requestUpdate("scheme",s),this.themeEventsReady&&m().publish("scheme-changed",{scheme:i,correlationId:this.correlationId}))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,s){const h=`${this.correlationId}-${e}`,i=L(t)?"":t;D({owner:`root:${h}`,family:i,weight:s,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",p(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",p(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",p(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",p(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",p(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){S(`root:${this.correlationId}-`),S(`picker:${this.correlationId}:`)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){const e=this.lightThemeAttr?u(this.lightThemeAttr):null;this.resolvedLightTheme=e?y(f,e):{...f};const t=this.darkThemeAttr?u(this.darkThemeAttr):null;this.resolvedDarkTheme=t?y(g,t):{...g}}connectedCallback(){super.connectedCallback(),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=F(this.activeTheme,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth}),i=new Set(Object.keys(h));for(const l of this.appliedThemeProperties)i.has(l)||this.style.removeProperty(l);for(const[l,b]of Object.entries(h))this.style.setProperty(l,b);this.appliedThemeProperties=i;const d=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==d&&m().publish("seed-color-changed",{seedColor:d,correlationId:this.correlationId}),this.lastSeedColor=d,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 s=document.createElement("link");s.rel="stylesheet",s.href=t,document.head.appendChild(s)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=a.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()+k;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 ${k}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.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,a.connectedRootCount+=1,a.connectedRootCount===1&&document.addEventListener("click",a.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,a.connectedRootCount=Math.max(0,a.connectedRootCount-1),a.connectedRootCount===0&&document.removeEventListener("click",a.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 E`<slot></slot>`}};o.connectedRootCount=0,o.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})},o.lightDomStyles=`
2
+ ${T("esp-root [surface-layer]").cssText}
3
3
 
4
4
 
5
5
  esp-root {
@@ -171,4 +171,4 @@ var r=function(m,e,t,i){var h=arguments.length,s=h<3?e:i===null?i=Object.getOwnP
171
171
  :host([theme-pending]:not([data-theme-ready])) {
172
172
  visibility: hidden;
173
173
  }
174
- `,r([n({attribute:!1})],o.prototype,"correlationId",void 0),r([n({attribute:"light-theme"})],o.prototype,"lightThemeAttr",void 0),r([n({attribute:"dark-theme"})],o.prototype,"darkThemeAttr",void 0),r([n({attribute:!1})],o.prototype,"lightTheme",null),r([n({attribute:!1})],o.prototype,"darkTheme",null),r([n({attribute:"font-css-root",type:String})],o.prototype,"fontCSSRoot",void 0),r([n({attribute:"font-definitions-url",type:String})],o.prototype,"fontDefinitionsUrl",void 0),r([n({attribute:"google-font-loading",type:String})],o.prototype,"googleFontLoading",void 0),r([n({attribute:"icon-sprite-url",type:String})],o.prototype,"iconSpriteUrl",void 0),r([n({attribute:"theme-pending",reflect:!0,type:Boolean})],o.prototype,"themePending",void 0),r([x()],o.prototype,"themeReadyState",void 0),r([n({attribute:"default-scheme",type:String,reflect:!0})],o.prototype,"defaultScheme",void 0),r([n({attribute:"scheme",type:String,reflect:!0})],o.prototype,"scheme",null),o=a=r([R("esp-root")],o);export{q as BUILT_IN_IMAGE_TEXTURES,o as EspalierRoot,N as registerImageTexture,V as registeredImageTextures};
174
+ `,r([n({attribute:!1})],o.prototype,"correlationId",void 0),r([n({attribute:"virtual-viewport-width",noAccessor:!0,converter:{fromAttribute:c=>{const e=c?.trim()??"";return/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}}})],o.prototype,"virtualViewportWidth",null),r([n({attribute:"light-theme"})],o.prototype,"lightThemeAttr",void 0),r([n({attribute:"dark-theme"})],o.prototype,"darkThemeAttr",void 0),r([n({attribute:!1})],o.prototype,"lightTheme",null),r([n({attribute:!1})],o.prototype,"darkTheme",null),r([n({attribute:"font-css-root",type:String})],o.prototype,"fontCSSRoot",void 0),r([n({attribute:"font-definitions-url",type:String})],o.prototype,"fontDefinitionsUrl",void 0),r([n({attribute:"google-font-loading",type:String})],o.prototype,"googleFontLoading",void 0),r([n({attribute:"icon-sprite-url",type:String})],o.prototype,"iconSpriteUrl",void 0),r([n({attribute:"theme-pending",reflect:!0,type:Boolean})],o.prototype,"themePending",void 0),r([x()],o.prototype,"themeReadyState",void 0),r([n({attribute:"default-scheme",type:String,reflect:!0})],o.prototype,"defaultScheme",void 0),r([n({attribute:"scheme",type:String,reflect:!0})],o.prototype,"scheme",null),o=a=r([R("esp-root")],o);export{q as BUILT_IN_IMAGE_TEXTURES,o as EspalierRoot,Q as registerImageTexture,N as registeredImageTextures};
@@ -1 +1 @@
1
- import{parseCssColor as f,serializeOklch as u,gamutMapToSRGB as m}from"../../shared/color-engine.js";import{generateScaleProperties as y}from"../../shared/scale-engine.js";import{DATA_SERIES_KEYS as b,DEFAULT_DATA_PALETTE as k,generateDivergingRamp as v,generateSequentialRamp as O}from"../../shared/data-colors.js";import{DEFAULT_BODY_FONT_FAMILY as B,DEFAULT_MONOSPACE_FONT_FAMILY as R,resolveDataColorSource as w}from"../../shared/theme.js";import{dataCompanionProperties as E}from"./data-companion-properties.js";import{lightnessRampProperties as I}from"./lightness-ramp-properties.js";import{surfacePolarityProperty as $}from"./surface-polarity-property.js";import{computeVariants as M}from"./compute-variants.js";import{computeSemanticProperties as P}from"./compute-semantic-properties.js";function T(o){return{rootFontSize:o.rootFontSize,typeRatio:o.typeRatio,spaceRatio:o.spaceRatio,borderRadius:o.borderRadius,viewportMin:o.viewportMin,viewportMax:o.viewportMax}}function x(o,d,g){const i={},a=o.dataPalette??k;for(let r=0;r<b.length;r+=1){const p=b[r],t=f(g(a[p],`dataPalette.${p}`))??d;i[`--esp-color-series-${r+1}`]=u(m(t))}return i}function Y(o,d,g){const i=f(o.seedColor);if(!i)return{};const a={};a["--esp-scheme"]=d,a["--esp-seed-color"]=o.seedColor;const r=M(i,o);for(const[e,n]of Object.entries(r))a[`--esp-color-${e}`]=u(m(n));const p=new Set,t=(e,n)=>{const s=typeof e=="string"?w(e,o.anchors):null;if(s)return s;const c=typeof e=="string"?e:String(e);return p.has(c)||(p.add(c),console.warn(`Espalier theme: ${n} color source "${c}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared data colors.`)),o.seedColor};Object.assign(a,x(o,i,t));for(const[e,n]of Object.entries(o.dataRamps??{}))try{(n.type==="sequential"?O(t(n.source,`dataRamps.${e}.source`),{steps:n.steps,lightnessStart:n.lightnessStart,lightnessEnd:n.lightnessEnd}):v(t(n.start,`dataRamps.${e}.start`),t(n.end,`dataRamps.${e}.end`),{steps:n.steps,neutral:n.neutral===void 0?void 0:t(n.neutral,`dataRamps.${e}.neutral`)})).forEach((c,S)=>{a[`--esp-color-ramp-${e}-${S+1}`]=c})}catch(s){console.warn(`Espalier theme: dataRamps.${e} cannot be generated \u2014 ${s instanceof Error?s.message:String(s)}`)}Object.assign(a,I(o));const l=new Set;return Object.assign(a,P(o,r,{trace:g,onUnresolvedSource:e=>{l.has(e)||(l.add(e),console.warn(`Espalier theme: color source "${e}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared anchors.`))}})),Object.assign(a,$(a)),Object.assign(a,E(a)),Object.assign(a,y(T(o))),a["--esp-font-body"]=o.fontBody||B,o.fontHeadings&&(a["--esp-font-headings"]=o.fontHeadings),o.fontBrand&&(a["--esp-font-brand"]=o.fontBrand),o.fontMenu&&(a["--esp-font-menu"]=o.fontMenu),a["--esp-font-monospace"]=o.fontMonospace||R,a["--esp-font-weight-body"]=o.fontWeightBody,a["--esp-font-weight-headings"]=o.fontWeightHeadings,a["--esp-font-weight-brand"]=o.fontWeightBrand,a["--esp-font-weight-menu"]=o.fontWeightMenu,a["--esp-font-weight-monospace"]=o.fontWeightMonospace,o.pageBackgroundImage&&(a["--esp-page-background-image"]=o.pageBackgroundImage),o.pageBackgroundImageOpacity!==void 0&&(a["--esp-page-background-image-opacity"]=o.pageBackgroundImageOpacity.toString()),o.boxBackgroundImage&&(a["--esp-box-background-image"]=o.boxBackgroundImage),o.boxBackgroundImageOpacity!==void 0&&(a["--esp-box-background-image-opacity"]=o.boxBackgroundImageOpacity.toString()),o.vellumOpacity!==void 0&&(a["--esp-vellum-opacity"]=o.vellumOpacity.toString()),o.vellumBackgroundImage&&(a["--esp-vellum-background-image"]=o.vellumBackgroundImage),o.vellumBackgroundImageOpacity!==void 0&&(a["--esp-vellum-background-image-opacity"]=o.vellumBackgroundImageOpacity.toString()),a}export{Y as computeThemeProperties,x as dataSeriesProperties};
1
+ import{parseCssColor as u,serializeOklch as m,gamutMapToSRGB as b}from"../../shared/color-engine.js";import{generateScaleProperties as v}from"../../shared/scale-engine.js";import{DATA_SERIES_KEYS as S,DEFAULT_DATA_PALETTE as k,generateDivergingRamp as O,generateSequentialRamp as B}from"../../shared/data-colors.js";import{DEFAULT_BODY_FONT_FAMILY as R,DEFAULT_MONOSPACE_FONT_FAMILY as w,resolveDataColorSource as E}from"../../shared/theme.js";import{dataCompanionProperties as I}from"./data-companion-properties.js";import{lightnessRampProperties as $}from"./lightness-ramp-properties.js";import{surfacePolarityProperty as M}from"./surface-polarity-property.js";import{computeVariants as P}from"./compute-variants.js";import{computeSemanticProperties as T}from"./compute-semantic-properties.js";function x(o){return{rootFontSize:o.rootFontSize,typeRatio:o.typeRatio,spaceRatio:o.spaceRatio,borderRadius:o.borderRadius,viewportMin:o.viewportMin,viewportMax:o.viewportMax}}function A(o,g,l){const c={},t=o.dataPalette??k;for(let a=0;a<S.length;a+=1){const s=S[a],d=u(l(t[s],`dataPalette.${s}`))??g;c[`--esp-color-series-${a+1}`]=m(b(d))}return c}function z(o,g,l,c={}){const t=u(o.seedColor);if(!t)return{};const a={};a["--esp-scheme"]=g,a["--esp-seed-color"]=o.seedColor;const s=P(t,o);for(const[e,n]of Object.entries(s))a[`--esp-color-${e}`]=m(b(n));const d=new Set,i=(e,n)=>{const r=typeof e=="string"?E(e,o.anchors):null;if(r)return r;const p=typeof e=="string"?e:String(e);return d.has(p)||(d.add(p),console.warn(`Espalier theme: ${n} color source "${p}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared data colors.`)),o.seedColor};Object.assign(a,A(o,t,i));for(const[e,n]of Object.entries(o.dataRamps??{}))try{(n.type==="sequential"?B(i(n.source,`dataRamps.${e}.source`),{steps:n.steps,lightnessStart:n.lightnessStart,lightnessEnd:n.lightnessEnd}):O(i(n.start,`dataRamps.${e}.start`),i(n.end,`dataRamps.${e}.end`),{steps:n.steps,neutral:n.neutral===void 0?void 0:i(n.neutral,`dataRamps.${e}.neutral`)})).forEach((p,y)=>{a[`--esp-color-ramp-${e}-${y+1}`]=p})}catch(r){console.warn(`Espalier theme: dataRamps.${e} cannot be generated \u2014 ${r instanceof Error?r.message:String(r)}`)}Object.assign(a,$(o));const f=new Set;return Object.assign(a,T(o,s,{trace:l,onUnresolvedSource:e=>{f.has(e)||(f.add(e),console.warn(`Espalier theme: color source "${e}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared anchors.`))}})),Object.assign(a,M(a)),Object.assign(a,I(a)),Object.assign(a,v(x(o),c.viewportWidth)),a["--esp-font-body"]=o.fontBody||R,o.fontHeadings&&(a["--esp-font-headings"]=o.fontHeadings),o.fontBrand&&(a["--esp-font-brand"]=o.fontBrand),o.fontMenu&&(a["--esp-font-menu"]=o.fontMenu),a["--esp-font-monospace"]=o.fontMonospace||w,a["--esp-font-weight-body"]=o.fontWeightBody,a["--esp-font-weight-headings"]=o.fontWeightHeadings,a["--esp-font-weight-brand"]=o.fontWeightBrand,a["--esp-font-weight-menu"]=o.fontWeightMenu,a["--esp-font-weight-monospace"]=o.fontWeightMonospace,o.pageBackgroundImage&&(a["--esp-page-background-image"]=o.pageBackgroundImage),o.pageBackgroundImageOpacity!==void 0&&(a["--esp-page-background-image-opacity"]=o.pageBackgroundImageOpacity.toString()),o.boxBackgroundImage&&(a["--esp-box-background-image"]=o.boxBackgroundImage),o.boxBackgroundImageOpacity!==void 0&&(a["--esp-box-background-image-opacity"]=o.boxBackgroundImageOpacity.toString()),o.vellumOpacity!==void 0&&(a["--esp-vellum-opacity"]=o.vellumOpacity.toString()),o.vellumBackgroundImage&&(a["--esp-vellum-background-image"]=o.vellumBackgroundImage),o.vellumBackgroundImageOpacity!==void 0&&(a["--esp-vellum-background-image-opacity"]=o.vellumBackgroundImageOpacity.toString()),a}export{z as computeThemeProperties,A as dataSeriesProperties};
@@ -1,4 +1,4 @@
1
- var c=function(f,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(f,e,t,r);else for(var n=f.length-1;n>=0;n--)(a=f[n])&&(s=(o<3?a(s):o>3?a(e,t,s):a(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s};import{css as C,LitElement as S}from"lit";import{property as h,state as w}from"lit/decorators.js";import{subscribeToRootEvent as p}from"./root-event-subscription.js";import{traverseToClosest as b}from"./utilities.js";import{parseCssColor as P,serializeOklch as x,gamutMapToSRGB as E}from"./color-engine.js";import{computeVariants as m}from"../root/helpers/compute-variants.js";import{computeSemanticProperties as v}from"../root/helpers/compute-semantic-properties.js";import{DocumentSpriteController as V}from"./document-sprite.js";import{dataCompanionProperties as U}from"../root/helpers/data-companion-properties.js";import{dataSeriesProperties as _}from"../root/helpers/compute-theme-properties.js";import{lightnessRampProperties as I}from"../root/helpers/lightness-ramp-properties.js";import{surfacePolarityProperty as A}from"../root/helpers/surface-polarity-property.js";import{ELEVATION_PROPERTIES as O,TYPE_ROLE_COLOR_PROPERTIES as D}from"./scale-engine.js";import{resolveContextTheme as y,resolveDataColorSource as z,semanticToCSS as N}from"./theme.js";import{alignAttributeTextInheritance as j,focusRing as F}from"./style-fragments.js";import{syncNormalizedAttribute as W}from"./attribute-helpers.js";import{INTENT_VARIANTS as k,normalizeIntentVariant as B}from"./intent-values.js";import{ESP_EVENTS as L}from"./events.js";import{surfaceLayerAttributes as T,surfaceLayerColor as q}from"./surface-layer.js";class i extends S{get seedColor(){return this.seedColorBacker}set seedColor(e){this.seedColorBacker=e}focusResolvedElementAfterUpdate(e,t){const r=()=>{const o=e();return o?(o.focus(t),!0):!1};r()||this.updateComplete.then(()=>{r()})}focusShadowElementAfterUpdate(e,t){this.focusResolvedElementAfterUpdate(()=>this.shadowRoot?.querySelector(e),t)}emitValueChanged(e){this.dispatchEvent(new CustomEvent(L.VALUE_CHANGED,{detail:e,bubbles:!0,composed:!0}))}get intent(){return this.intentBacker}set intent(e){const t=typeof e=="string"?e.trim():"";t!==""&&!k.includes(t)&&!this.warnedUnknownIntents.has(t)&&(this.warnedUnknownIntents.add(t),console.warn(`Espalier intent: "${t}" is not an intent; expected one of ${k.join(", ")}. Treating it as "neutral".`));const r=this.intentBacker,o=B(e);W(this,"intent",o),o!==r&&(this.intentBacker=o,this.requestUpdate("intent",r),this.applyTokensWhenRootReady())}get context(){return this.contextBacker}set context(e){const t=e??"";t!==this.contextBacker&&(this.contextBacker=t,this.applyTokensWhenRootReady(),this.refreshDescendantIntentDerivations())}refreshDescendantIntentDerivations(){const e=new Set,t=o=>{for(const s of Array.from(o.children))r(s)},r=o=>{if(!e.has(o)){if(e.add(o),o instanceof i&&o.applyTokensWhenRootReady(),o.shadowRoot&&t(o.shadowRoot),o instanceof HTMLSlotElement)for(const s of o.assignedElements({flatten:!0}))r(s);t(o)}};t(this),this.shadowRoot&&t(this.shadowRoot)}static flattenedParent(e){return e instanceof Element&&e.assignedSlot?e.assignedSlot:e instanceof ShadowRoot?e.host:e.parentNode}resolveAncestorZoneTheme(e){let t=i.flattenedParent(this);for(;t;){if(t instanceof Element&&t.localName==="esp-root")return null;if(t instanceof i){const r=t.contextBacker.trim();if(r){const o=this.resolveNamedContextTheme(e,r);if(o)return o}}t=i.flattenedParent(t)}return null}connectedCallback(){super.connectedCallback();const e=this.syncRootFromDom(!1);e&&this.subscribeToRootEvents(e)}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromRootEvents(),this.clearScopedTokens(),this.espRoot=null}firstUpdated(e){this.syncRootFromDom(!0),this.applyTokensWhenRootReady()}syncRootFromDom(e){const t=b(this,"esp-root");if(!t){if(this.espRoot&&this.clearScopedTokens(),this.unsubscribeFromRootEvents(),this.espRoot=null,!e)return null;throw new Error("No esp-root ancestor found. Espalier components must be placed inside an <esp-root> element.")}const r=t!==this.espRoot,s=t.scheme==="dark"?"dark":"light",a=this.scheme!==s,n=this.seedColor!==t.seedColor;return this.espRoot=t,r&&this.isConnected&&this.subscribeToRootEvents(t),(r||a||n)&&(this.scheme=s,this.seedColor=t.seedColor,this.applyTokensWhenRootReady()),r&&this.requestUpdate(),t}applyTokensWhenRootReady(){const e=this.espRoot;if(e&&(!e.hasUpdated||e.isUpdatePending)){this.applyTokensAfterInitialRootUpdate(e);return}this.applyScopedColorTokens()}applyTokensAfterInitialRootUpdate(e){if(this.pendingInitialThemeRoot===e)return;this.pendingInitialThemeRoot=e;const t=e.updateComplete;if(!t){this.pendingInitialThemeRoot=null,this.applyScopedColorTokens();return}t.then(()=>{this.pendingInitialThemeRoot===e&&(this.pendingInitialThemeRoot=null),!(!this.isConnected||this.espRoot!==e)&&(this.scheme=e.scheme==="dark"?"dark":"light",this.seedColor=e.seedColor,this.applyScopedColorTokens())})}subscribeToRootEvents(e){this.rootEventSubscriptionsActive&&this.subscribedRoot===e||(this.unsubscribeFromRootEvents(),this.subscribedRoot=e,this.rootEventUnsubscribers=[p(e,"seed-color-changed",this.handleSeedColorChanged),p(e,"scheme-changed",this.handleSchemeChanged),p(e,"theme-changed",this.handleThemeChanged),p(e,"icon-sprite-url-changed",this.handleIconSpriteUrlChanged)],this.rootEventSubscriptionsActive=!0)}unsubscribeFromRootEvents(){if(this.rootEventSubscriptionsActive){for(const e of this.rootEventUnsubscribers)e();this.rootEventUnsubscribers=[],this.subscribedRoot=null,this.rootEventSubscriptionsActive=!1}}constructor(){super(),this.seedColorBacker="oklch(0.7 0.125 216)",this.espRoot=null,this.contextBacker="",this.scopedTokenOriginalValues=new Map,this.warnedUnknownContexts=new Set,this.pendingInitialThemeRoot=null,this.rootEventSubscriptionsActive=!1,this.subscribedRoot=null,this.rootEventUnsubscribers=[],this.intentBacker="neutral",this.intentEmitsTokens=!0,this.warnedUnknownIntents=new Set,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.scheme="light",this.handleSeedColorChanged=e=>{this.syncRootFromDom(!1)&&(this.seedColor=e.seedColor,this.applyScopedColorTokens())},this.handleSchemeChanged=e=>{!this.syncRootFromDom(!1)||this.scheme===e.scheme||(this.scheme=e.scheme,this.applyScopedColorTokens())},this.handleThemeChanged=()=>{this.syncRootFromDom(!1)&&this.applyScopedColorTokens()},this.handleIconSpriteUrlChanged=()=>{this.syncRootFromDom(!1)&&this.requestUpdate()},new V(this,{reactToSpriteChanges:!1})}traverseToClosest(e){return b(this,e)}applyScopedColorTokens(){if(!this.espRoot)return;const e=this.intentEmitsTokens?i.intentColorSources[this.intentBacker]:"";if(!e&&!this.context.trim()){this.clearScopedTokens();return}const t=this.espRoot.activeTheme;if(!t){this.clearScopedTokens();return}const r=this.resolveContextTheme(t),o=r.theme,s=P(o.seedColor);if(!s)return;const a=m(s,o),n={};if(r.applied&&(Object.assign(n,v(o,a)),Object.assign(n,A(n)),Object.assign(n,I(o)),Object.assign(n,O),Object.assign(n,D),Object.assign(n,U(n,_(o,s,l=>(typeof l=="string"?z(l,o.anchors):null)??o.seedColor)))),e){let l=o;r.applied||(l=this.resolveAncestorZoneTheme(t)??o);const g=l===o?a:m(s,l),R=v(l,g,{effectiveSource:(u,d)=>i.semanticActionTokens.has(u)?e:d});n["--esp-color-primary"]=x(E(g[e]));for(const u of i.semanticActionTokens){const d=N(u);n[d]=R[d]}}this.applyScopedTokenProperties(n)}resolveContextTheme(e){const t=this.context.trim();if(!t)return{applied:!1,theme:e};const r=this.resolveNamedContextTheme(e,t);return r?{applied:!0,theme:r}:(this.warnUnknownContextWhenSettled(t),{applied:!1,theme:e})}warnUnknownContextWhenSettled(e){if(this.warnedUnknownContexts.has(e))return;const t=this.espRoot;if(t&&!t.themeSettled){t.whenThemeSettled().then(()=>{if(!this.isConnected||this.espRoot!==t||this.context.trim()!==e)return;const r=t.activeTheme;r&&y(r,e)||this.warnUnknownContextWhenSettled(e)});return}this.warnedUnknownContexts.add(e),console.warn(`Espalier context: "${e}" is not defined by the active theme; inheriting root tokens.`)}resolveNamedContextTheme(e,t){return y(e,t)}applyScopedTokenProperties(e){for(const t of this.scopedTokenOriginalValues.keys())t in e||this.restoreScopedTokenProperty(t);for(const[t,r]of Object.entries(e))this.setScopedTokenProperty(t,r)}setScopedTokenProperty(e,t){const r=this.scopedTokenOriginalValues.get(e);if(r){const o=this.style.getPropertyValue(e),s=this.style.getPropertyPriority(e);(o!==r.generatedValue||s!==r.generatedPriority)&&(r.originalValue=o.length?o:null,r.originalPriority=s),r.generatedValue=t,r.generatedPriority=""}else{const o=this.style.getPropertyValue(e);this.scopedTokenOriginalValues.set(e,{generatedPriority:"",generatedValue:t,originalPriority:this.style.getPropertyPriority(e),originalValue:o.length?o:null})}this.style.setProperty(e,t)}restoreScopedTokenProperty(e){const t=this.scopedTokenOriginalValues.get(e);if(!t)return;const r=this.style.getPropertyValue(e),o=this.style.getPropertyPriority(e);(r!==t.generatedValue||o!==t.generatedPriority)&&(t.originalValue=r.length?r:null,t.originalPriority=o),t.originalValue===null?this.style.removeProperty(e):this.style.setProperty(e,t.originalValue,t.originalPriority),this.scopedTokenOriginalValues.delete(e)}clearScopedTokens(){for(const e of[...this.scopedTokenOriginalValues.keys()])this.restoreScopedTokenProperty(e)}}i.intentColorSources={danger:"danger",info:"info",neutral:"",success:"success",warning:"warning"},i.semanticActionTokens=new Set(["actionBackground","actionText"]),i.styles=[T(":host"),T("[surface-layer]"),F(".esp-field:focus-within","--esp-field-focus-shadow"),j,C`
1
+ var c=function(f,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(f,e,t,r);else for(var n=f.length-1;n>=0;n--)(a=f[n])&&(s=(o<3?a(s):o>3?a(e,t,s):a(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s};import{css as C,LitElement as S}from"lit";import{property as h,state as w}from"lit/decorators.js";import{subscribeToRootEvent as p}from"./root-event-subscription.js";import{traverseToClosest as b}from"./utilities.js";import{parseCssColor as P,serializeOklch as x,gamutMapToSRGB as E}from"./color-engine.js";import{computeVariants as m}from"../root/helpers/compute-variants.js";import{computeSemanticProperties as v}from"../root/helpers/compute-semantic-properties.js";import{DocumentSpriteController as V}from"./document-sprite.js";import{dataCompanionProperties as _}from"../root/helpers/data-companion-properties.js";import{dataSeriesProperties as U}from"../root/helpers/compute-theme-properties.js";import{lightnessRampProperties as I}from"../root/helpers/lightness-ramp-properties.js";import{surfacePolarityProperty as A}from"../root/helpers/surface-polarity-property.js";import{ELEVATION_PROPERTIES as O,TYPE_ROLE_COLOR_PROPERTIES as D}from"./scale-engine.js";import{resolveContextTheme as y,resolveDataColorSource as z,semanticToCSS as N}from"./theme.js";import{alignAttributeTextInheritance as j,focusRing as F}from"./style-fragments.js";import{syncNormalizedAttribute as W}from"./attribute-helpers.js";import{INTENT_VARIANTS as k,normalizeIntentVariant as B}from"./intent-values.js";import{ESP_EVENTS as L}from"./events.js";import{surfaceLayerAttributes as T,surfaceLayerColor as q}from"./surface-layer.js";class i extends S{get seedColor(){return this.seedColorBacker}set seedColor(e){this.seedColorBacker=e}focusResolvedElementAfterUpdate(e,t){const r=()=>{const o=e();return o?(o.focus(t),!0):!1};r()||this.updateComplete.then(()=>{r()})}focusShadowElementAfterUpdate(e,t){this.focusResolvedElementAfterUpdate(()=>this.shadowRoot?.querySelector(e),t)}emitValueChanged(e){this.dispatchEvent(new CustomEvent(L.VALUE_CHANGED,{detail:e,bubbles:!0,composed:!0}))}get intent(){return this.intentBacker}set intent(e){const t=typeof e=="string"?e.trim():"";t!==""&&!k.includes(t)&&!this.warnedUnknownIntents.has(t)&&(this.warnedUnknownIntents.add(t),console.warn(`Espalier intent: "${t}" is not an intent; expected one of ${k.join(", ")}. Treating it as "neutral".`));const r=this.intentBacker,o=B(e);W(this,"intent",o),o!==r&&(this.intentBacker=o,this.requestUpdate("intent",r),this.applyTokensWhenRootReady())}get context(){return this.contextBacker}set context(e){const t=e??"";t!==this.contextBacker&&(this.contextBacker=t,this.applyTokensWhenRootReady(),this.refreshDescendantIntentDerivations())}refreshDescendantIntentDerivations(){const e=new Set,t=o=>{for(const s of Array.from(o.children))r(s)},r=o=>{if(!e.has(o)){if(e.add(o),o instanceof i&&o.applyTokensWhenRootReady(),o.shadowRoot&&t(o.shadowRoot),o instanceof HTMLSlotElement)for(const s of o.assignedElements({flatten:!0}))r(s);t(o)}};t(this),this.shadowRoot&&t(this.shadowRoot)}static flattenedParent(e){return e instanceof Element&&e.assignedSlot?e.assignedSlot:e instanceof ShadowRoot?e.host:e.parentNode}resolveAncestorZoneTheme(e){let t=i.flattenedParent(this);for(;t;){if(t instanceof Element&&t.localName==="esp-root")return null;if(t instanceof i){const r=t.contextBacker.trim();if(r){const o=this.resolveNamedContextTheme(e,r);if(o)return o}}t=i.flattenedParent(t)}return null}connectedCallback(){super.connectedCallback();const e=this.syncRootFromDom(!1);e&&this.subscribeToRootEvents(e)}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromRootEvents(),this.clearScopedTokens(),this.espRoot=null}firstUpdated(e){this.syncRootFromDom(!0),this.applyTokensWhenRootReady()}syncRootFromDom(e){const t=b(this,"esp-root");if(!t){if(this.espRoot&&this.clearScopedTokens(),this.unsubscribeFromRootEvents(),this.espRoot=null,!e)return null;throw new Error("No esp-root ancestor found. Espalier components must be placed inside an <esp-root> element.")}const r=t!==this.espRoot,s=t.scheme==="dark"?"dark":"light",a=this.scheme!==s,n=this.seedColor!==t.seedColor;return this.espRoot=t,r&&this.isConnected&&this.subscribeToRootEvents(t),(r||a||n)&&(this.scheme=s,this.seedColor=t.seedColor,this.applyTokensWhenRootReady()),r&&this.requestUpdate(),t}applyTokensWhenRootReady(){const e=this.espRoot;if(e&&(!e.hasUpdated||e.isUpdatePending)){this.applyTokensAfterInitialRootUpdate(e);return}this.applyScopedColorTokens()}applyTokensAfterInitialRootUpdate(e){if(this.pendingInitialThemeRoot===e)return;this.pendingInitialThemeRoot=e;const t=e.updateComplete;if(!t){this.pendingInitialThemeRoot=null,this.applyScopedColorTokens();return}t.then(()=>{this.pendingInitialThemeRoot===e&&(this.pendingInitialThemeRoot=null),!(!this.isConnected||this.espRoot!==e)&&(this.scheme=e.scheme==="dark"?"dark":"light",this.seedColor=e.seedColor,this.applyScopedColorTokens())})}subscribeToRootEvents(e){this.rootEventSubscriptionsActive&&this.subscribedRoot===e||(this.unsubscribeFromRootEvents(),this.subscribedRoot=e,this.rootEventUnsubscribers=[p(e,"seed-color-changed",this.handleSeedColorChanged),p(e,"scheme-changed",this.handleSchemeChanged),p(e,"theme-changed",this.handleThemeChanged),p(e,"icon-sprite-url-changed",this.handleIconSpriteUrlChanged)],this.rootEventSubscriptionsActive=!0)}unsubscribeFromRootEvents(){if(this.rootEventSubscriptionsActive){for(const e of this.rootEventUnsubscribers)e();this.rootEventUnsubscribers=[],this.subscribedRoot=null,this.rootEventSubscriptionsActive=!1}}constructor(){super(),this.seedColorBacker="oklch(0.7 0.125 216)",this.espRoot=null,this.contextBacker="",this.scopedTokenOriginalValues=new Map,this.warnedUnknownContexts=new Set,this.pendingInitialThemeRoot=null,this.rootEventSubscriptionsActive=!1,this.subscribedRoot=null,this.rootEventUnsubscribers=[],this.intentBacker="neutral",this.intentEmitsTokens=!0,this.warnedUnknownIntents=new Set,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.scheme="light",this.handleSeedColorChanged=e=>{this.syncRootFromDom(!1)&&(this.seedColor=e.seedColor,this.applyScopedColorTokens())},this.handleSchemeChanged=e=>{!this.syncRootFromDom(!1)||this.scheme===e.scheme||(this.scheme=e.scheme,this.applyScopedColorTokens())},this.handleThemeChanged=()=>{this.syncRootFromDom(!1)&&this.applyScopedColorTokens()},this.handleIconSpriteUrlChanged=()=>{this.syncRootFromDom(!1)&&this.requestUpdate()},new V(this,{reactToSpriteChanges:!1})}traverseToClosest(e){return b(this,e)}applyScopedColorTokens(){if(!this.espRoot)return;const e=this.intentEmitsTokens?i.intentColorSources[this.intentBacker]:"";if(!e&&!this.context.trim()){this.clearScopedTokens();return}const t=this.espRoot.activeTheme;if(!t){this.clearScopedTokens();return}const r=this.resolveContextTheme(t),o=r.theme,s=P(o.seedColor);if(!s)return;const a=m(s,o),n={};if(r.applied&&(Object.assign(n,v(o,a)),n["--_esp-context-shadow"]="var(--esp-color-shadow)",Object.assign(n,A(n)),Object.assign(n,I(o)),Object.assign(n,O),Object.assign(n,D),Object.assign(n,_(n,U(o,s,l=>(typeof l=="string"?z(l,o.anchors):null)??o.seedColor)))),e){let l=o;r.applied||(l=this.resolveAncestorZoneTheme(t)??o);const g=l===o?a:m(s,l),R=v(l,g,{effectiveSource:(u,d)=>i.semanticActionTokens.has(u)?e:d});n["--esp-color-primary"]=x(E(g[e]));for(const u of i.semanticActionTokens){const d=N(u);n[d]=R[d]}}this.applyScopedTokenProperties(n)}resolveContextTheme(e){const t=this.context.trim();if(!t)return{applied:!1,theme:e};const r=this.resolveNamedContextTheme(e,t);return r?{applied:!0,theme:r}:(this.warnUnknownContextWhenSettled(t),{applied:!1,theme:e})}warnUnknownContextWhenSettled(e){if(this.warnedUnknownContexts.has(e))return;const t=this.espRoot;if(t&&!t.themeSettled){t.whenThemeSettled().then(()=>{if(!this.isConnected||this.espRoot!==t||this.context.trim()!==e)return;const r=t.activeTheme;r&&y(r,e)||this.warnUnknownContextWhenSettled(e)});return}this.warnedUnknownContexts.add(e),console.warn(`Espalier context: "${e}" is not defined by the active theme; inheriting root tokens.`)}resolveNamedContextTheme(e,t){return y(e,t)}applyScopedTokenProperties(e){for(const t of this.scopedTokenOriginalValues.keys())t in e||this.restoreScopedTokenProperty(t);for(const[t,r]of Object.entries(e))this.setScopedTokenProperty(t,r)}setScopedTokenProperty(e,t){const r=this.scopedTokenOriginalValues.get(e);if(r){const o=this.style.getPropertyValue(e),s=this.style.getPropertyPriority(e);(o!==r.generatedValue||s!==r.generatedPriority)&&(r.originalValue=o.length?o:null,r.originalPriority=s),r.generatedValue=t,r.generatedPriority=""}else{const o=this.style.getPropertyValue(e);this.scopedTokenOriginalValues.set(e,{generatedPriority:"",generatedValue:t,originalPriority:this.style.getPropertyPriority(e),originalValue:o.length?o:null})}this.style.setProperty(e,t)}restoreScopedTokenProperty(e){const t=this.scopedTokenOriginalValues.get(e);if(!t)return;const r=this.style.getPropertyValue(e),o=this.style.getPropertyPriority(e);(r!==t.generatedValue||o!==t.generatedPriority)&&(t.originalValue=r.length?r:null,t.originalPriority=o),t.originalValue===null?this.style.removeProperty(e):this.style.setProperty(e,t.originalValue,t.originalPriority),this.scopedTokenOriginalValues.delete(e)}clearScopedTokens(){for(const e of[...this.scopedTokenOriginalValues.keys()])this.restoreScopedTokenProperty(e)}}i.intentColorSources={danger:"danger",info:"info",neutral:"",success:"success",warning:"warning"},i.semanticActionTokens=new Set(["actionBackground","actionText"]),i.styles=[T(":host"),T("[surface-layer]"),F(".esp-field:focus-within","--esp-field-focus-shadow"),j,C`
2
2
  :host {
3
3
 
4
4
  --_esp-font-body-fallback: system-ui, sans-serif;
@@ -31,9 +31,11 @@ export { type HelpRequest, type HelpState } from "./help-events.js";
31
31
  export { type PickerItem } from "../pickers/esp-picker-item.js";
32
32
  export { type EspalierUploadImage } from "../image-upload/image-helpers.js";
33
33
  export { type FontPickerValueChangedDetail, type GoogleFont, type WebSafeFont, } from "../font-picker/esp-font-picker.js";
34
+ export type { FooterLayout, FooterLayoutChangedDetail } from "./footer-alignment.js";
34
35
  export { type EspThemeToggleEventDetail } from "../header/esp-header.js";
35
36
  export { type VideoErrorDetail, type VideoErrorReason, type VideoPlayDetail, type VideoReadyDetail, type VideoSourceMode, } from "../video/esp-video.js";
36
37
  export { type PageWorkspaceResizeDetail, type PageWorkspaceResizeSource, type PageWorkspaceSeparator, } from "../page/esp-page.js";
38
+ import type { FooterLayoutChangedDetail } from "./footer-alignment.js";
37
39
  import type { EspalierDetails } from "../details/esp-details.js";
38
40
  import type { ActionMenuSelectDetail } from "../action-menu/esp-action-menu.js";
39
41
  import type { FocusChangedDetail } from "../focus-picker/esp-focus-picker.js";
@@ -88,6 +90,7 @@ export declare const ESP_EVENTS: {
88
90
  readonly GRID_LOAD_SUCCESS: "esp-grid-load-success";
89
91
  readonly GRID_LOAD_ERROR: "esp-grid-load-error";
90
92
  readonly GRID_ITEMS_CHANGED: "esp-grid-items-changed";
93
+ readonly FOOTER_LAYOUT_CHANGED: "esp-layout-changed";
91
94
  readonly HEADER_THEME_TOGGLE: "esp-header-theme-toggle";
92
95
  readonly IMAGE_UPLOAD_FILE_SELECTED: "esp-image-upload-file-selected";
93
96
  readonly IMAGE_UPLOAD_FILE_REMOVED: "esp-image-upload-file-removed";
@@ -359,6 +362,10 @@ export interface EspalierFocusPickerEventMap {
359
362
  export interface EspalierHeaderButtonEventMap {
360
363
  [ESP_EVENTS.CLICKED]: CustomEvent<Record<string, never>>;
361
364
  }
365
+ /** Events fired by `<esp-footer>`. */
366
+ export interface EspalierFooterEventMap {
367
+ [ESP_EVENTS.FOOTER_LAYOUT_CHANGED]: CustomEvent<FooterLayoutChangedDetail>;
368
+ }
362
369
  /** Events fired by `<esp-header>`. */
363
370
  export interface EspalierHeaderEventMap {
364
371
  [ESP_EVENTS.HEADER_THEME_TOGGLE]: CustomEvent<EspThemeToggleEventDetail>;
@@ -1 +1 @@
1
- import{VALIDITY_CHANGED_EVENT as r}from"./validation.js";import{VALIDITY_CHANGED_EVENT as e}from"./validation.js";const _={VALUE_CHANGED:"esp-value-changed",VALIDITY_CHANGED:e,CLICKED:"esp-clicked",ACTION_MENU_SELECT:"esp-action-menu-select",BURGER_OPENED:"esp-burger-opened",BURGER_CLOSED:"esp-burger-closed",DETAILS_TOGGLE:"esp-details-toggle",DETAILS_GROUP_CHANGE:"esp-details-group-change",DIALOG_OPENED:"esp-dialog-opened",DIALOG_CLOSING:"esp-dialog-closing",DIALOG_CLOSED:"esp-dialog-closed",FILE_UPLOAD_FILES_SELECTED:"esp-file-upload-files-selected",FLYOUT_OPENED:"esp-flyout-opened",FLYOUT_CLOSED:"esp-flyout-closed",FLYOUT_STATE_CHANGED:"esp-flyout-state-changed",FOCUS_PICKER_CHANGED:"esp-focus-picker-changed",FORM_DIALOG_CLOSE_REQUESTED:"esp-form-dialog-close-requested",FORM_SUBMIT:"esp-form-submit",FORM_SUBMIT_RESPONSE:"esp-form-submit-response",FORM_SUBMIT_ERROR:"esp-form-submit-error",GRID_EVENT:"esp-grid-event",GRID_LOAD_START:"esp-grid-load-start",GRID_LOAD_SUCCESS:"esp-grid-load-success",GRID_LOAD_ERROR:"esp-grid-load-error",GRID_ITEMS_CHANGED:"esp-grid-items-changed",HEADER_THEME_TOGGLE:"esp-header-theme-toggle",IMAGE_UPLOAD_FILE_SELECTED:"esp-image-upload-file-selected",IMAGE_UPLOAD_FILE_REMOVED:"esp-image-upload-file-removed",IMAGE_UPLOAD_FILES_REJECTED:"esp-image-upload-files-rejected",IMAGE_UPLOAD_RETRY:"esp-image-upload-retry",IMAGE_UPLOAD_IMAGES_REORDERED:"esp-image-upload-images-reordered",IMAGE_UPLOAD_PREVIEW_ACTION:"esp-image-upload-preview-action",INFO_DESTROY:"esp-info-destroy",INPUT_ICON_CLICKED:"esp-input-icon-clicked",LIGHTBOX_CHANGED:"esp-lightbox-changed",MENU_GROUP_TOGGLE:"esp-menu-group-toggle",MENU_DRAWER_OPENED:"esp-menu-drawer-opened",MENU_DRAWER_CLOSED:"esp-menu-drawer-closed",MENU_DRAWER_PRESENTED:"esp-menu-drawer-presented",PAGE_WORKSPACE_RESIZE:"esp-page-workspace-resize",PICKER_MENU_SELECTION_CHANGED:"esp-picker-menu-selection-changed",PICKER_MENU_CLOSE_REQUESTED:"esp-picker-menu-close-requested",PICKER_MENU_DISMISS_REQUESTED:"esp-picker-menu-dismiss-requested",PICKER_MENU_RANGE_CHANGED:"esp-picker-menu-range-changed",POPOVER_OPENED:"esp-popover-opened",POPOVER_CLOSED:"esp-popover-closed",SEARCH_REQUESTED:"esp-search-requested",SEARCH_RESULT_SELECTED:"esp-search-result-selected",SEARCH_CLOSED:"esp-search-closed",TAB_GROUP_CHANGED:"esp-tab-group-changed",TREE_SELECT:"esp-tree-select",TREE_TOGGLE:"esp-tree-toggle",TREE_GRAFT_REQUEST:"esp-tree-graft-request",TREE_GRAFT:"esp-tree-graft",TREE_EDIT:"esp-tree-edit",TREE_DELETE:"esp-tree-delete",TREE_MOVE_UP:"esp-tree-move-up",TREE_MOVE_DOWN:"esp-tree-move-down",TREE_CUT:"esp-tree-cut",TREE_PASTE_CHILD:"esp-tree-paste-child",TREE_GRAFT_INPUT:"esp-tree-graft-input",VIDEO_READY:"esp-video-ready",VIDEO_PLAY:"esp-video-play",VIDEO_ERROR:"esp-video-error"};export{_ as ESP_EVENTS,r as VALIDITY_CHANGED_EVENT};
1
+ import{VALIDITY_CHANGED_EVENT as r}from"./validation.js";import{VALIDITY_CHANGED_EVENT as e}from"./validation.js";const _={VALUE_CHANGED:"esp-value-changed",VALIDITY_CHANGED:e,CLICKED:"esp-clicked",ACTION_MENU_SELECT:"esp-action-menu-select",BURGER_OPENED:"esp-burger-opened",BURGER_CLOSED:"esp-burger-closed",DETAILS_TOGGLE:"esp-details-toggle",DETAILS_GROUP_CHANGE:"esp-details-group-change",DIALOG_OPENED:"esp-dialog-opened",DIALOG_CLOSING:"esp-dialog-closing",DIALOG_CLOSED:"esp-dialog-closed",FILE_UPLOAD_FILES_SELECTED:"esp-file-upload-files-selected",FLYOUT_OPENED:"esp-flyout-opened",FLYOUT_CLOSED:"esp-flyout-closed",FLYOUT_STATE_CHANGED:"esp-flyout-state-changed",FOCUS_PICKER_CHANGED:"esp-focus-picker-changed",FORM_DIALOG_CLOSE_REQUESTED:"esp-form-dialog-close-requested",FORM_SUBMIT:"esp-form-submit",FORM_SUBMIT_RESPONSE:"esp-form-submit-response",FORM_SUBMIT_ERROR:"esp-form-submit-error",GRID_EVENT:"esp-grid-event",GRID_LOAD_START:"esp-grid-load-start",GRID_LOAD_SUCCESS:"esp-grid-load-success",GRID_LOAD_ERROR:"esp-grid-load-error",GRID_ITEMS_CHANGED:"esp-grid-items-changed",FOOTER_LAYOUT_CHANGED:"esp-layout-changed",HEADER_THEME_TOGGLE:"esp-header-theme-toggle",IMAGE_UPLOAD_FILE_SELECTED:"esp-image-upload-file-selected",IMAGE_UPLOAD_FILE_REMOVED:"esp-image-upload-file-removed",IMAGE_UPLOAD_FILES_REJECTED:"esp-image-upload-files-rejected",IMAGE_UPLOAD_RETRY:"esp-image-upload-retry",IMAGE_UPLOAD_IMAGES_REORDERED:"esp-image-upload-images-reordered",IMAGE_UPLOAD_PREVIEW_ACTION:"esp-image-upload-preview-action",INFO_DESTROY:"esp-info-destroy",INPUT_ICON_CLICKED:"esp-input-icon-clicked",LIGHTBOX_CHANGED:"esp-lightbox-changed",MENU_GROUP_TOGGLE:"esp-menu-group-toggle",MENU_DRAWER_OPENED:"esp-menu-drawer-opened",MENU_DRAWER_CLOSED:"esp-menu-drawer-closed",MENU_DRAWER_PRESENTED:"esp-menu-drawer-presented",PAGE_WORKSPACE_RESIZE:"esp-page-workspace-resize",PICKER_MENU_SELECTION_CHANGED:"esp-picker-menu-selection-changed",PICKER_MENU_CLOSE_REQUESTED:"esp-picker-menu-close-requested",PICKER_MENU_DISMISS_REQUESTED:"esp-picker-menu-dismiss-requested",PICKER_MENU_RANGE_CHANGED:"esp-picker-menu-range-changed",POPOVER_OPENED:"esp-popover-opened",POPOVER_CLOSED:"esp-popover-closed",SEARCH_REQUESTED:"esp-search-requested",SEARCH_RESULT_SELECTED:"esp-search-result-selected",SEARCH_CLOSED:"esp-search-closed",TAB_GROUP_CHANGED:"esp-tab-group-changed",TREE_SELECT:"esp-tree-select",TREE_TOGGLE:"esp-tree-toggle",TREE_GRAFT_REQUEST:"esp-tree-graft-request",TREE_GRAFT:"esp-tree-graft",TREE_EDIT:"esp-tree-edit",TREE_DELETE:"esp-tree-delete",TREE_MOVE_UP:"esp-tree-move-up",TREE_MOVE_DOWN:"esp-tree-move-down",TREE_CUT:"esp-tree-cut",TREE_PASTE_CHILD:"esp-tree-paste-child",TREE_GRAFT_INPUT:"esp-tree-graft-input",VIDEO_READY:"esp-video-ready",VIDEO_PLAY:"esp-video-play",VIDEO_ERROR:"esp-video-error"};export{_ as ESP_EVENTS,r as VALIDITY_CHANGED_EVENT};
@@ -0,0 +1,10 @@
1
+ /** Logical placement within a footer region. */
2
+ export type FooterPlacement = "start" | "center" | "end";
3
+ /** Footer text intent; auto follows the current logical inline placement. */
4
+ export type FooterTextAlign = FooterPlacement | "auto" | "justify";
5
+ /** Layout selected by the footer's current content-box container profile. */
6
+ export type FooterLayout = "wide" | "wrapped" | "stacked";
7
+ /** Detail emitted when a footer observes a different layout. */
8
+ export interface FooterLayoutChangedDetail {
9
+ layout: FooterLayout;
10
+ }
@@ -0,0 +1,12 @@
1
+ import{ESP_EVENTS as g}from"./events.js";import{css as f}from"lit";const b=["","-wrapped","-stacked"],v=["wide","wrapped","stacked"],m=["inline","block","text"],u=new WeakMap,a=new WeakMap;function c(l,t){if(typeof l!="string")return;const e=l.trim();return e==="start"||e==="center"||e==="end"||t&&(e==="auto"||e==="justify")?e:void 0}function d(l){return l.parentElement??(l.getRootNode()instanceof ShadowRoot?l.getRootNode().host:null)}const k=f`
2
+ .alignment-scope {
3
+ --esp-footer-current-inline-align: var(--_esp-footer-output-inline);
4
+ --esp-footer-current-block-align: var(--_esp-footer-output-block);
5
+ --esp-footer-current-text-align: var(--_esp-footer-output-text);
6
+ --esp-footer-current-prose-align: var(--_esp-footer-output-prose);
7
+ }
8
+ `,x=f`
9
+ :host {
10
+ align-self: var(--_esp-footer-block-self, auto);
11
+ }
12
+ `;class w{constructor(t,e){this.host=t,this.kind=e,this.values=new Map,this.profile=0,this.connected=!1,this.changed=()=>{this.bindParent(),this.host.requestUpdate(),this.publish()},t.addController(this),u.set(t,this),this.publish()}get layout(){return v[this.profile]}get(t){return this.values.has(t)?this.values.get(t):c(this.host.getAttribute(t),t.includes("text-align"))}set(t,e,o,i){const s=this.values.get(e),n=c(o,i==="text"),r=this.host.getAttribute(e);this.values.set(e,n),n===void 0?r!==null&&this.host.removeAttribute(e):r!==n&&this.host.setAttribute(e,n),(s!==n||r!==(n??null))&&(this.host.requestUpdate(t,s,{hasChanged:()=>!0}),this.publish())}hostConnected(){this.connected=!0,this.bindParent(),this.host.requestUpdate(),this.publish()}hostDisconnected(){this.connected=!1,this.unbindParent(),this.observer?.disconnect(),this.observer=void 0,this.probe=void 0}hostUpdate(){if(this.bindParent(),this.kind!=="footer"){const t=this.styles("region");for(const[e,o]of Object.entries(t))this.host.style.getPropertyValue(e)!==o&&this.host.style.setProperty(e,o)}}hostUpdated(){if(this.kind!=="footer"||!this.connected||!this.host.isConnected)return;const t=this.host.shadowRoot?.querySelector(".footer-alignment-profile-probe");if(t!==this.probe&&(this.observer?.disconnect(),this.probe=t??void 0,t&&typeof ResizeObserver<"u")){const e=new ResizeObserver(()=>{this.observer===e&&this.readProfile()});this.observer=e,e.observe(t)}this.readProfile()}readProfile(){if(!this.connected||!this.host.isConnected||!this.probe?.isConnected)return;const t=Number.parseFloat(getComputedStyle(this.probe).inlineSize),e=t===2?2:t===1?1:0;e!==this.profile&&(this.profile=e,this.host.requestUpdate(),this.publish(),this.host.dispatchEvent(new CustomEvent(g.FOOTER_LAYOUT_CHANGED,{detail:{layout:this.layout},bubbles:!0,composed:!0})))}activeProfile(){return this.parent?.activeProfile()??this.profile}publish(){for(const t of a.get(this.host)??[])t()}unbindParent(){this.parentHost&&a.get(this.parentHost)?.delete(this.changed),this.parentHost=void 0,this.parent=void 0}bindParent(){if(!this.connected||this.kind==="footer")return;let t=d(this.host);for(;t&&!(t.localName==="esp-footer"||this.kind==="group"&&t.localName==="esp-footer-column");)t=d(t);if(t!==this.parentHost&&(this.unbindParent(),t)){this.parentHost=t;let e=a.get(t);e||a.set(t,e=new Set),e.add(this.changed)}this.parent=t?u.get(t):void 0}ownSparse(t=""){return b.map(e=>{const o={};for(const i of m){const s=this.get(`${t}${i}-align${e}`);s&&(o[i]={value:s,origin:this})}return o})}defaults(){const t=this.ownSparse(),e=this.parent?.defaults();return t.map((o,i)=>({...e?.[i],...o}))}resolve(t){const e=this.defaults(),o=this.kind==="footer"&&t!=="region"?this.ownSparse(`${t}-`):void 0,i={};for(let s=0;s<=this.activeProfile();s++)Object.assign(i,e[s],o?.[s]);return t==="bottom"&&delete i.block,i}styles(t){const e=this.resolve(t),o=e.inline?.value,i=e.block?.value,s=e.text?.value,n=o!==void 0||s!==void 0,r=s&&s!=="auto"&&s!=="justify"?s:o??"start",h=this.kind==="group"&&this.parent?.kind==="column",p=!h||e.inline?.origin===this;return{"--_esp-footer-wrapper-display":n?"initial":"contents","--_esp-footer-region-display":n?"flex":"block","--_esp-footer-region-direction":n?"column":"initial","--_esp-footer-output-inline":o??"initial","--_esp-footer-output-block":i??"initial","--_esp-footer-output-text":n?r:"initial","--_esp-footer-output-prose":n?s==="justify"?"justify":r:"initial","--_esp-footer-block-self":h?"auto":i??"auto","--_esp-footer-content-self":p?o??"auto":"auto","--_esp-footer-content-width":p&&o?"fit-content":"auto","--_esp-footer-text-css":n?r:"inherit","--_esp-footer-prose-css":n?s==="justify"?"justify":r:"inherit","--_esp-footer-prose-last-line":n?"auto":"initial","--_esp-footer-prose-word-spacing":n?"normal":"initial","--_esp-footer-lockup-block":i??"center","--_esp-footer-lockup-display":i?"flex":"inline-flex","--_esp-footer-image-cap":o?"var(--_esp-footer-logo-max-width)":"min(var(--_esp-footer-logo-max-width), 100%)","--_esp-footer-image-min":o?"0px":"auto","--_esp-footer-image-x":o==="start"?"var(--_esp-footer-image-inline-start, left)":o==="end"?"var(--_esp-footer-image-inline-end, right)":"center","--_esp-footer-image-y":i==="start"?"top":i==="end"?"bottom":"center"}}}export{w as FooterAlignmentController,x as footerAlignmentHostStyles,k as footerAlignmentStyles};
@@ -0,0 +1,2 @@
1
+ /** The configured footer logo's box sizing strategy. */
2
+ export type FooterLogoSizing = "fixed" | "natural";
@@ -0,0 +1,16 @@
1
+ import{css as d}from"lit";function p(n){return typeof n=="string"&&n.trim()==="natural"?"natural":"fixed"}const c=String.raw`[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?`,l=new RegExp(`^\\s*(${c})(?:\\s*\\/\\s*(${c}))?\\s*$`),h="--_esp-footer-natural-logo-ratio";function u(n){const t=l.exec(n);if(!t)return;const e=Number(t[1]),s=t[2]===void 0?1:Number(t[2]),i=e/s;return Number.isFinite(e)&&e>0&&Number.isFinite(s)&&s>0&&Number.isFinite(i)&&i>0?i:void 0}function g(n,t){return u(n)??u(t)??3}function f(n){const t=[];let e=n;for(;e;){t.push(e);const s=e.getRootNode();e=e.assignedSlot??e.parentElement??(s instanceof ShadowRoot?s.host:null)}return t}class b{constructor(t,e){this.host=t,this.getOptions=e,this.connected=!1,this.source="",this.ratios=new Map,this.ancestors=[],this.sizeTargets=[],this.refresh=()=>{if(!this.connected)return;const s=this.getOptions(),i=new Set([this.sourceKey(s.lightSource),this.sourceKey(s.darkSource)]);for(const a of this.ratios.keys())i.has(a)||this.ratios.delete(a);const r=this.host.shadowRoot?.querySelector(".brand-logo")??void 0,o=this.sourceKey(s.scheme==="dark"?s.darkSource:s.lightSource);if(s.sizing!=="natural"||!r||!o){this.unbindImage(),this.mutations?.disconnect(),this.resize?.disconnect(),this.ancestors=[],this.sizeTargets=[];return}if((this.image!==r||this.source!==o)&&(this.unbindImage(),this.image=r,this.source=o,this.load=()=>{if(!this.current(r,o))return;const a=this.intrinsicRatio(r);a===void 0?this.ratios.delete(o):this.ratios.set(o,a),this.writeRatio()},this.error=()=>{this.current(r,o)&&(this.ratios.delete(o),this.writeRatio())},r.addEventListener("load",this.load),r.addEventListener("error",this.error)),r.complete&&this.current(r,o)){const a=this.intrinsicRatio(r);a!==void 0?this.ratios.set(o,a):this.ratios.delete(o)}this.observe(r),this.writeRatio()},t.addController(this)}hostConnected(){this.connected=!0,this.refresh()}hostUpdated(){this.refresh()}hostDisconnected(){this.connected=!1,this.unbindImage(),this.mutations?.disconnect(),this.resize?.disconnect(),this.mutations=void 0,this.resize=void 0,this.ancestors=[],this.sizeTargets=[],this.ratios.clear()}sourceKey(t){if(!t)return"";try{return new URL(t,this.host.ownerDocument.baseURI).href}catch{return t}}unbindImage(){this.image&&(this.load&&this.image.removeEventListener("load",this.load),this.error&&this.image.removeEventListener("error",this.error),this.image.style.removeProperty(h)),this.image=void 0,this.load=void 0,this.error=void 0,this.source=""}current(t,e){const s=this.getOptions(),i=this.sourceKey(s.scheme==="dark"?s.darkSource:s.lightSource);return this.connected&&s.sizing==="natural"&&this.image===t&&this.source===e&&i===e&&this.sourceKey(t.getAttribute("src")??"")===e&&(!t.currentSrc||this.sourceKey(t.currentSrc)===e)}intrinsicRatio(t){const{naturalWidth:e,naturalHeight:s}=t,i=e/s;return Number.isFinite(e)&&e>0&&Number.isFinite(s)&&s>0&&Number.isFinite(i)&&i>0?i:void 0}observe(t){const e=f(this.host);if(e.length!==this.ancestors.length||e.some((i,r)=>i!==this.ancestors[r])){this.mutations?.disconnect(),this.mutations??=new MutationObserver(this.refresh);for(const i of e)this.mutations.observe(i,{attributes:!0,attributeFilter:["style","class"]});this.ancestors=e}const s=[...new Set([...e,t,...t.parentElement?[t.parentElement]:[]])];if(s.length!==this.sizeTargets.length||s.some((i,r)=>i!==this.sizeTargets[r])){if(this.resize?.disconnect(),typeof ResizeObserver<"u"){this.resize??=new ResizeObserver(this.refresh);for(const i of s)this.resize.observe(i)}this.sizeTargets=s}}writeRatio(){if(!this.image)return;const t=getComputedStyle(this.image),e=this.getOptions().scheme==="dark"?"dark":"light",s=this.ratios.get(this.source)??g(t.getPropertyValue(`--esp-footer-${e}-brand-logo-aspect-ratio`),t.getPropertyValue("--esp-footer-brand-logo-aspect-ratio")),i=String(s);this.image.style.getPropertyValue(h)!==i&&this.image.style.setProperty(h,i)}}const z=d`
2
+ :host([brand-logo-sizing="natural"]) .brand-logo {
3
+ flex: 0 1 auto;
4
+ min-inline-size: 0;
5
+ inline-size: min(
6
+ calc(var(--_esp-footer-logo-size) * var(--_esp-footer-natural-logo-ratio, 3)),
7
+ var(--_esp-footer-logo-max-width)
8
+ );
9
+ max-inline-size: min(var(--_esp-footer-logo-max-width), 100%);
10
+ block-size: auto;
11
+
12
+ min-block-size: 0;
13
+ max-block-size: none;
14
+ aspect-ratio: var(--_esp-footer-natural-logo-ratio, 3);
15
+ }
16
+ `;export{b as FooterLogoGeometryController,z as footerNaturalLogoStyles,p as normalizeFooterLogoSizing,u as parseFooterLogoAspectRatio,g as resolveFooterLogoAspectRatio};
@@ -1 +1 @@
1
- const l=["tiny","small","normal","medium","big","large","huge"],b=2,O=1.125,g=1.3333333333333333,h=[["tiny","small"],["small","normal"],["normal","medium"],["medium","big"],["big","large"],["large","huge"]],u=.375,z={rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200};function c(s,e=4){const t=10**e;return Math.round(s*t)/t}function d(s,e,t,o,p){if(Math.abs(e-s)<1e-4)return`${c(s)}rem`;const y=(e-s)*t*100/(p-o),n=s-y*o/(100*t);return`clamp(${c(s)}rem, ${c(n)}rem + ${c(y)}vw, ${c(e)}rem)`}function E(s){const e={};for(let t=0;t<l.length;t++){const o=t-2,p=1.125*s.typeRatio**o;e[l[t]]={min:p,max:p*g}}return e}function x(s){const e={};for(let t=0;t<l.length;t++){const o=u*s.spaceRatio**t;e[l[t]]={min:o,max:o*g}}return e}const _={"--esp-shadow-1":"1px 1px 4px var(--esp-color-shadow)","--esp-shadow-2":"0 2px 8px var(--esp-color-shadow)","--esp-shadow-3":"0 6px 20px var(--esp-color-shadow)"},w={"--esp-type-overline-color":"var(--esp-color-type-overline, var(--esp-color-text))","--esp-type-label-color":"var(--esp-color-type-label, var(--esp-color-text))","--esp-type-lead-color":"var(--esp-color-type-lead, var(--esp-color-text))","--esp-type-caption-color":"var(--esp-color-type-caption, var(--esp-color-text))","--esp-type-display-color":"var(--esp-color-headings, var(--esp-color-text))"},S={"--esp-type-overline-font-size":"var(--esp-type-tiny)","--esp-type-overline-font-weight":"var(--esp-font-weight-headings)","--esp-type-overline-letter-spacing":"0.08em","--esp-type-overline-text-transform":"uppercase","--esp-type-label-font-size":"var(--esp-type-normal)","--esp-type-label-font-weight":"var(--esp-font-weight-headings)","--esp-type-label-letter-spacing":"0.01em","--esp-type-lead-font-size":"var(--esp-type-medium)","--esp-type-lead-font-weight":"var(--esp-font-weight-body)","--esp-type-lead-letter-spacing":"normal","--esp-type-caption-font-size":"var(--esp-type-small)","--esp-type-caption-font-weight":"var(--esp-font-weight-body)","--esp-type-caption-letter-spacing":"normal","--esp-type-display-font-family":"var(--_esp-font-headings-effective, var(--esp-font-headings, var(--_esp-font-body-effective, var(--esp-font-body, system-ui, sans-serif))))","--esp-type-display-font-weight":"var(--esp-font-weight-headings)","--esp-type-display-line-height":"1.1","--esp-type-display-letter-spacing":"normal",...w};function P(s){const e={},{rootFontSize:t,viewportMin:o,viewportMax:p,borderRadius:y}=s,n=16,r=t/n,m=E(s);for(const a of l){const{min:i,max:f}=m[a];e[`--esp-type-${a}`]=d(i*r,f*r,n,o,p)}e["--esp-type-display-font-size"]=d(m.large.min*r,m.huge.max*r,n,o,p),Object.assign(e,S);const v=x(s);for(const a of l){const{min:i,max:f}=v[a];e[`--esp-size-${a}`]=d(i*r,f*r,n,o,p)}for(const[a,i]of h)e[`--esp-size-${a}-to-${i}`]=d(v[a].min*r,v[i].max*r,n,o,p);return e["--esp-size-font"]="var(--esp-type-normal)",e["--esp-size-padding"]="var(--esp-size-tiny-to-small)",e["--esp-size-padding-page"]="var(--esp-size-small-to-normal)",e["--esp-size-border-radius"]=`${c(y*r)}rem`,e["--esp-measure"]="66ch",e["--esp-measure-wide"]="90ch",e["--esp-size-section"]="clamp(var(--esp-size-big), 7vw, var(--esp-size-huge))",Object.assign(e,_),e["--esp-card-min"]="16rem",e}export{z as DEFAULT_SCALE_CONFIG,_ as ELEVATION_PROPERTIES,l as STEP_NAMES,w as TYPE_ROLE_COLOR_PROPERTIES,S as TYPE_ROLE_PROPERTIES,P as generateScaleProperties};
1
+ const y=["tiny","small","normal","medium","big","large","huge"],T=2,R=1.125,v=1.3333333333333333,b=[["tiny","small"],["small","normal"],["normal","medium"],["medium","big"],["big","large"],["large","huge"]],h=.375,N={rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200};function l(t,s=4){const e=10**s;return Math.round(t*e)/e}function x(t,s){const e=t*s;if(Number.isFinite(e))return e/100;const o=t*(s/100);return Number.isFinite(o)?o:Math.sign(t)*Number.MAX_VALUE}function f(t,s,e,o,n,a){if(Math.abs(s-t)<1e-4)return`${l(t)}rem`;const m=(s-t)*e*100/(n-o),i=t-m*o/(100*e),p=a===void 0?`${l(m)}vw`:`${x(l(m),a)}px`;return`clamp(${l(t)}rem, ${l(i)}rem + ${p}, ${l(s)}rem)`}function _(t){const s={};for(let e=0;e<y.length;e++){const o=e-2,n=1.125*t.typeRatio**o;s[y[e]]={min:n,max:n*v}}return s}function S(t){const s={};for(let e=0;e<y.length;e++){const o=h*t.spaceRatio**e;s[y[e]]={min:o,max:o*v}}return s}const O={"--esp-shadow-1":"1px 1px 4px var(--esp-color-shadow)","--esp-shadow-2":"0 2px 8px var(--esp-color-shadow)","--esp-shadow-3":"0 6px 20px var(--esp-color-shadow)"},z={"--esp-type-overline-color":"var(--esp-color-type-overline, var(--esp-color-text))","--esp-type-label-color":"var(--esp-color-type-label, var(--esp-color-text))","--esp-type-lead-color":"var(--esp-color-type-lead, var(--esp-color-text))","--esp-type-caption-color":"var(--esp-color-type-caption, var(--esp-color-text))","--esp-type-display-color":"var(--esp-color-headings, var(--esp-color-text))"},P={"--esp-type-overline-font-size":"var(--esp-type-tiny)","--esp-type-overline-font-weight":"var(--esp-font-weight-headings)","--esp-type-overline-letter-spacing":"0.08em","--esp-type-overline-text-transform":"uppercase","--esp-type-label-font-size":"var(--esp-type-normal)","--esp-type-label-font-weight":"var(--esp-font-weight-headings)","--esp-type-label-letter-spacing":"0.01em","--esp-type-lead-font-size":"var(--esp-type-medium)","--esp-type-lead-font-weight":"var(--esp-font-weight-body)","--esp-type-lead-letter-spacing":"normal","--esp-type-caption-font-size":"var(--esp-type-small)","--esp-type-caption-font-weight":"var(--esp-font-weight-body)","--esp-type-caption-letter-spacing":"normal","--esp-type-display-font-family":"var(--_esp-font-headings-effective, var(--esp-font-headings, var(--_esp-font-body-effective, var(--esp-font-body, system-ui, sans-serif))))","--esp-type-display-font-weight":"var(--esp-font-weight-headings)","--esp-type-display-line-height":"1.1","--esp-type-display-letter-spacing":"normal",...z};function $(t,s){s=typeof s=="number"&&Number.isFinite(s)&&s>0?s:void 0;const e={},{rootFontSize:o,viewportMin:n,viewportMax:a,borderRadius:m}=t,i=16,p=o/i,u=_(t);for(const r of y){const{min:c,max:d}=u[r];e[`--esp-type-${r}`]=f(c*p,d*p,i,n,a,s)}e["--esp-type-display-font-size"]=f(u.large.min*p,u.huge.max*p,i,n,a,s),Object.assign(e,P);const g=S(t);for(const r of y){const{min:c,max:d}=g[r];e[`--esp-size-${r}`]=f(c*p,d*p,i,n,a,s)}for(const[r,c]of b)e[`--esp-size-${r}-to-${c}`]=f(g[r].min*p,g[c].max*p,i,n,a,s);e["--esp-size-font"]="var(--esp-type-normal)",e["--esp-size-padding"]="var(--esp-size-tiny-to-small)",e["--esp-size-padding-page"]="var(--esp-size-small-to-normal)",e["--esp-size-border-radius"]=`${l(m*p)}rem`,e["--esp-measure"]="66ch",e["--esp-measure-wide"]="90ch";const E=s===void 0?"7vw":`${x(7,s)}px`;return e["--esp-size-section"]=`clamp(var(--esp-size-big), ${E}, var(--esp-size-huge))`,Object.assign(e,O),e["--esp-card-min"]="16rem",e}export{N as DEFAULT_SCALE_CONFIG,O as ELEVATION_PROPERTIES,y as STEP_NAMES,z as TYPE_ROLE_COLOR_PROPERTIES,P as TYPE_ROLE_PROPERTIES,$ as generateScaleProperties};
@@ -20,6 +20,13 @@
20
20
  import type { EspalierTheme } from "./theme.js";
21
21
  /** The two color schemes a theme resolves for. */
22
22
  export type ThemeScheme = "light" | "dark";
23
+ /** Optional instance-level scale preview settings; no DOM measurement is performed. */
24
+ export interface ThemePropertyOptions {
25
+ /** Positive finite viewport width in CSS pixels. Invalid values use ordinary vw.
26
+ * Freezes only DS-generated viewport terms; rem still follows the HTML root.
27
+ */
28
+ viewportWidth?: number;
29
+ }
23
30
  /**
24
31
  * Compute every CSS custom property for a resolved theme and scheme.
25
32
  *
@@ -38,5 +45,6 @@ export type ThemeScheme = "light" | "dark";
38
45
  *
39
46
  * @param theme A resolved theme.
40
47
  * @param scheme The scheme to compute, matching the theme it came from.
48
+ * @param options Optional virtual viewport for DS-generated scales only.
41
49
  */
42
- export declare function computeThemeProperties(theme: EspalierTheme, scheme: ThemeScheme): Record<string, string>;
50
+ export declare function computeThemeProperties(theme: EspalierTheme, scheme: ThemeScheme, options?: ThemePropertyOptions): Record<string, string>;