@taprootio/espalier 6.11.0 → 6.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/css/esp-reset.css +17 -0
- package/custom-elements.json +36316 -33823
- package/dist/button/esp-button.d.ts +10 -1
- package/dist/button/esp-button.js +55 -28
- package/dist/columns/esp-columns.d.ts +52 -0
- package/dist/columns/esp-columns.js +45 -0
- package/dist/header/esp-header.d.ts +64 -2
- package/dist/header/esp-header.js +285 -44
- package/dist/header/header-geometry-controller.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/menu/esp-menu-group.d.ts +1 -0
- package/dist/menu/esp-menu-group.js +34 -20
- package/dist/menu/esp-menu-item.d.ts +31 -1
- package/dist/menu/esp-menu-item.js +82 -15
- package/dist/menu/esp-menu.d.ts +3 -2
- package/dist/menu/esp-menu.js +64 -51
- package/dist/menu/menu-presentation.d.ts +1 -0
- package/dist/menu/menu-presentation.js +37 -0
- package/dist/menu/swipe-reveal-controller.js +1 -1
- package/dist/page/bi-directional-sticky-controller.js +1 -1
- package/dist/page/esp-page.d.ts +10 -2
- package/dist/page/esp-page.js +37 -35
- package/dist/page/esp-page.styles.js +36 -0
- package/dist/radio-button/esp-radio-button-group.d.ts +4 -1
- package/dist/radio-button/esp-radio-button-group.js +5 -5
- package/dist/radio-button/esp-radio-button.d.ts +3 -1
- package/dist/radio-button/esp-radio-button.js +6 -6
- package/dist/row/esp-row.js +3 -26
- package/dist/shared/configured-brand.d.ts +3 -1
- package/dist/shared/configured-brand.js +5 -5
- package/dist/shared/layout-gap.js +5 -0
- package/dist/shared/popover-controller.js +1 -1
- package/dist/stack/esp-stack.js +3 -26
- package/espalier.css-data.json +17 -1
- package/espalier.token-manifest.json +25 -1
- package/package.json +5 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as g,html as r,nothing as l}from"lit";function f({scheme:o,brandLogo:n,brandColor:s,lightBrandLogo:a,darkBrandLogo:t,lightBrandColor:d,darkBrandColor:e}){return{brandLogo:(o==="dark"?t:a)||n,brandColor:(o==="dark"?e:d)||s}}const u=g`3 / 1`,$=g`
|
|
2
2
|
.brand-logo {
|
|
3
3
|
overflow-wrap: anywhere;
|
|
4
4
|
}
|
|
5
|
-
`;function
|
|
6
|
-
${o?
|
|
7
|
-
${r
|
|
8
|
-
`;return
|
|
5
|
+
`;function m({brandLogo:o,brandText:n,brandHref:s,brandAlt:a,reserveLogoSpace:t=!1}){if(!o&&!n)return l;const e=o?r`<img class="brand-logo" src=${o} alt=${a||(n?"":"Site logo")} />`:l,c=r`
|
|
6
|
+
${o&&t?r`<span class="brand-logo-reservation">${e}</span>`:e}
|
|
7
|
+
${n?r`<span class="brand-text">${n}</span>`:l}
|
|
8
|
+
`;return s?r`<a class="configured-brand" href=${s}>${c}</a>`:r`<span class="configured-brand">${c}</span>`}export{u as CONFIGURED_BRAND_LOGO_ASPECT_RATIO,$ as configuredBrandLogoGeometry,m as renderConfiguredBrand,f as resolveConfiguredBrand};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{css as r,unsafeCSS as a}from"lit";const i=["none","tiny","small","normal","medium","big","large","huge"],n={none:"0px",tiny:"var(--esp-size-tiny)",small:"var(--esp-size-small)",normal:"var(--esp-size-normal)",medium:"var(--esp-size-medium)",big:"var(--esp-size-big)",large:"var(--esp-size-large)",huge:"var(--esp-size-huge)"};function p(e){return r`
|
|
2
|
+
:host { ${a(e)}: var(--esp-size-normal); }
|
|
3
|
+
${a(i.map(s=>`:host([gap="${s}"]) { ${e}: ${n[s]}; }`).join(`
|
|
4
|
+
`))}
|
|
5
|
+
`}export{i as LAYOUT_GAPS,p as layoutGapStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getEspBus as
|
|
1
|
+
import{getEspBus as l}from"./bus-events.js";import{RafThrottle as c}from"./raf-throttle.js";function h(r,s){let t=s;for(;t;){if(t===r)return!0;t=t instanceof ShadowRoot?t.host:t.parentNode}return!1}function d(r){const s=[],t=new Set;let e=r;for(;e&&!t.has(e);){t.add(e);const i=e["linked-popover"];if(i){e=i;continue}const o=e.closest("esp-popover");if(o){s.includes(o)||s.push(o),e=o.parentElement||o.getRootNode()?.host;continue}const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:void 0}return s}class a{constructor(s){this.bus=l(),this.positionFrame=new c(()=>this.runPositionUpdate()),this.positionResizeObserver=null,this.trackingPosition=!1,this.positionScrollRoots=new Set,this.handleClosePopovers=t=>{if(!this.opts.isOpen())return;const e=this.opts.host;if(this.opts.closeStrategy==="source-identity"){if(!t.source||t.source===e||t.source instanceof Node&&h(e,t.source))return}else if(t.skipPopovers?.includes(e))return;this.opts.onShouldClose()},this.onScrollOrResize=()=>this.positionFrame.schedule(),this.onDocumentClick=t=>{const e=this.opts.host,i=t.composedPath();if(i.includes(e))return;const o=this.opts.getInsideElements?.()??[];for(const n of o)if(n&&i.includes(n))return;this.opts.isOpen()&&this.opts.onOutsideClick?.()},this.opts=s,s.host.addController(this)}hostConnected(){this.bus.subscribe("close-popovers",this.handleClosePopovers)}hostDisconnected(){this.bus.unsubscribe("close-popovers",this.handleClosePopovers),this.stopTracking(),this.stopOutsideClick()}runPositionUpdate(){if(this.opts.isOpen()){if(this.opts.shouldContinueTracking&&!this.opts.shouldContinueTracking()){this.opts.onShouldClose();return}this.opts.onPositionUpdate?.()}}startTracking(){this.opts.onPositionUpdate&&(this.trackingPosition=!0,window.addEventListener("scroll",this.onScrollOrResize,{capture:!0,passive:!0}),window.addEventListener("resize",this.onScrollOrResize,{passive:!0}),this.refreshPositionElements())}refreshPositionElements(){if(this.positionResizeObserver?.disconnect(),this.positionResizeObserver=null,this.clearPositionScrollRoots(),!this.trackingPosition)return;const s=new Set((this.opts.getPositionElements?.()??[this.opts.host]).filter(Boolean));if(this.opts.trackShadowScroll){for(const t of s){let e=t;for(;e;)e instanceof ShadowRoot?(this.positionScrollRoots.add(e),e=e.host):e=e instanceof Element&&e.assignedSlot?e.assignedSlot:e.parentNode}for(const t of this.positionScrollRoots)t.addEventListener("scroll",this.onScrollOrResize,{capture:!0,passive:!0})}if(!(!this.opts.getPositionElements||s.size===0||typeof ResizeObserver>"u")){this.positionResizeObserver=new ResizeObserver(this.onScrollOrResize);for(const t of s)this.positionResizeObserver.observe(t)}}clearPositionScrollRoots(){for(const s of this.positionScrollRoots)s.removeEventListener("scroll",this.onScrollOrResize,{capture:!0});this.positionScrollRoots.clear()}stopTracking(){this.trackingPosition=!1,window.removeEventListener("scroll",this.onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this.onScrollOrResize),this.positionResizeObserver?.disconnect(),this.positionResizeObserver=null,this.clearPositionScrollRoots(),this.positionFrame.cancel()}startOutsideClick(){this.opts.onOutsideClick&&document.addEventListener("click",this.onDocumentClick,!0)}stopOutsideClick(){document.removeEventListener("click",this.onDocumentClick,!0)}publishCloseOthers(s=[]){this.bus.publish("close-popovers",{source:this.opts.host,...s.length>0?{skipPopovers:s}:{}})}}export{a as PopoverController,d as findContainingPopovers,h as isComposedDescendant};
|
package/dist/stack/esp-stack.js
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=function(l,t,a,r){var n=arguments.length,e=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,a):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(l,t,a,r);else for(var o=l.length-1;o>=0;o--)(i=l[o])&&(e=(n<3?i(e):n>3?i(t,a,e):i(t,a))||e);return n>3&&e&&Object.defineProperty(t,a,e),e};import{css as f,html as g}from"lit";import{customElement as h,property as c}from"lit/decorators.js";import{layoutGapStyles as d,LAYOUT_GAPS as m}from"../shared/layout-gap.js";import{EspalierElementBase as u}from"../shared/esp-element-base.js";const v=m,y=["start","center","end","stretch"];let s=class extends u{constructor(){super(...arguments),this.gap="normal",this.align="stretch"}render(){return g`
|
|
2
2
|
<div class="esp-stack" part="stack">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}};s.styles=[...
|
|
5
|
+
`}};s.styles=[...u.styles,d("--_esp-stack-gap"),f`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
|
-
--_esp-stack-gap: var(--esp-size-normal);
|
|
9
8
|
--_esp-stack-align: stretch;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
:host([gap="none"]) {
|
|
13
|
-
--_esp-stack-gap: 0px;
|
|
14
|
-
}
|
|
15
|
-
:host([gap="tiny"]) {
|
|
16
|
-
--_esp-stack-gap: var(--esp-size-tiny);
|
|
17
|
-
}
|
|
18
|
-
:host([gap="small"]) {
|
|
19
|
-
--_esp-stack-gap: var(--esp-size-small);
|
|
20
|
-
}
|
|
21
|
-
:host([gap="medium"]) {
|
|
22
|
-
--_esp-stack-gap: var(--esp-size-medium);
|
|
23
|
-
}
|
|
24
|
-
:host([gap="big"]) {
|
|
25
|
-
--_esp-stack-gap: var(--esp-size-big);
|
|
26
|
-
}
|
|
27
|
-
:host([gap="large"]) {
|
|
28
|
-
--_esp-stack-gap: var(--esp-size-large);
|
|
29
|
-
}
|
|
30
|
-
:host([gap="huge"]) {
|
|
31
|
-
--_esp-stack-gap: var(--esp-size-huge);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
11
|
:host([align="start"]) {
|
|
35
12
|
--_esp-stack-align: flex-start;
|
|
36
13
|
}
|
|
@@ -53,4 +30,4 @@ var o=function(l,t,a,r){var n=arguments.length,e=n<3?t:r===null?r=Object.getOwnP
|
|
|
53
30
|
:host(:not([align])) ::slotted(esp-button-group) {
|
|
54
31
|
align-self: flex-start;
|
|
55
32
|
}
|
|
56
|
-
`],
|
|
33
|
+
`],p([c({reflect:!0,useDefault:!0})],s.prototype,"gap",void 0),p([c({reflect:!0,useDefault:!0})],s.prototype,"align",void 0),s=p([h("esp-stack")],s);export{s as EspalierStack,y as STACK_ALIGNS,v as STACK_GAPS};
|
package/espalier.css-data.json
CHANGED
|
@@ -433,6 +433,10 @@
|
|
|
433
433
|
"name": "--esp-color-warning",
|
|
434
434
|
"description": ""
|
|
435
435
|
},
|
|
436
|
+
{
|
|
437
|
+
"name": "--esp-columns-gap",
|
|
438
|
+
"description": "Overrides the selected gap with a non-negative CSS length, including rem, em, calc() and clamp(). Percentage gaps are not supported. Defaults to the `gap` attribute's step, `normal` when unset."
|
|
439
|
+
},
|
|
436
440
|
{
|
|
437
441
|
"name": "--esp-details-color-background",
|
|
438
442
|
"description": "The background color."
|
|
@@ -945,6 +949,10 @@
|
|
|
945
949
|
"name": "--esp-header-color",
|
|
946
950
|
"description": "The text/icon color inherited by header controls. Defaults to `var(--esp-color-text)`."
|
|
947
951
|
},
|
|
952
|
+
{
|
|
953
|
+
"name": "--esp-header-compact-brand-logo-aspect-ratio",
|
|
954
|
+
"description": "Reserved ratio for a pending compact logo. Defaults to `var(--esp-header-brand-logo-aspect-ratio, 3 / 1)`."
|
|
955
|
+
},
|
|
948
956
|
{
|
|
949
957
|
"name": "--esp-header-compact-height",
|
|
950
958
|
"description": "The height of compact scroll-reactive headers. Defaults to `max(44px, calc(3.5 * var(--esp-size-small)))`."
|
|
@@ -1427,7 +1435,7 @@
|
|
|
1427
1435
|
},
|
|
1428
1436
|
{
|
|
1429
1437
|
"name": "--esp-page-fixed-header-offset",
|
|
1430
|
-
"description": "
|
|
1438
|
+
"description": "Fixed reservation override; also the default visible clearance override. With active header geometry, defaults to the measured expanded header size; legacy headers use `var(--esp-header-height)`."
|
|
1431
1439
|
},
|
|
1432
1440
|
{
|
|
1433
1441
|
"name": "--esp-page-flyout-default-width",
|
|
@@ -1441,6 +1449,10 @@
|
|
|
1441
1449
|
"name": "--esp-page-flyout-min-width",
|
|
1442
1450
|
"description": "Minimum in-grid help width. Defaults to `20rem`."
|
|
1443
1451
|
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "--esp-page-header-expanded-size",
|
|
1454
|
+
"description": "Read-only measured expanded header size exported for descendants. Independent of reservation overrides; unavailable for legacy headers."
|
|
1455
|
+
},
|
|
1444
1456
|
{
|
|
1445
1457
|
"name": "--esp-page-header-z-index",
|
|
1446
1458
|
"description": "Z-index for fixed/sticky header regions. Defaults to `20`."
|
|
@@ -1513,6 +1525,10 @@
|
|
|
1513
1525
|
"name": "--esp-page-surface-shadow",
|
|
1514
1526
|
"description": "The box shadow drawn on the left and right edges of the content surface. On by default; casts into the gutters and is clipped away when the surface fills the viewport, so it only shows above the cap. Set to `none` to remove it."
|
|
1515
1527
|
},
|
|
1528
|
+
{
|
|
1529
|
+
"name": "--esp-page-visible-header-offset",
|
|
1530
|
+
"description": "Independent visible clearance override for menus and sidebars. Defaults to the fixed offset override, then the live measured header size."
|
|
1531
|
+
},
|
|
1516
1532
|
{
|
|
1517
1533
|
"name": "--esp-page-well-max-width",
|
|
1518
1534
|
"description": "The shared content-column width in `kind=\"site\"`: the header and footer alignment contract and every `esp-section` well default to it. Defaults to `72rem`."
|
|
@@ -579,6 +579,12 @@
|
|
|
579
579
|
"category": "root-theme",
|
|
580
580
|
"description": ""
|
|
581
581
|
},
|
|
582
|
+
{
|
|
583
|
+
"name": "--esp-columns-gap",
|
|
584
|
+
"category": "component",
|
|
585
|
+
"component": "esp-columns",
|
|
586
|
+
"description": "Overrides the selected gap with a non-negative CSS length, including rem, em, calc() and clamp(). Percentage gaps are not supported. Defaults to the `gap` attribute's step, `normal` when unset."
|
|
587
|
+
},
|
|
582
588
|
{
|
|
583
589
|
"name": "--esp-details-color-background",
|
|
584
590
|
"category": "component",
|
|
@@ -1332,6 +1338,12 @@
|
|
|
1332
1338
|
"component": "esp-header",
|
|
1333
1339
|
"description": "The text/icon color inherited by header controls. Defaults to `var(--esp-color-text)`."
|
|
1334
1340
|
},
|
|
1341
|
+
{
|
|
1342
|
+
"name": "--esp-header-compact-brand-logo-aspect-ratio",
|
|
1343
|
+
"category": "component",
|
|
1344
|
+
"component": "esp-header",
|
|
1345
|
+
"description": "Reserved ratio for a pending compact logo. Defaults to `var(--esp-header-brand-logo-aspect-ratio, 3 / 1)`."
|
|
1346
|
+
},
|
|
1335
1347
|
{
|
|
1336
1348
|
"name": "--esp-header-compact-height",
|
|
1337
1349
|
"category": "component",
|
|
@@ -2041,7 +2053,7 @@
|
|
|
2041
2053
|
"name": "--esp-page-fixed-header-offset",
|
|
2042
2054
|
"category": "component",
|
|
2043
2055
|
"component": "esp-page",
|
|
2044
|
-
"description": "
|
|
2056
|
+
"description": "Fixed reservation override; also the default visible clearance override. With active header geometry, defaults to the measured expanded header size; legacy headers use `var(--esp-header-height)`."
|
|
2045
2057
|
},
|
|
2046
2058
|
{
|
|
2047
2059
|
"name": "--esp-page-flyout-default-width",
|
|
@@ -2061,6 +2073,12 @@
|
|
|
2061
2073
|
"component": "esp-page",
|
|
2062
2074
|
"description": "Minimum in-grid help width. Defaults to `20rem`."
|
|
2063
2075
|
},
|
|
2076
|
+
{
|
|
2077
|
+
"name": "--esp-page-header-expanded-size",
|
|
2078
|
+
"category": "component",
|
|
2079
|
+
"component": "esp-page",
|
|
2080
|
+
"description": "Read-only measured expanded header size exported for descendants. Independent of reservation overrides; unavailable for legacy headers."
|
|
2081
|
+
},
|
|
2064
2082
|
{
|
|
2065
2083
|
"name": "--esp-page-header-z-index",
|
|
2066
2084
|
"category": "component",
|
|
@@ -2169,6 +2187,12 @@
|
|
|
2169
2187
|
"component": "esp-page",
|
|
2170
2188
|
"description": "The box shadow drawn on the left and right edges of the content surface. On by default; casts into the gutters and is clipped away when the surface fills the viewport, so it only shows above the cap. Set to `none` to remove it."
|
|
2171
2189
|
},
|
|
2190
|
+
{
|
|
2191
|
+
"name": "--esp-page-visible-header-offset",
|
|
2192
|
+
"category": "component",
|
|
2193
|
+
"component": "esp-page",
|
|
2194
|
+
"description": "Independent visible clearance override for menus and sidebars. Defaults to the fixed offset override, then the live measured header size."
|
|
2195
|
+
},
|
|
2172
2196
|
{
|
|
2173
2197
|
"name": "--esp-page-well-max-width",
|
|
2174
2198
|
"category": "component",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/espalier",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.13.0",
|
|
4
4
|
"packageManager": "bun@1.3.12",
|
|
5
5
|
"description": "Espalier — a themeable, accessible, framework-agnostic, enterprise-grade design system built on web standards and love.",
|
|
6
6
|
"customElements": "custom-elements.json",
|
|
@@ -205,6 +205,10 @@
|
|
|
205
205
|
"types": "./dist/stack/esp-stack.d.ts",
|
|
206
206
|
"import": "./dist/stack/esp-stack.js"
|
|
207
207
|
},
|
|
208
|
+
"./columns": {
|
|
209
|
+
"types": "./dist/columns/esp-columns.d.ts",
|
|
210
|
+
"import": "./dist/columns/esp-columns.js"
|
|
211
|
+
},
|
|
208
212
|
"./row": {
|
|
209
213
|
"types": "./dist/row/esp-row.d.ts",
|
|
210
214
|
"import": "./dist/row/esp-row.js"
|