@taprootio/espalier 4.15.0 → 4.17.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 +22 -0
- package/custom-elements.json +5473 -5416
- package/dist/breadcrumbs/esp-breadcrumb.d.ts +20 -4
- package/dist/breadcrumbs/esp-breadcrumb.js +20 -6
- package/dist/breadcrumbs/esp-breadcrumbs.d.ts +16 -2
- package/dist/breadcrumbs/esp-breadcrumbs.js +6 -7
- package/dist/button/esp-button.js +29 -10
- package/dist/image/esp-image.d.ts +73 -1
- package/dist/image/esp-image.js +73 -7
- package/dist/lightbox/esp-lightbox.js +1 -0
- package/dist/tabs/esp-tab-group.js +15 -5
- package/espalier.css-data.json +24 -4
- package/espalier.token-manifest.json +35 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=function(l,t,a,e){var s=arguments.length,r=s<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,a):e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(l,t,a,e);else for(var n=l.length-1;n>=0;n--)(o=l[n])&&(r=(s<3?o(r):s>3?o(t,a,r):o(t,a))||r);return s>3&&r&&Object.defineProperty(t,a,r),r};import{css as u,html as c,nothing as v}from"lit";import{customElement as f,property as g,state as m}from"lit/decorators.js";import{createRef as y,ref as w}from"lit/directives/ref.js";import{EspalierElementBase as b}from"../shared/esp-element-base.js";import{ESP_EVENTS as x}from"../shared/events.js";import{EspalierTab as p}from"./esp-tab.js";import{disabledControl as T}from"../shared/style-fragments.js";let i=class extends b{constructor(){super(...arguments),this.panelsSlot=y(),this.disabled=!1,this.tabData=[]}getTabs(){const t=this.panelsSlot.value?Array.from(this.panelsSlot.value.assignedElements()).filter(a=>a instanceof p):[];return t.length>0?t:Array.from(this.children).filter(a=>a instanceof p)}syncTabData(){const t=this.getTabs();if(t.length===0){this.tabData=[];return}const a=t.find(e=>e.active&&!e.disabled);if(a)for(const e of t)e!==a&&(e.active=!1);else{const e=t.find(s=>!s.disabled);e?e.active=!0:t[0].active=!0}this.tabData=t.map((e,s)=>{const r=`esp-tab-btn-${this.correlationId}-${s}`,o=`esp-tab-panel-${this.correlationId}-${s}`;return e.panelId=o,e.ariaLabelledBy=r,{label:e.label,active:e.active,disabled:this.disabled||e.disabled,buttonId:r,panelId:o}})}activateTab(t){const a=this.getTabs(),e=a[t];if(!(!e||e.disabled||this.disabled)){for(const s of a)s.active=s===e;this.syncTabData(),this.dispatchEvent(new CustomEvent(x.TAB_GROUP_CHANGED,{detail:{index:t,label:e.label},bubbles:!0,composed:!0}))}}handleTabClick(t){this.activateTab(t),this.updateComplete.then(()=>{this.shadowRoot?.getElementById(this.tabData[t]?.buttonId)?.focus()})}handleKeyDown(t){if(!["ArrowLeft","ArrowRight","Home","End"].includes(t.key))return;t.preventDefault();const e=this.tabData.map((n,h)=>({td:n,i:h})).filter(({td:n})=>!n.disabled).map(({i:n})=>n);if(e.length===0)return;const s=this.tabData.findIndex(n=>n.active),r=e.indexOf(s);let o;switch(t.key){case"ArrowRight":r===-1?o=e[0]:o=e[(r+1)%e.length];break;case"ArrowLeft":r===-1?o=e[e.length-1]:o=e[(r-1+e.length)%e.length];break;case"Home":o=e[0];break;case"End":o=e[e.length-1];break;default:return}this.activateTab(o),this.updateComplete.then(()=>{this.shadowRoot?.getElementById(this.tabData[o]?.buttonId)?.focus()})}handleChildUpdated(){this.syncTabData()}handleSlotChange(){this.syncTabData()}connectedCallback(){super.connectedCallback(),this.syncTabData()}willUpdate(t){super.willUpdate(t),t.has("disabled")&&this.syncTabData()}render(){return c`
|
|
2
2
|
<div class="tab-container">
|
|
3
3
|
<div class="tab-list" role="tablist" part="tab-list" @keydown=${this.handleKeyDown}>
|
|
4
|
-
${this.tabData.map((t,a)=>
|
|
4
|
+
${this.tabData.map((t,a)=>c`
|
|
5
5
|
<button
|
|
6
6
|
id=${t.buttonId}
|
|
7
7
|
class="tab-button"
|
|
@@ -9,7 +9,7 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
9
9
|
part="tab-button"
|
|
10
10
|
aria-selected=${t.active?"true":"false"}
|
|
11
11
|
aria-controls=${t.panelId}
|
|
12
|
-
aria-disabled=${t.disabled?"true":
|
|
12
|
+
aria-disabled=${t.disabled?"true":v}
|
|
13
13
|
tabindex=${t.active?"0":"-1"}
|
|
14
14
|
?disabled=${t.disabled}
|
|
15
15
|
@click=${()=>this.handleTabClick(a)}
|
|
@@ -26,7 +26,7 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
26
26
|
></slot>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
|
-
`}};
|
|
29
|
+
`}};i.styles=[...b.styles,T(".tab-button[disabled]"),u`
|
|
30
30
|
:host {
|
|
31
31
|
display: block;
|
|
32
32
|
--_esp-tab-resolved-button-hover: var(
|
|
@@ -43,6 +43,8 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.tab-container {
|
|
46
|
+
|
|
47
|
+
--_esp-tab-inner-radius: max(0px, calc(var(--esp-size-border-radius) - 1px));
|
|
46
48
|
background-color: var(--esp-tab-color-background, var(--esp-color-layer-1));
|
|
47
49
|
border-radius: var(--esp-size-border-radius);
|
|
48
50
|
box-shadow: 1px 1px 4px var(--esp-color-shadow);
|
|
@@ -50,11 +52,14 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
50
52
|
overflow: hidden;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
|
|
53
56
|
.tab-list {
|
|
54
57
|
display: flex;
|
|
55
58
|
overflow-x: auto;
|
|
56
59
|
background-color: var(--esp-tab-color-strip-background, var(--esp-color-layer-1));
|
|
57
60
|
border-bottom: 1px solid var(--esp-tab-color-border, var(--esp-color-border));
|
|
61
|
+
border-start-start-radius: var(--_esp-tab-inner-radius);
|
|
62
|
+
border-start-end-radius: var(--_esp-tab-inner-radius);
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
.tab-button {
|
|
@@ -90,6 +95,11 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
90
95
|
cursor: default;
|
|
91
96
|
}
|
|
92
97
|
|
|
98
|
+
|
|
99
|
+
.tab-button:first-child {
|
|
100
|
+
border-start-start-radius: var(--_esp-tab-inner-radius);
|
|
101
|
+
}
|
|
102
|
+
|
|
93
103
|
.tab-button:first-child[aria-selected="true"] {
|
|
94
104
|
border-left: none;
|
|
95
105
|
}
|
|
@@ -109,4 +119,4 @@ var b=function(i,t,a,e){var s=arguments.length,o=s<3?t:e===null?e=Object.getOwnP
|
|
|
109
119
|
.panels {
|
|
110
120
|
|
|
111
121
|
}
|
|
112
|
-
`],
|
|
122
|
+
`],d([g({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),d([m()],i.prototype,"tabData",void 0),i=d([f("esp-tab-group")],i);export{i as EspalierTabGroup};
|
package/espalier.css-data.json
CHANGED
|
@@ -79,15 +79,23 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "--esp-breadcrumb-color",
|
|
82
|
-
"description": "The text color of the breadcrumb link."
|
|
82
|
+
"description": "The text color of the breadcrumb link. Defaults to `var(--esp-color-link)`, so a trail reads as navigation in the same ink as the links in the surrounding content."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "--esp-breadcrumb-current-color",
|
|
86
|
+
"description": "The text color of the current-page crumb, which is not a link. Defaults to `--esp-breadcrumb-color` when that is set, then to `var(--esp-color-headings)`, keeping the current page distinct from the links beside it."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "--esp-breadcrumb-hover-background",
|
|
90
|
+
"description": "The background behind a hovered link. Defaults to `var(--esp-color-link-hover-bg)`."
|
|
83
91
|
},
|
|
84
92
|
{
|
|
85
93
|
"name": "--esp-breadcrumb-hover-color",
|
|
86
|
-
"description": "The text color on hover."
|
|
94
|
+
"description": "The text color on hover. Defaults to `var(--esp-color-link-hover)`."
|
|
87
95
|
},
|
|
88
96
|
{
|
|
89
97
|
"name": "--esp-breadcrumb-separator-color",
|
|
90
|
-
"description": "
|
|
98
|
+
"description": "The color of the separator icons. Defaults to `oklch(from var(--esp-color-link) l c calc(h + 90))`, an accent that takes the link ink's scheme-adapted lightness and chroma at a different hue, so the arrows are their own color rather than the heading color. Set it on `esp-breadcrumbs` to recolor a whole trail, or on one `esp-breadcrumb` to recolor a single arrow."
|
|
91
99
|
},
|
|
92
100
|
{
|
|
93
101
|
"name": "--esp-button-group-divider",
|
|
@@ -1035,7 +1043,19 @@
|
|
|
1035
1043
|
},
|
|
1036
1044
|
{
|
|
1037
1045
|
"name": "--esp-image-scrim-color",
|
|
1038
|
-
"description": "Scrim ink; defaults to the theme background when the banner polarity matches the scheme, else a polarity-pinned derivation."
|
|
1046
|
+
"description": "Scrim ink; defaults to the theme background when the banner polarity matches the scheme, else a polarity-pinned derivation. A `scrim-edge=\"flush\"` join is seamless only while the ink is the adjoining band's own color, so an explicit cross-scheme `banner-scheme` (or an override to any other color) makes the edge a deliberate color break rather than a dissolve."
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"name": "--esp-image-scrim-edge-depth",
|
|
1050
|
+
"description": "How far a `scrim-edge=\"flush\"` edge takes to relax from full alpha to the ordinary scrim strength, along the gradient axis; defaults to `12%`."
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"name": "--esp-image-scrim-edge-image",
|
|
1054
|
+
"description": "Background image painted over the flush edge and faded out with it — the adjoining band's seamless tile; defaults to `none`. Inert unless `scrim-edge=\"flush\"` resolves onto a directional scrim."
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
"name": "--esp-image-scrim-edge-size",
|
|
1058
|
+
"description": "Background size for `--esp-image-scrim-edge-image`; defaults to `auto`. Match the adjoining band's own `background-size` for a continuous tile."
|
|
1039
1059
|
},
|
|
1040
1060
|
{
|
|
1041
1061
|
"name": "--esp-image-scrim-opacity",
|
|
@@ -117,19 +117,31 @@
|
|
|
117
117
|
"name": "--esp-breadcrumb-color",
|
|
118
118
|
"category": "component",
|
|
119
119
|
"component": "esp-breadcrumb",
|
|
120
|
-
"description": "The text color of the breadcrumb link."
|
|
120
|
+
"description": "The text color of the breadcrumb link. Defaults to `var(--esp-color-link)`, so a trail reads as navigation in the same ink as the links in the surrounding content."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "--esp-breadcrumb-current-color",
|
|
124
|
+
"category": "component",
|
|
125
|
+
"component": "esp-breadcrumb",
|
|
126
|
+
"description": "The text color of the current-page crumb, which is not a link. Defaults to `--esp-breadcrumb-color` when that is set, then to `var(--esp-color-headings)`, keeping the current page distinct from the links beside it."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "--esp-breadcrumb-hover-background",
|
|
130
|
+
"category": "component",
|
|
131
|
+
"component": "esp-breadcrumb",
|
|
132
|
+
"description": "The background behind a hovered link. Defaults to `var(--esp-color-link-hover-bg)`."
|
|
121
133
|
},
|
|
122
134
|
{
|
|
123
135
|
"name": "--esp-breadcrumb-hover-color",
|
|
124
136
|
"category": "component",
|
|
125
137
|
"component": "esp-breadcrumb",
|
|
126
|
-
"description": "The text color on hover."
|
|
138
|
+
"description": "The text color on hover. Defaults to `var(--esp-color-link-hover)`."
|
|
127
139
|
},
|
|
128
140
|
{
|
|
129
141
|
"name": "--esp-breadcrumb-separator-color",
|
|
130
142
|
"category": "component",
|
|
131
|
-
"component": "esp-
|
|
132
|
-
"description": "
|
|
143
|
+
"component": "esp-breadcrumb",
|
|
144
|
+
"description": "The color of the separator icons. Defaults to `oklch(from var(--esp-color-link) l c calc(h + 90))`, an accent that takes the link ink's scheme-adapted lightness and chroma at a different hue, so the arrows are their own color rather than the heading color. Set it on `esp-breadcrumbs` to recolor a whole trail, or on one `esp-breadcrumb` to recolor a single arrow."
|
|
133
145
|
},
|
|
134
146
|
{
|
|
135
147
|
"name": "--esp-button-group-divider",
|
|
@@ -1468,7 +1480,25 @@
|
|
|
1468
1480
|
"name": "--esp-image-scrim-color",
|
|
1469
1481
|
"category": "component",
|
|
1470
1482
|
"component": "esp-image",
|
|
1471
|
-
"description": "Scrim ink; defaults to the theme background when the banner polarity matches the scheme, else a polarity-pinned derivation."
|
|
1483
|
+
"description": "Scrim ink; defaults to the theme background when the banner polarity matches the scheme, else a polarity-pinned derivation. A `scrim-edge=\"flush\"` join is seamless only while the ink is the adjoining band's own color, so an explicit cross-scheme `banner-scheme` (or an override to any other color) makes the edge a deliberate color break rather than a dissolve."
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
"name": "--esp-image-scrim-edge-depth",
|
|
1487
|
+
"category": "component",
|
|
1488
|
+
"component": "esp-image",
|
|
1489
|
+
"description": "How far a `scrim-edge=\"flush\"` edge takes to relax from full alpha to the ordinary scrim strength, along the gradient axis; defaults to `12%`."
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
"name": "--esp-image-scrim-edge-image",
|
|
1493
|
+
"category": "component",
|
|
1494
|
+
"component": "esp-image",
|
|
1495
|
+
"description": "Background image painted over the flush edge and faded out with it — the adjoining band's seamless tile; defaults to `none`. Inert unless `scrim-edge=\"flush\"` resolves onto a directional scrim."
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"name": "--esp-image-scrim-edge-size",
|
|
1499
|
+
"category": "component",
|
|
1500
|
+
"component": "esp-image",
|
|
1501
|
+
"description": "Background size for `--esp-image-scrim-edge-image`; defaults to `auto`. Match the adjoining band's own `background-size` for a continuous tile."
|
|
1472
1502
|
},
|
|
1473
1503
|
{
|
|
1474
1504
|
"name": "--esp-image-scrim-opacity",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/espalier",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.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",
|