@taprootio/espalier 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,6 +116,12 @@ export type { SchemeEvents } from "../shared/bus-events.js";
116
116
  * @cssprop --esp-type-caption-font-weight - Font weight for captions.
117
117
  * @cssprop --esp-type-caption-letter-spacing - Letter spacing for captions.
118
118
  * @cssprop --esp-type-caption-color - Context-local color alias for captions.
119
+ * @cssprop --esp-type-display-font-family - Heading font family for opt-in display text.
120
+ * @cssprop --esp-type-display-font-size - Fluid display size spanning the large mobile floor through the huge desktop ceiling.
121
+ * @cssprop --esp-type-display-font-weight - Heading font weight for opt-in display text.
122
+ * @cssprop --esp-type-display-line-height - Line height for opt-in display text.
123
+ * @cssprop --esp-type-display-letter-spacing - Letter spacing for opt-in display text.
124
+ * @cssprop --esp-type-display-color - Context-local heading-color alias for opt-in display text.
119
125
  *
120
126
  * @docPageTitle Root
121
127
  * @docUrl /components/root
@@ -31,6 +31,28 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
31
31
  * and drop `--esp-section-padding-block` too when the media should
32
32
  * meet the band's edges; the band's zone behavior is unaffected.
33
33
  *
34
+ * A section may also tint one raster alpha mask behind its content.
35
+ * The component owns clipping, no-repeat mask behavior, stacking, and
36
+ * interaction isolation; consumers supply only the image, semantic tint,
37
+ * position, size, and opacity:
38
+ *
39
+ * ```html
40
+ * <esp-section
41
+ * style="
42
+ * --esp-section-decoration-image: url('/assets/brand-mark.png');
43
+ * --esp-section-decoration-position: calc(100% + 2rem) -2rem;
44
+ * --esp-section-decoration-size: min(34rem, 62%);
45
+ * --esp-section-decoration-opacity: 0.09;
46
+ * "
47
+ * >
48
+ * <h1>Rooted in warmth</h1>
49
+ * </esp-section>
50
+ * ```
51
+ *
52
+ * CSS image values are trusted stylesheet input. Products that accept image
53
+ * references from documents or users must enforce their own asset ownership
54
+ * and URL policy before mapping a value to this hook.
55
+ *
34
56
  * @customElement esp-section
35
57
  * @slot - The section's content, centered in the well.
36
58
  * @csspart section - The full-bleed band.
@@ -39,6 +61,11 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
39
61
  * @cssprop --esp-section-max-width - The content well's cap. Defaults to `var(--esp-page-well-max-width, 72rem)`; `none` lets content span the band.
40
62
  * @cssprop --esp-section-padding-block - Vertical rhythm above and below the well. Defaults to `var(--esp-size-section)`.
41
63
  * @cssprop --esp-section-padding-inline - Horizontal breathing room inside the band at narrow viewports. Defaults to `var(--esp-size-medium)`.
64
+ * @cssprop --esp-section-decoration-image - Raster alpha mask painted behind the well. Defaults to `none`.
65
+ * @cssprop --esp-section-decoration-color - Semantic tint applied through the mask. Defaults to the local `--esp-color-headings`.
66
+ * @cssprop --esp-section-decoration-position - Mask position, including responsive or bleeding values. Defaults to `center`.
67
+ * @cssprop --esp-section-decoration-size - Mask size. Defaults to `contain`.
68
+ * @cssprop --esp-section-decoration-opacity - Decoration opacity from `0` through `1`. Defaults to `1`.
42
69
  * @docPageTitle Section
43
70
  * @docUrl /components/section
44
71
  * @menuGroup Structure
@@ -1,5 +1,6 @@
1
- var a=function(t,i,s,n){var o=arguments.length,e=o<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,s):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(t,i,s,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(e=(o<3?l(e):o>3?l(i,s,e):l(i,s))||e);return o>3&&e&&Object.defineProperty(i,s,e),e};import{css as d,html as m}from"lit";import{customElement as v}from"lit/decorators.js";import{EspalierElementBase as p}from"../shared/esp-element-base.js";let r=class extends p{render(){return m`
1
+ var c=function(i,o,t,n){var a=arguments.length,e=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(i,o,t,n);else for(var l=i.length-1;l>=0;l--)(s=i[l])&&(e=(a<3?s(e):a>3?s(o,t,e):s(o,t))||e);return a>3&&e&&Object.defineProperty(o,t,e),e};import{css as d,html as v}from"lit";import{customElement as m}from"lit/decorators.js";import{EspalierElementBase as p}from"../shared/esp-element-base.js";import{renderVisualOverlay as u,visualOverlayStyles as y}from"../shared/visual-overlay.js";let r=class extends p{render(){return v`
2
2
  <div class="esp-section" part="section">
3
+ ${u({className:"decoration"})}
3
4
  <div class="esp-section-well" part="well">
4
5
  <slot></slot>
5
6
  </div>
@@ -11,12 +12,32 @@ var a=function(t,i,s,n){var o=arguments.length,e=o<3?i:n===null?n=Object.getOwnP
11
12
 
12
13
  .esp-section {
13
14
  background: var(--esp-section-background, var(--esp-color-background));
15
+ isolation: isolate;
14
16
  padding-block: var(--esp-section-padding-block, var(--esp-size-section));
15
17
  padding-inline: var(--esp-section-padding-inline, var(--esp-size-medium));
18
+ position: relative;
19
+ }
20
+
21
+ .decoration {
22
+ --_esp-overlay-z-index: 0;
23
+ --_esp-overlay-texture: none;
24
+ --_esp-overlay-texture-color: var(
25
+ --esp-section-decoration-color,
26
+ var(--esp-color-headings)
27
+ );
28
+
29
+ --_esp-overlay-texture-mask:
30
+ var(--esp-section-decoration-image, none), linear-gradient(transparent, transparent);
31
+ --_esp-overlay-texture-mask-position: var(--esp-section-decoration-position, center);
32
+ --_esp-overlay-texture-mask-repeat: no-repeat;
33
+ --_esp-overlay-texture-mask-size: var(--esp-section-decoration-size, contain);
34
+ --_esp-overlay-texture-opacity: var(--esp-section-decoration-opacity, 1);
16
35
  }
17
36
 
18
37
  .esp-section-well {
19
38
  max-inline-size: var(--esp-section-max-width, var(--esp-page-well-max-width, 72rem));
20
39
  margin-inline: auto;
40
+ position: relative;
41
+ z-index: 1;
21
42
  }
22
- `],r=a([v("esp-section")],r);export{r as EspalierSection};
43
+ `,y],r=c([m("esp-section")],r);export{r as EspalierSection};
@@ -1 +1 @@
1
- const l=["tiny","small","normal","medium","big","large","huge"],O=2,b=1.125,g=1.3333333333333333,f=[["tiny","small"],["small","normal"],["normal","medium"],["medium","big"],["big","large"],["large","huge"]],E=.375,z={rootFontSize:16,typeRatio:1.25,spaceRatio:1.618,borderRadius:.2,viewportMin:320,viewportMax:1200};function c(o,e=4){const t=10**e;return Math.round(o*t)/t}function d(o,e,t,s,p){if(Math.abs(e-o)<1e-4)return`${c(o)}rem`;const m=(e-o)*t*100/(p-s),n=o-m*s/(100*t);return`clamp(${c(o)}rem, ${c(n)}rem + ${c(m)}vw, ${c(e)}rem)`}function h(o){const e={};for(let t=0;t<l.length;t++){const s=t-2,p=1.125*o.typeRatio**s;e[l[t]]={min:p,max:p*g}}return e}function x(o){const e={};for(let t=0;t<l.length;t++){const s=E*o.spaceRatio**t;e[l[t]]={min:s,max:s*g}}return e}const S={"--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)"},_={"--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))"},w={"--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",..._};function P(o){const e={},{rootFontSize:t,viewportMin:s,viewportMax:p,borderRadius:m}=o,n=16,a=t/n,u=h(o);for(const r of l){const{min:i,max:v}=u[r];e[`--esp-type-${r}`]=d(i*a,v*a,n,s,p)}Object.assign(e,w);const y=x(o);for(const r of l){const{min:i,max:v}=y[r];e[`--esp-size-${r}`]=d(i*a,v*a,n,s,p)}for(const[r,i]of f)e[`--esp-size-${r}-to-${i}`]=d(y[r].min*a,y[i].max*a,n,s,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(m*a)}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,S),e["--esp-card-min"]="16rem",e}export{z as DEFAULT_SCALE_CONFIG,S as ELEVATION_PROPERTIES,l as STEP_NAMES,_ as TYPE_ROLE_COLOR_PROPERTIES,w as TYPE_ROLE_PROPERTIES,P as generateScaleProperties};
1
+ const l=["tiny","small","normal","medium","big","large","huge"],O=2,b=1.125,f=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 m(s,e,t,p,o){if(Math.abs(e-s)<1e-4)return`${c(s)}rem`;const y=(e-s)*t*100/(o-p),n=s-y*p/(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 p=t-2,o=1.125*s.typeRatio**p;e[l[t]]={min:o,max:o*f}}return e}function x(s){const e={};for(let t=0;t<l.length;t++){const p=u*s.spaceRatio**t;e[l[t]]={min:p,max:p*f}}return e}const w={"--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)"},S={"--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))"},_={"--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)","--esp-type-display-font-weight":"var(--esp-font-weight-headings)","--esp-type-display-line-height":"1.1","--esp-type-display-letter-spacing":"normal",...S};function P(s){const e={},{rootFontSize:t,viewportMin:p,viewportMax:o,borderRadius:y}=s,n=16,r=t/n,d=E(s);for(const a of l){const{min:i,max:v}=d[a];e[`--esp-type-${a}`]=m(i*r,v*r,n,p,o)}e["--esp-type-display-font-size"]=m(d.large.min*r,d.huge.max*r,n,p,o),Object.assign(e,_);const g=x(s);for(const a of l){const{min:i,max:v}=g[a];e[`--esp-size-${a}`]=m(i*r,v*r,n,p,o)}for(const[a,i]of h)e[`--esp-size-${a}-to-${i}`]=m(g[a].min*r,g[i].max*r,n,p,o);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,w),e["--esp-card-min"]="16rem",e}export{z as DEFAULT_SCALE_CONFIG,w as ELEVATION_PROPERTIES,l as STEP_NAMES,S as TYPE_ROLE_COLOR_PROPERTIES,_ as TYPE_ROLE_PROPERTIES,P as generateScaleProperties};
@@ -1,4 +1,4 @@
1
- import{css as r,html as o,nothing as a}from"lit";function i(e={}){return o`
1
+ import{css as r,html as o,nothing as a}from"lit";function t(e={}){return o`
2
2
  <div
3
3
  class="esp-visual-overlay ${e.className??""}"
4
4
  part=${e.rootPart||a}
@@ -8,7 +8,7 @@ import{css as r,html as o,nothing as a}from"lit";function i(e={}){return o`
8
8
  <div class="esp-visual-overlay__scrim" part=${e.scrimPart||a}></div>
9
9
  <div class="esp-visual-overlay__texture" part=${e.texturePart||a}></div>
10
10
  </div>
11
- `}const v=r`
11
+ `}const i=r`
12
12
  .esp-visual-overlay {
13
13
  position: absolute;
14
14
  z-index: var(--_esp-overlay-z-index, auto);
@@ -41,11 +41,18 @@ import{css as r,html as o,nothing as a}from"lit";function i(e={}){return o`
41
41
  }
42
42
 
43
43
  .esp-visual-overlay__texture {
44
- background: var(--_esp-overlay-texture, none);
44
+ background-color: var(--_esp-overlay-texture-color, transparent);
45
+ background-image: var(--_esp-overlay-texture, none);
46
+ background-position: var(--_esp-overlay-texture-position, 0 0);
47
+ background-repeat: var(--_esp-overlay-texture-repeat, repeat);
45
48
  background-size: var(--_esp-overlay-texture-size, auto);
46
49
  opacity: var(--_esp-overlay-texture-opacity, 1);
47
50
  mix-blend-mode: var(--_esp-overlay-texture-blend-mode, normal);
48
51
  filter: var(--_esp-overlay-texture-filter, none);
49
- mask: var(--_esp-overlay-texture-mask, none);
52
+ mask-image: var(--_esp-overlay-texture-mask, none);
53
+ mask-mode: alpha;
54
+ mask-position: var(--_esp-overlay-texture-mask-position, 0 0);
55
+ mask-repeat: var(--_esp-overlay-texture-mask-repeat, repeat);
56
+ mask-size: var(--_esp-overlay-texture-mask-size, auto);
50
57
  }
51
- `;export{i as renderVisualOverlay,v as visualOverlayStyles};
58
+ `;export{t as renderVisualOverlay,i as visualOverlayStyles};