@taprootio/espalier 6.15.0 → 6.15.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.
- package/CHANGELOG.md +6 -0
- package/custom-elements.json +197 -150
- package/dist/header/esp-header.js +13 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# 6.15.1
|
|
2
|
+
|
|
3
|
+
Header controls stay in place while a pointer click takes over from keyboard focus.
|
|
4
|
+
|
|
5
|
+
- A scrolled header keeps its current height from a primary pointer press through activation, so opening navigation or a popover cannot lose its click to compaction. Cancelled presses, disabled controls and detached headers release the hold normally.
|
|
6
|
+
|
|
1
7
|
# 6.15.0
|
|
2
8
|
|
|
3
9
|
Footer colors now reach every paragraph and link inside `esp-footer`.
|
package/custom-elements.json
CHANGED
|
@@ -6669,16 +6669,32 @@
|
|
|
6669
6669
|
},
|
|
6670
6670
|
{
|
|
6671
6671
|
"kind": "javascript-module",
|
|
6672
|
-
"path": "dist/
|
|
6672
|
+
"path": "dist/box/esp-box.js",
|
|
6673
6673
|
"declarations": [
|
|
6674
6674
|
{
|
|
6675
6675
|
"kind": "class",
|
|
6676
|
-
"description": "
|
|
6677
|
-
"name": "
|
|
6676
|
+
"description": "Groups related content in a themed container. Style its `box` CSS part\nto create cards, forms, or other grouped regions.\n\nA field fills one layer above the surface it sits on.\nUse `surface-layer=\"1|2|3|4\"` to select the default painted layer.\n\n```html\n<esp-box>\n <h2>Box things</h2>\n <p>Things grouped visually.</p>\n</esp-box>\n```\n\n**What esp-box is not:** a full-bleed page band. The box is a *card* —\nit paints its own raised surface (`--esp-color-layer-1`), carries\npadding, and fills its container's height. A band is\n[`esp-section`](/components/section): it paints the local canvas edge\nto edge with a centered well and hosts a theme zone (`context=\"…\"`)\nwith nothing to neutralize. Keep boxes for what they are for — cards,\npanels, and form surfaces — and replace any pre-3.2 \"neutralized box\"\nband with a bare section.\n\nSelect a raised form surface with `surface-layer`; fields follow it automatically.\n\n```html\n<esp-box surface-layer=\"2\">\n <esp-input placeholder=\"Search\"></esp-input>\n <esp-input readonly value=\"A read-only value\"></esp-input>\n</esp-box>\n```",
|
|
6677
|
+
"name": "EspalierBox",
|
|
6678
6678
|
"cssProperties": [
|
|
6679
6679
|
{
|
|
6680
|
-
"description": "
|
|
6681
|
-
"name": "--esp-
|
|
6680
|
+
"description": "The background color of the box.",
|
|
6681
|
+
"name": "--esp-color-box-background"
|
|
6682
|
+
},
|
|
6683
|
+
{
|
|
6684
|
+
"description": "Adds a layer in the background of the box. Intended for background images or gradients.",
|
|
6685
|
+
"name": "--esp-box-background"
|
|
6686
|
+
},
|
|
6687
|
+
{
|
|
6688
|
+
"description": "The opacity of the background layer.",
|
|
6689
|
+
"name": "--esp-box-background-opacity"
|
|
6690
|
+
},
|
|
6691
|
+
{
|
|
6692
|
+
"description": "The padding inside the box.",
|
|
6693
|
+
"name": "--esp-size-box-padding"
|
|
6694
|
+
},
|
|
6695
|
+
{
|
|
6696
|
+
"description": "The box's drop shadow. Defaults to the theme's `--esp-shadow-1` elevation. ```html <style> esp-root[scheme=\"light\"] { esp-box.box-with-bg { --esp-box-background: url(/assets/espalier-paper-texture.png) repeat; --esp-box-background-opacity: .5; } } esp-root[scheme=\"dark\"] { esp-box.box-with-bg { --esp-box-background: url(/assets/espalier-geometric-texture.png) repeat; --esp-box-background-opacity: .5; } } </style> <esp-box class=\"box-with-bg\"> <h2>Box with background image</h2> <p>I have a different generated background texture in dark mode than light mode.</p> </esp-box> ```",
|
|
6697
|
+
"name": "--esp-box-shadow"
|
|
6682
6698
|
},
|
|
6683
6699
|
{
|
|
6684
6700
|
"description": "Background color of the shared field shell. Defaults to one layer above the nearest declared surface, capped at `var(--esp-color-layer-4)`, or `var(--esp-color-layer-2)` without a declared surface. An explicit override wins.",
|
|
@@ -6737,67 +6753,29 @@
|
|
|
6737
6753
|
}
|
|
6738
6754
|
}
|
|
6739
6755
|
],
|
|
6756
|
+
"cssParts": [
|
|
6757
|
+
{
|
|
6758
|
+
"description": "The box element. The default style is a padded element displayed as a box. Style the CSS part to create cards, forms, and other UI elements. Here is a card style: ```html <style> esp-box.card-box::part(box) { display: grid; grid-template-rows: min-content min-content; gap: var(--esp-size-padding); padding: 0; } esp-box.card-box header { background: oklch(from var(--esp-color-complementary) var(--esp-l-text) c h); color: oklch(from var(--esp-color-complementary) var(--esp-l-surface) c h); font-size: var(--esp-size-big-to-large); padding: var(--esp-size-padding); line-height: 1.1; font-family: var(--esp-font-headings, var(--esp-font-body, system-ui, sans-serif)); } esp-box.card-box div { padding: var(--esp-size-padding); } </style> <esp-box class=\"card-box\"> <header>Box as a card</header> <div> <p>Card content.</p> </div> </esp-box> ```",
|
|
6759
|
+
"name": "box"
|
|
6760
|
+
}
|
|
6761
|
+
],
|
|
6740
6762
|
"slots": [
|
|
6741
6763
|
{
|
|
6742
|
-
"description": "
|
|
6764
|
+
"description": "The default slot holds elements to display in the box. ```html <esp-box> <h2>Slotted Content</h2> <p>Goes in the box</p> </esp-box> ```",
|
|
6743
6765
|
"name": ""
|
|
6744
|
-
},
|
|
6745
|
-
{
|
|
6746
|
-
"description": "Optional custom icon. When provided, it overrides the generated SVG from the `icon` attribute.",
|
|
6747
|
-
"name": "icon"
|
|
6748
6766
|
}
|
|
6749
6767
|
],
|
|
6750
6768
|
"members": [
|
|
6751
6769
|
{
|
|
6752
6770
|
"kind": "field",
|
|
6753
|
-
"name": "
|
|
6771
|
+
"name": "fullScreen",
|
|
6754
6772
|
"type": {
|
|
6755
6773
|
"text": "boolean"
|
|
6756
6774
|
},
|
|
6757
|
-
"privacy": "protected",
|
|
6758
|
-
"default": "false",
|
|
6759
|
-
"description": "Whether a non-neutral intent emits its inline tokens\n(`--esp-color-primary` and the filled-action pair). Interactive\ncontrols need them; chrome whose intent treatment is class-based\n(badges, callouts, status pills — see `intentSurfaceTokens`) opts\nout so a decorative intent never rewrites inherited tokens for\nslotted content.",
|
|
6760
|
-
"inheritedFrom": {
|
|
6761
|
-
"name": "EspalierElementBase",
|
|
6762
|
-
"module": "dist/shared/esp-element-base.js"
|
|
6763
|
-
}
|
|
6764
|
-
},
|
|
6765
|
-
{
|
|
6766
|
-
"kind": "field",
|
|
6767
|
-
"name": "iconSlot",
|
|
6768
|
-
"privacy": "private",
|
|
6769
|
-
"default": "new SlottedIconController(this)"
|
|
6770
|
-
},
|
|
6771
|
-
{
|
|
6772
|
-
"kind": "field",
|
|
6773
|
-
"name": "sizeBacker",
|
|
6774
|
-
"type": {
|
|
6775
|
-
"text": "EspalierBadgeSize"
|
|
6776
|
-
},
|
|
6777
|
-
"privacy": "private",
|
|
6778
|
-
"default": "\"small\""
|
|
6779
|
-
},
|
|
6780
|
-
{
|
|
6781
|
-
"kind": "field",
|
|
6782
|
-
"name": "icon",
|
|
6783
|
-
"type": {
|
|
6784
|
-
"text": "string"
|
|
6785
|
-
},
|
|
6786
6775
|
"privacy": "public",
|
|
6787
|
-
"default": "
|
|
6788
|
-
"description": "
|
|
6789
|
-
"attribute": "
|
|
6790
|
-
},
|
|
6791
|
-
{
|
|
6792
|
-
"kind": "field",
|
|
6793
|
-
"name": "size",
|
|
6794
|
-
"type": {
|
|
6795
|
-
"text": "EspalierBadgeSize"
|
|
6796
|
-
},
|
|
6797
|
-
"privacy": "public",
|
|
6798
|
-
"description": "Badge size.",
|
|
6799
|
-
"attribute": "size",
|
|
6800
|
-
"reflects": true
|
|
6776
|
+
"default": "false",
|
|
6777
|
+
"description": "Whether the box should take up the full screen. Useful when\ndisplaying a dialog in full-screen mode.\n\n```html\n<esp-box>\n <h2>Box things</h2>\n <esp-box>\n <h2>Box in box</h2>\n <esp-button label=\"Toggle full screen\"></esp-button>\n </esp-box>\n</esp-box>\n<script>\n let fullScreen = false;\n const theBox = findByTagName(\"esp-box\")[0];\n const theButton = findByTagName(\"esp-button\")[0];\n theButton.addEventListener(\"esp-clicked\", () => {\n fullScreen = !fullScreen;\n\n if(fullScreen) {\n theBox.setAttribute(\"full-screen\", true);\n } else {\n theBox.removeAttribute(\"full-screen\");\n }\n });\n</script>\n```\n\nA full-screen box fills the viewport. Inside a\n[bounded dialog](/components/dialog) it fills exactly the dialog's\nrectangle instead: it takes its position and size from the same\n`--esp-dialog-inset-*` custom properties, set on the `esp-dialog` or any\nancestor of the box.\n\n```html\n<style>\n esp-dialog.bounded-box {\n --esp-dialog-inset-block-start: 6rem;\n --esp-dialog-inset-inline-start: 3rem;\n --esp-dialog-inset-inline-end: 3rem;\n --esp-dialog-inset-block-end: 2rem;\n }\n</style>\n<esp-dialog class=\"bounded-box\" full-screen>\n <esp-box full-screen>\n <h2>Box in a bounded dialog</h2>\n <p>This box fills the rectangle the dialog is bounded to.</p>\n <esp-button intent=\"danger\" label=\"Close\"></esp-button>\n </esp-box>\n</esp-dialog>\n<esp-button label=\"Show Dialog\"></esp-button>\n<script>\n const theDialog = findByTagName(\"esp-dialog\")[0];\n const buttons = findByTagName(\"esp-button\");\n buttons[0].addEventListener(\"esp-clicked\", () => {\n theDialog.toggleOpen();\n });\n buttons[1].addEventListener(\"esp-clicked\", () => {\n theDialog.toggleOpen();\n });\n</script>\n```",
|
|
6778
|
+
"attribute": "full-screen"
|
|
6801
6779
|
},
|
|
6802
6780
|
{
|
|
6803
6781
|
"kind": "field",
|
|
@@ -6925,6 +6903,20 @@
|
|
|
6925
6903
|
"module": "dist/shared/esp-element-base.js"
|
|
6926
6904
|
}
|
|
6927
6905
|
},
|
|
6906
|
+
{
|
|
6907
|
+
"kind": "field",
|
|
6908
|
+
"name": "intentEmitsTokens",
|
|
6909
|
+
"type": {
|
|
6910
|
+
"text": "boolean"
|
|
6911
|
+
},
|
|
6912
|
+
"privacy": "protected",
|
|
6913
|
+
"default": "true",
|
|
6914
|
+
"description": "Whether a non-neutral intent emits its inline tokens\n(`--esp-color-primary` and the filled-action pair). Interactive\ncontrols need them; chrome whose intent treatment is class-based\n(badges, callouts, status pills — see `intentSurfaceTokens`) opts\nout so a decorative intent never rewrites inherited tokens for\nslotted content.",
|
|
6915
|
+
"inheritedFrom": {
|
|
6916
|
+
"name": "EspalierElementBase",
|
|
6917
|
+
"module": "dist/shared/esp-element-base.js"
|
|
6918
|
+
}
|
|
6919
|
+
},
|
|
6928
6920
|
{
|
|
6929
6921
|
"kind": "field",
|
|
6930
6922
|
"name": "warnedUnknownIntents",
|
|
@@ -7512,21 +7504,13 @@
|
|
|
7512
7504
|
],
|
|
7513
7505
|
"attributes": [
|
|
7514
7506
|
{
|
|
7515
|
-
"name": "
|
|
7516
|
-
"type": {
|
|
7517
|
-
"text": "string"
|
|
7518
|
-
},
|
|
7519
|
-
"default": "\"\"",
|
|
7520
|
-
"description": "Optional icon name from the Espalier SVG sprite.",
|
|
7521
|
-
"fieldName": "icon"
|
|
7522
|
-
},
|
|
7523
|
-
{
|
|
7524
|
-
"name": "size",
|
|
7507
|
+
"name": "full-screen",
|
|
7525
7508
|
"type": {
|
|
7526
|
-
"text": "
|
|
7509
|
+
"text": "boolean"
|
|
7527
7510
|
},
|
|
7528
|
-
"
|
|
7529
|
-
"
|
|
7511
|
+
"default": "false",
|
|
7512
|
+
"description": "Whether the box should take up the full screen. Useful when\ndisplaying a dialog in full-screen mode.\n\n```html\n<esp-box>\n <h2>Box things</h2>\n <esp-box>\n <h2>Box in box</h2>\n <esp-button label=\"Toggle full screen\"></esp-button>\n </esp-box>\n</esp-box>\n<script>\n let fullScreen = false;\n const theBox = findByTagName(\"esp-box\")[0];\n const theButton = findByTagName(\"esp-button\")[0];\n theButton.addEventListener(\"esp-clicked\", () => {\n fullScreen = !fullScreen;\n\n if(fullScreen) {\n theBox.setAttribute(\"full-screen\", true);\n } else {\n theBox.removeAttribute(\"full-screen\");\n }\n });\n</script>\n```\n\nA full-screen box fills the viewport. Inside a\n[bounded dialog](/components/dialog) it fills exactly the dialog's\nrectangle instead: it takes its position and size from the same\n`--esp-dialog-inset-*` custom properties, set on the `esp-dialog` or any\nancestor of the box.\n\n```html\n<style>\n esp-dialog.bounded-box {\n --esp-dialog-inset-block-start: 6rem;\n --esp-dialog-inset-inline-start: 3rem;\n --esp-dialog-inset-inline-end: 3rem;\n --esp-dialog-inset-block-end: 2rem;\n }\n</style>\n<esp-dialog class=\"bounded-box\" full-screen>\n <esp-box full-screen>\n <h2>Box in a bounded dialog</h2>\n <p>This box fills the rectangle the dialog is bounded to.</p>\n <esp-button intent=\"danger\" label=\"Close\"></esp-button>\n </esp-box>\n</esp-dialog>\n<esp-button label=\"Show Dialog\"></esp-button>\n<script>\n const theDialog = findByTagName(\"esp-dialog\")[0];\n const buttons = findByTagName(\"esp-button\");\n buttons[0].addEventListener(\"esp-clicked\", () => {\n theDialog.toggleOpen();\n });\n buttons[1].addEventListener(\"esp-clicked\", () => {\n theDialog.toggleOpen();\n });\n</script>\n```",
|
|
7513
|
+
"fieldName": "fullScreen"
|
|
7530
7514
|
},
|
|
7531
7515
|
{
|
|
7532
7516
|
"type": {
|
|
@@ -7581,78 +7565,66 @@
|
|
|
7581
7565
|
"name": "EspalierElementBase",
|
|
7582
7566
|
"module": "dist/shared/esp-element-base.js"
|
|
7583
7567
|
},
|
|
7568
|
+
"tagName": "esp-box",
|
|
7569
|
+
"customElement": true,
|
|
7584
7570
|
"docPageTitle": {
|
|
7585
|
-
"name": "
|
|
7571
|
+
"name": "Box",
|
|
7586
7572
|
"description": ""
|
|
7587
7573
|
},
|
|
7588
7574
|
"docUrl": {
|
|
7589
|
-
"name": "/components/
|
|
7575
|
+
"name": "/components/box",
|
|
7590
7576
|
"description": ""
|
|
7591
7577
|
},
|
|
7592
7578
|
"menuGroup": {
|
|
7593
|
-
"name": "
|
|
7594
|
-
"description": "
|
|
7579
|
+
"name": "Structure",
|
|
7580
|
+
"description": ""
|
|
7581
|
+
},
|
|
7582
|
+
"menuOrder": {
|
|
7583
|
+
"name": "3",
|
|
7584
|
+
"description": ""
|
|
7595
7585
|
},
|
|
7596
7586
|
"menuLabel": {
|
|
7597
|
-
"name": "
|
|
7587
|
+
"name": "Box",
|
|
7598
7588
|
"description": ""
|
|
7599
7589
|
},
|
|
7600
7590
|
"menuIcon": {
|
|
7601
|
-
"name": "
|
|
7591
|
+
"name": "box",
|
|
7602
7592
|
"description": ""
|
|
7603
7593
|
},
|
|
7604
|
-
"tagName": "esp-badge",
|
|
7605
|
-
"customElement": true,
|
|
7606
7594
|
"events": []
|
|
7607
7595
|
}
|
|
7608
7596
|
],
|
|
7609
7597
|
"exports": [
|
|
7610
7598
|
{
|
|
7611
7599
|
"kind": "js",
|
|
7612
|
-
"name": "
|
|
7600
|
+
"name": "EspalierBox",
|
|
7613
7601
|
"declaration": {
|
|
7614
|
-
"name": "
|
|
7615
|
-
"module": "dist/
|
|
7602
|
+
"name": "EspalierBox",
|
|
7603
|
+
"module": "dist/box/esp-box.js"
|
|
7616
7604
|
}
|
|
7617
7605
|
},
|
|
7618
7606
|
{
|
|
7619
7607
|
"kind": "custom-element-definition",
|
|
7620
|
-
"name": "esp-
|
|
7608
|
+
"name": "esp-box",
|
|
7621
7609
|
"declaration": {
|
|
7622
|
-
"name": "
|
|
7623
|
-
"module": "dist/
|
|
7610
|
+
"name": "EspalierBox",
|
|
7611
|
+
"module": "dist/box/esp-box.js"
|
|
7624
7612
|
}
|
|
7625
7613
|
}
|
|
7626
7614
|
]
|
|
7627
7615
|
},
|
|
7628
7616
|
{
|
|
7629
7617
|
"kind": "javascript-module",
|
|
7630
|
-
"path": "dist/
|
|
7618
|
+
"path": "dist/badge/esp-badge.js",
|
|
7631
7619
|
"declarations": [
|
|
7632
7620
|
{
|
|
7633
7621
|
"kind": "class",
|
|
7634
|
-
"description": "
|
|
7635
|
-
"name": "
|
|
7622
|
+
"description": "A compact status chip for counts, labels, and semantic state.\n\nBadges truncate long labels with an ellipsis when their container\nconstrains them. Leave enough inline space for critical status text\nthat must remain fully visible.\n\n```html\n<div style=\"display: flex; flex-wrap: wrap; gap: var(--esp-size-tiny);\">\n <esp-badge>Draft</esp-badge>\n <esp-badge intent=\"success\" icon=\"circle-dot\">Published</esp-badge>\n <esp-badge intent=\"warning\">Pending review</esp-badge>\n <esp-badge intent=\"danger\" icon=\"circle-x\">Banned</esp-badge>\n <esp-badge intent=\"info\" size=\"medium\" icon=\"info-i\">12 updates</esp-badge>\n</div>\n```",
|
|
7623
|
+
"name": "EspalierBadge",
|
|
7636
7624
|
"cssProperties": [
|
|
7637
7625
|
{
|
|
7638
|
-
"description": "
|
|
7639
|
-
"name": "--esp-
|
|
7640
|
-
},
|
|
7641
|
-
{
|
|
7642
|
-
"description": "Adds a layer in the background of the box. Intended for background images or gradients.",
|
|
7643
|
-
"name": "--esp-box-background"
|
|
7644
|
-
},
|
|
7645
|
-
{
|
|
7646
|
-
"description": "The opacity of the background layer.",
|
|
7647
|
-
"name": "--esp-box-background-opacity"
|
|
7648
|
-
},
|
|
7649
|
-
{
|
|
7650
|
-
"description": "The padding inside the box.",
|
|
7651
|
-
"name": "--esp-size-box-padding"
|
|
7652
|
-
},
|
|
7653
|
-
{
|
|
7654
|
-
"description": "The box's drop shadow. Defaults to the theme's `--esp-shadow-1` elevation. ```html <style> esp-root[scheme=\"light\"] { esp-box.box-with-bg { --esp-box-background: url(/assets/espalier-paper-texture.png) repeat; --esp-box-background-opacity: .5; } } esp-root[scheme=\"dark\"] { esp-box.box-with-bg { --esp-box-background: url(/assets/espalier-geometric-texture.png) repeat; --esp-box-background-opacity: .5; } } </style> <esp-box class=\"box-with-bg\"> <h2>Box with background image</h2> <p>I have a different generated background texture in dark mode than light mode.</p> </esp-box> ```",
|
|
7655
|
-
"name": "--esp-box-shadow"
|
|
7626
|
+
"description": "Border radius of the badge shell. Defaults to `999px`.",
|
|
7627
|
+
"name": "--esp-badge-border-radius"
|
|
7656
7628
|
},
|
|
7657
7629
|
{
|
|
7658
7630
|
"description": "Background color of the shared field shell. Defaults to one layer above the nearest declared surface, capped at `var(--esp-color-layer-4)`, or `var(--esp-color-layer-2)` without a declared surface. An explicit override wins.",
|
|
@@ -7711,29 +7683,67 @@
|
|
|
7711
7683
|
}
|
|
7712
7684
|
}
|
|
7713
7685
|
],
|
|
7714
|
-
"cssParts": [
|
|
7715
|
-
{
|
|
7716
|
-
"description": "The box element. The default style is a padded element displayed as a box. Style the CSS part to create cards, forms, and other UI elements. Here is a card style: ```html <style> esp-box.card-box::part(box) { display: grid; grid-template-rows: min-content min-content; gap: var(--esp-size-padding); padding: 0; } esp-box.card-box header { background: oklch(from var(--esp-color-complementary) var(--esp-l-text) c h); color: oklch(from var(--esp-color-complementary) var(--esp-l-surface) c h); font-size: var(--esp-size-big-to-large); padding: var(--esp-size-padding); line-height: 1.1; font-family: var(--esp-font-headings, var(--esp-font-body, system-ui, sans-serif)); } esp-box.card-box div { padding: var(--esp-size-padding); } </style> <esp-box class=\"card-box\"> <header>Box as a card</header> <div> <p>Card content.</p> </div> </esp-box> ```",
|
|
7717
|
-
"name": "box"
|
|
7718
|
-
}
|
|
7719
|
-
],
|
|
7720
7686
|
"slots": [
|
|
7721
7687
|
{
|
|
7722
|
-
"description": "
|
|
7688
|
+
"description": "Badge label text.",
|
|
7723
7689
|
"name": ""
|
|
7690
|
+
},
|
|
7691
|
+
{
|
|
7692
|
+
"description": "Optional custom icon. When provided, it overrides the generated SVG from the `icon` attribute.",
|
|
7693
|
+
"name": "icon"
|
|
7724
7694
|
}
|
|
7725
7695
|
],
|
|
7726
7696
|
"members": [
|
|
7727
7697
|
{
|
|
7728
7698
|
"kind": "field",
|
|
7729
|
-
"name": "
|
|
7699
|
+
"name": "intentEmitsTokens",
|
|
7730
7700
|
"type": {
|
|
7731
7701
|
"text": "boolean"
|
|
7732
7702
|
},
|
|
7733
|
-
"privacy": "
|
|
7703
|
+
"privacy": "protected",
|
|
7734
7704
|
"default": "false",
|
|
7735
|
-
"description": "Whether
|
|
7736
|
-
"
|
|
7705
|
+
"description": "Whether a non-neutral intent emits its inline tokens\n(`--esp-color-primary` and the filled-action pair). Interactive\ncontrols need them; chrome whose intent treatment is class-based\n(badges, callouts, status pills — see `intentSurfaceTokens`) opts\nout so a decorative intent never rewrites inherited tokens for\nslotted content.",
|
|
7706
|
+
"inheritedFrom": {
|
|
7707
|
+
"name": "EspalierElementBase",
|
|
7708
|
+
"module": "dist/shared/esp-element-base.js"
|
|
7709
|
+
}
|
|
7710
|
+
},
|
|
7711
|
+
{
|
|
7712
|
+
"kind": "field",
|
|
7713
|
+
"name": "iconSlot",
|
|
7714
|
+
"privacy": "private",
|
|
7715
|
+
"default": "new SlottedIconController(this)"
|
|
7716
|
+
},
|
|
7717
|
+
{
|
|
7718
|
+
"kind": "field",
|
|
7719
|
+
"name": "sizeBacker",
|
|
7720
|
+
"type": {
|
|
7721
|
+
"text": "EspalierBadgeSize"
|
|
7722
|
+
},
|
|
7723
|
+
"privacy": "private",
|
|
7724
|
+
"default": "\"small\""
|
|
7725
|
+
},
|
|
7726
|
+
{
|
|
7727
|
+
"kind": "field",
|
|
7728
|
+
"name": "icon",
|
|
7729
|
+
"type": {
|
|
7730
|
+
"text": "string"
|
|
7731
|
+
},
|
|
7732
|
+
"privacy": "public",
|
|
7733
|
+
"default": "\"\"",
|
|
7734
|
+
"description": "Optional icon name from the Espalier SVG sprite.",
|
|
7735
|
+
"attribute": "icon"
|
|
7736
|
+
},
|
|
7737
|
+
{
|
|
7738
|
+
"kind": "field",
|
|
7739
|
+
"name": "size",
|
|
7740
|
+
"type": {
|
|
7741
|
+
"text": "EspalierBadgeSize"
|
|
7742
|
+
},
|
|
7743
|
+
"privacy": "public",
|
|
7744
|
+
"description": "Badge size.",
|
|
7745
|
+
"attribute": "size",
|
|
7746
|
+
"reflects": true
|
|
7737
7747
|
},
|
|
7738
7748
|
{
|
|
7739
7749
|
"kind": "field",
|
|
@@ -7861,20 +7871,6 @@
|
|
|
7861
7871
|
"module": "dist/shared/esp-element-base.js"
|
|
7862
7872
|
}
|
|
7863
7873
|
},
|
|
7864
|
-
{
|
|
7865
|
-
"kind": "field",
|
|
7866
|
-
"name": "intentEmitsTokens",
|
|
7867
|
-
"type": {
|
|
7868
|
-
"text": "boolean"
|
|
7869
|
-
},
|
|
7870
|
-
"privacy": "protected",
|
|
7871
|
-
"default": "true",
|
|
7872
|
-
"description": "Whether a non-neutral intent emits its inline tokens\n(`--esp-color-primary` and the filled-action pair). Interactive\ncontrols need them; chrome whose intent treatment is class-based\n(badges, callouts, status pills — see `intentSurfaceTokens`) opts\nout so a decorative intent never rewrites inherited tokens for\nslotted content.",
|
|
7873
|
-
"inheritedFrom": {
|
|
7874
|
-
"name": "EspalierElementBase",
|
|
7875
|
-
"module": "dist/shared/esp-element-base.js"
|
|
7876
|
-
}
|
|
7877
|
-
},
|
|
7878
7874
|
{
|
|
7879
7875
|
"kind": "field",
|
|
7880
7876
|
"name": "warnedUnknownIntents",
|
|
@@ -8462,13 +8458,21 @@
|
|
|
8462
8458
|
],
|
|
8463
8459
|
"attributes": [
|
|
8464
8460
|
{
|
|
8465
|
-
"name": "
|
|
8461
|
+
"name": "icon",
|
|
8466
8462
|
"type": {
|
|
8467
|
-
"text": "
|
|
8463
|
+
"text": "string"
|
|
8468
8464
|
},
|
|
8469
|
-
"default": "
|
|
8470
|
-
"description": "
|
|
8471
|
-
"fieldName": "
|
|
8465
|
+
"default": "\"\"",
|
|
8466
|
+
"description": "Optional icon name from the Espalier SVG sprite.",
|
|
8467
|
+
"fieldName": "icon"
|
|
8468
|
+
},
|
|
8469
|
+
{
|
|
8470
|
+
"name": "size",
|
|
8471
|
+
"type": {
|
|
8472
|
+
"text": "EspalierBadgeSize"
|
|
8473
|
+
},
|
|
8474
|
+
"description": "Badge size.",
|
|
8475
|
+
"fieldName": "size"
|
|
8472
8476
|
},
|
|
8473
8477
|
{
|
|
8474
8478
|
"type": {
|
|
@@ -8523,50 +8527,46 @@
|
|
|
8523
8527
|
"name": "EspalierElementBase",
|
|
8524
8528
|
"module": "dist/shared/esp-element-base.js"
|
|
8525
8529
|
},
|
|
8526
|
-
"tagName": "esp-box",
|
|
8527
|
-
"customElement": true,
|
|
8528
8530
|
"docPageTitle": {
|
|
8529
|
-
"name": "
|
|
8531
|
+
"name": "Badge",
|
|
8530
8532
|
"description": ""
|
|
8531
8533
|
},
|
|
8532
8534
|
"docUrl": {
|
|
8533
|
-
"name": "/components/
|
|
8535
|
+
"name": "/components/badge",
|
|
8534
8536
|
"description": ""
|
|
8535
8537
|
},
|
|
8536
8538
|
"menuGroup": {
|
|
8537
|
-
"name": "
|
|
8538
|
-
"description": ""
|
|
8539
|
-
},
|
|
8540
|
-
"menuOrder": {
|
|
8541
|
-
"name": "3",
|
|
8542
|
-
"description": ""
|
|
8539
|
+
"name": "Data",
|
|
8540
|
+
"description": "Display"
|
|
8543
8541
|
},
|
|
8544
8542
|
"menuLabel": {
|
|
8545
|
-
"name": "
|
|
8543
|
+
"name": "Badge",
|
|
8546
8544
|
"description": ""
|
|
8547
8545
|
},
|
|
8548
8546
|
"menuIcon": {
|
|
8549
|
-
"name": "
|
|
8547
|
+
"name": "tags",
|
|
8550
8548
|
"description": ""
|
|
8551
8549
|
},
|
|
8550
|
+
"tagName": "esp-badge",
|
|
8551
|
+
"customElement": true,
|
|
8552
8552
|
"events": []
|
|
8553
8553
|
}
|
|
8554
8554
|
],
|
|
8555
8555
|
"exports": [
|
|
8556
8556
|
{
|
|
8557
8557
|
"kind": "js",
|
|
8558
|
-
"name": "
|
|
8558
|
+
"name": "EspalierBadge",
|
|
8559
8559
|
"declaration": {
|
|
8560
|
-
"name": "
|
|
8561
|
-
"module": "dist/
|
|
8560
|
+
"name": "EspalierBadge",
|
|
8561
|
+
"module": "dist/badge/esp-badge.js"
|
|
8562
8562
|
}
|
|
8563
8563
|
},
|
|
8564
8564
|
{
|
|
8565
8565
|
"kind": "custom-element-definition",
|
|
8566
|
-
"name": "esp-
|
|
8566
|
+
"name": "esp-badge",
|
|
8567
8567
|
"declaration": {
|
|
8568
|
-
"name": "
|
|
8569
|
-
"module": "dist/
|
|
8568
|
+
"name": "EspalierBadge",
|
|
8569
|
+
"module": "dist/badge/esp-badge.js"
|
|
8570
8570
|
}
|
|
8571
8571
|
}
|
|
8572
8572
|
]
|
|
@@ -34335,21 +34335,68 @@
|
|
|
34335
34335
|
"privacy": "private",
|
|
34336
34336
|
"default": "false"
|
|
34337
34337
|
},
|
|
34338
|
+
{
|
|
34339
|
+
"kind": "field",
|
|
34340
|
+
"name": "pointerActivation",
|
|
34341
|
+
"type": {
|
|
34342
|
+
"text": "{ pointerId: number; path: EventTarget[] } | null"
|
|
34343
|
+
},
|
|
34344
|
+
"privacy": "private",
|
|
34345
|
+
"default": "null"
|
|
34346
|
+
},
|
|
34338
34347
|
{
|
|
34339
34348
|
"kind": "field",
|
|
34340
34349
|
"name": "onGeometryKeyboard",
|
|
34341
34350
|
"privacy": "private"
|
|
34342
34351
|
},
|
|
34352
|
+
{
|
|
34353
|
+
"kind": "method",
|
|
34354
|
+
"name": "geometryPointerBlocked",
|
|
34355
|
+
"privacy": "private",
|
|
34356
|
+
"return": {
|
|
34357
|
+
"type": {
|
|
34358
|
+
"text": "boolean"
|
|
34359
|
+
}
|
|
34360
|
+
},
|
|
34361
|
+
"parameters": [
|
|
34362
|
+
{
|
|
34363
|
+
"name": "path",
|
|
34364
|
+
"type": {
|
|
34365
|
+
"text": "EventTarget[]"
|
|
34366
|
+
}
|
|
34367
|
+
}
|
|
34368
|
+
]
|
|
34369
|
+
},
|
|
34343
34370
|
{
|
|
34344
34371
|
"kind": "field",
|
|
34345
34372
|
"name": "onGeometryPointer",
|
|
34346
34373
|
"privacy": "private"
|
|
34347
34374
|
},
|
|
34375
|
+
{
|
|
34376
|
+
"kind": "field",
|
|
34377
|
+
"name": "releaseGeometryPointer",
|
|
34378
|
+
"privacy": "private"
|
|
34379
|
+
},
|
|
34348
34380
|
{
|
|
34349
34381
|
"kind": "field",
|
|
34350
34382
|
"name": "onGeometryPointerEnd",
|
|
34351
34383
|
"privacy": "private"
|
|
34352
34384
|
},
|
|
34385
|
+
{
|
|
34386
|
+
"kind": "field",
|
|
34387
|
+
"name": "onGeometryClick",
|
|
34388
|
+
"privacy": "private"
|
|
34389
|
+
},
|
|
34390
|
+
{
|
|
34391
|
+
"kind": "field",
|
|
34392
|
+
"name": "onGeometryDrag",
|
|
34393
|
+
"privacy": "private"
|
|
34394
|
+
},
|
|
34395
|
+
{
|
|
34396
|
+
"kind": "field",
|
|
34397
|
+
"name": "onGeometryBlur",
|
|
34398
|
+
"privacy": "private"
|
|
34399
|
+
},
|
|
34353
34400
|
{
|
|
34354
34401
|
"kind": "field",
|
|
34355
34402
|
"name": "openHeaderPopovers",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=function(f,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(f,e,t,r);else for(var d=f.length-1;d>=0;d--)(i=f[d])&&(s=(n<3?i(s):n>3?i(e,t,s):i(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};import{paintedSurface as Q}from"../shared/surface-layer.js";import{css as I,html as b,nothing as p,unsafeCSS as Y}from"lit";import{customElement as K,property as l,state as v}from"lit/decorators.js";import{classMap as W}from"lit/directives/class-map.js";import{styleMap as Z}from"lit/directives/style-map.js";import"../burger/esp-burger.js";import{createRef as A,ref as H}from"lit/directives/ref.js";import{MENU_PRESENTATION_CHANGED as S,MENU_LAYOUT_CHANGED as R,MENU_FIT_PROBE_STYLES as J,menuPresentationStyle as X,renderMenuNode as ee}from"../menu/menu-presentation.js";import{EspalierMenu as T}from"../menu/esp-menu.js";import{RafThrottle as q}from"../shared/raf-throttle.js";import{viewportSize as te}from"../shared/viewport.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as U,configuredBrandLogoGeometry as re,renderConfiguredBrand as F,resolveConfiguredBrand as ne}from"../shared/configured-brand.js";import{EspalierElementBase as V}from"../shared/esp-element-base.js";import{ESP_EVENTS as x}from"../shared/events.js";import{HEADER_GEOMETRY_PAINT_PROPERTIES as oe,HeaderGeometryController as ie}from"./header-geometry-controller.js";const ae="(max-width: 36rem)",G=I`
|
|
2
2
|
background-color 0.24s ease,
|
|
3
3
|
border-color 0.24s ease,
|
|
4
4
|
box-shadow 0.24s ease,
|
|
5
5
|
color 0.24s ease,
|
|
6
6
|
transform 0.24s ease
|
|
7
|
-
`;function L(f,e){const t=new Set(f);return{allowedValues:t,converter:{fromAttribute(n){return n??e},toAttribute(n){return t.has(n)?n:e}},defaultValue:e}}const ie=["standard","centered-brand","centered-menu","extended","extended-centered","minimal"],de=["start","center","end"],le=["truncate","wrap","nowrap"],he=["auto","inline","drawer"],ce=["hidden","visible"],ue=["compact","standard"],j=new Set(Array.from({length:41},(f,e)=>(e+10)/10)),M=L(ie,"standard"),D=L(de,"start"),z=L(le,"truncate"),B=L(he,"auto"),O=L(ce,"hidden"),P=L(ue,"compact");let o=class extends V{constructor(){super(...arguments),this.menuOpen=!1,this.navigationConstrained=!1,this.menuTooLarge=!1,this.mobileMenu=!1,this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0,this.showBurger=!1,this.layout=M.defaultValue,this.brandText="",this.brandLogo="",this.lightBrandLogo="",this.darkBrandLogo="",this.compactBrandLogo="",this.lightCompactBrandLogo="",this.darkCompactBrandLogo="",this.heightMultiplier=1,this.minHeightMultiplier=1,this.compactSize=P.defaultValue,this.brandHref="",this.brandAlt="",this.brandColor="",this.lightBrandColor="",this.darkBrandColor="",this.brandAlign=D.defaultValue,this.brandWrap=z.defaultValue,this.menuDisplay=B.defaultValue,this.themeToggle=O.defaultValue,this.scrollBehavior="none",this.scrollThreshold=16,this.dockOffset=0,this.drawerTarget="",this.previewCollapseRequested=!1,this.fullBleedContent=!1,this.geometry=new ae(this,()=>({heightMultiplier:this.heightMultiplier,minHeightMultiplier:this.minHeightMultiplier,compactSize:this.compactSize,compactLogo:!!(this.compactBrandLogo||this.lightCompactBrandLogo||this.darkCompactBrandLogo)}),()=>this.syncBrandFitWidth(),()=>this.runScrollStateUpdate(!0)),this.readyCompactLogo="",this.naturalBrandWidth=0,this.syncCompactLogoReadiness=()=>{const e=this.shadowRoot?.querySelector(".compact-brand-fit .brand-logo"),t=this.compactLogoSource,r=t&&e?.getAttribute("src")===t&&e.complete&&e.naturalWidth>0?t:"";r!==this.readyCompactLogo&&(this.readyCompactLogo=r)},this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.onGeometryKeyboard=()=>{this.pointerFocusPending=!1,this.keyboardFocusHeld=!0,this.updateScrollState()},this.onGeometryPointer=()=>{this.pointerFocusPending=!0,this.keyboardFocusHeld=!1,this.updateScrollState()},this.onGeometryPointerEnd=()=>{this.pointerFocusPending=!1},this.openHeaderPopovers=new Set,this.onHeaderPopoverOpened=e=>{e.target&&this.openHeaderPopovers.add(e.target),this.updateScrollState()},this.onHeaderPopoverClosed=e=>{e.target&&this.openHeaderPopovers.delete(e.target),this.updateScrollState()},this.onHeaderGroupToggle=e=>{e.detail.open?this.onHeaderPopoverOpened(e):this.onHeaderPopoverClosed(e)},this.onGeometryFocus=e=>{const t=e.composedPath();this.keyboardFocusHeld=!this.pointerFocusPending&&t.some(r=>r instanceof Element&&r.matches(":focus-visible")),this.updateScrollState()},this.onGeometryFocusOut=()=>{queueMicrotask(()=>{this.matches(":focus-within")||(this.keyboardFocusHeld=!1,this.pointerFocusPending=!1),this.updateScrollState()})},this.menuContainer=A(),this.menuButton=A(),this.menu=void 0,this.externalDrawerTarget=null,this.lastScrollY=0,this.lastInlineMenuWidth=0,this.mobileMenuQuery=null,this.menuDrawerListenersAttached=!1,this.observingMenuContainer=!1,this.scrollListenersAttached=!1,this.scrollFrame=new U(()=>this.runScrollStateUpdate()),this.resizeObserver=new ResizeObserver(()=>this.syncMenuLayout()),this.menuChildObserver=null,this.endProbe=A(),this.observedEndProbe=null,this.endProbeObserver=null,this.invalidMenuSlot=null,this.actionsWidth=0,this.syncPrimaryMenu=()=>{const r=(this.menuContainer.value?.querySelector('slot[name="menu"]')?.assignedElements()??[])[0],n=r instanceof T&&r.parentElement===this?r:void 0,i=r&&!n?r:null;i&&i!==this.invalidMenuSlot&&console.warn("<esp-header>: the menu slot expects an <esp-menu> element, received",i),this.invalidMenuSlot=i,this.geometry.setPrimaryMenu(n),n!==this.menu&&(this.demoteMenuToggle(),this.removeMenuDrawerListeners(),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null,this.menu.sliding=!1),this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.menu=n,this.lastInlineMenuWidth=0,this.lastDrawerBrandKey="",this.addMenuDrawerListeners(),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.observeMenuChildren(),this.syncDrawerBrand(),this.requestUpdate()),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.menu?.addEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=this.menu.mode==="horizontal"?this:null),this.syncExternalDrawerTarget(),this.syncMenuLayout()},this.onPrimaryPresentationChanged=()=>{this.menu?.headerDrawerActive&&this.returnEndFocusToBurger(),this.requestUpdate()},this.onPrimaryLayoutChanged=()=>{if(!this.menu)return;this.geometry.invalidate();const e=this.menu.mode==="horizontal"&&this.menu.parentElement===this?this:null;this.menu.headerEndOwner!==e&&(this.menu.headerEndOwner=e),this.menu.headerDrawerActive&&this.returnEndFocusToBurger(),this.observeMenuChildren(),this.requestUpdate(),this.syncMenuLayout()},this.updateScrollState=()=>this.scrollFrame.schedule(),this.handleMobileMenuQueryChange=e=>{this.mobileMenu=e.matches,this.syncMenuLayout(),this.syncExternalDrawerControl()},this.toggleTheme=()=>{const e=this.getThemeRoot();if(!e)return;e.scheme=e.scheme==="dark"?"light":"dark";const t=e.scheme==="dark"?"dark":"light";this.dispatchEvent(new CustomEvent(x.HEADER_THEME_TOGGLE,{detail:{scheme:t},bubbles:!0,composed:!0}))},this.handleMenuToggleClicked=()=>{if(this.menuOpen){this.closeNav();return}this.openNav()},this.onMenuDrawerOpened=()=>{this.menuOpen=!0,document.body.classList.add("menu-open"),this.burger&&(this.burger.menuOpen=!0)},this.onMenuDrawerClosed=()=>{this.menuOpen=!1,document.body.classList.remove("menu-open"),this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle(),this.updateScrollState()},this.onMenuDrawerPresented=e=>{e.target!==this.menu||!this.menu?.isFullScreenDrawer||this.promoteMenuToggle()},this.menuTogglePromoted=!1,this.promotedToggleFrame=new U(()=>this.positionPromotedToggle()),this.handlePromotedViewportResize=()=>this.promotedToggleFrame.schedule(),this.lastDrawerBrandKey="",this.inertedHeaderChrome=[],this.onGeometryContentChanged=()=>this.geometry.invalidate()}resolveBrand(){return ne({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor})}get compactLogoSource(){if(!this.resolveBrand().brandLogo)return"";const e=this.scheme==="dark"?this.darkCompactBrandLogo:this.lightCompactBrandLogo,t=this.scheme==="dark"?this.lightCompactBrandLogo:this.darkCompactBrandLogo;return e||this.compactBrandLogo||t}syncBrandFitWidth(){const e=this.menuContainer.value?.parentElement;if(!e)return;const t=e.querySelector(".brand-fit-probe");this.naturalBrandWidth=t?.getBoundingClientRect().width??0;const r=e.querySelector('slot[name="brand"]')?.assignedElements().length,n=[...t?.querySelectorAll(".brand-logo")??[]].map(d=>d.getBoundingClientRect().width),i=getComputedStyle(e),a=[i.paddingTop,i.paddingBottom,i.borderTopWidth,i.borderBottomWidth].reduce((d,h)=>d+(parseFloat(h)||0),0);for(const[d,h]of[["--_esp-header-stable-brand-width",this.geometry.active&&!r?this.naturalBrandWidth:null],["--_esp-header-logo-reservation-width",Math.max(0,...n)],["--_esp-header-bar-block-insets",a]])if(h===null)e.style.removeProperty(d);else{const c=`${h}px`;e.style.getPropertyValue(d)!==c&&e.style.setProperty(d,c)}}get headerOverlayHeld(){for(const e of this.openHeaderPopovers)e instanceof Element&&!e.isConnected&&this.openHeaderPopovers.delete(e);return this.menuOpen||this.openHeaderPopovers.size>0}get usesIntrinsicNavigation(){return!!this.menu?.headerNavigationOwned}syncEndProbeObserver(){const e=this.endProbe.value??null;e!==this.observedEndProbe&&(this.endProbeObserver?.disconnect(),this.observedEndProbe=e,e&&(this.endProbeObserver??=new ResizeObserver(()=>this.syncMenuLayout()),this.endProbeObserver.observe(e,{box:"border-box"})),this.syncMenuLayout())}returnEndFocusToBurger(){const e=this.shadowRoot?.querySelector(".header-end"),t=this.shadowRoot?.activeElement;t&&e?.contains(t)&&this.updateComplete.then(()=>this.getBurgerFocusTarget()?.focus({preventScroll:!0}))}readHeaderEndFit(){const e=this.menuContainer.value?.parentElement;if(!e||!this.menu)return null;const t=getComputedStyle(e),r=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0),n=parseFloat(t.columnGap)||0,i=e.querySelector(":scope > .brand"),d=i?.querySelector("slot")?.assignedElements().length?Math.max(i?.scrollWidth??0,i?.getBoundingClientRect().width??0):this.naturalBrandWidth,h=e.querySelector(":scope > .buttons"),c=Array.from(h?.children??[]).flatMap(g=>g.matches(".header-end, .header-end-measurement, .menu-toggle")?[]:g instanceof HTMLSlotElement?g.assignedElements():[g]).filter(g=>getComputedStyle(g).display!=="none");let u=c.reduce((g,G)=>{const $=getComputedStyle(G);return g+G.getBoundingClientRect().width+(parseFloat($.marginLeft)||0)+(parseFloat($.marginRight)||0)},0);const E=this.endProbe.value?.getBoundingClientRect().width??0,m=h&&parseFloat(getComputedStyle(h).columnGap)||0;u+=m*Math.max(0,c.length-1+(E>0?1:0));const y=this.menu.getHeaderNavigationWidths().main,w=E+u,_=this.layout==="extended"?y>r||d+w+n>r:this.layout==="extended-centered"?y>r||d+2*w+2*n>r:this.layout==="centered-brand"?d+2*Math.max(y,w)+2*n>r:d+y+w+2*n>r,C=this.getExternalDrawerTarget()?h?.querySelector(".menu-toggle"):null,k=u+(C&&getComputedStyle(C).display!=="none"?C.getBoundingClientRect().width+(c.length||E?m:0):0);return{width:r,brandWidth:d,main:y,endWidth:E,actions:u,actionFloor:k,gap:n,tooWide:_}}syncMenuLayout(){if(this.syncBrandFitWidth(),!this.menuContainer.value||!this.menu||!this.menu.getWidth)return;this.positionPromotedToggle();const e=this.menu.getWidth();e>0&&(this.lastInlineMenuWidth=e);const t=this.lastInlineMenuWidth||e,r=this.getExternalDrawerTarget(),n=this.menuDisplay!=="inline",i=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested,a=n&&this.menuDisplay==="auto",d=a?this.layout==="centered-menu"?this.centeredMenuCapacity():this.menuContainer.value.clientWidth:0,h=this.usesIntrinsicNavigation?this.readHeaderEndFit():null;h&&this.actionsWidth!==h.actionFloor&&(this.actionsWidth=h.actionFloor,this.requestUpdate()),this.menuTooLarge=a&&(h?h.tooWide:t>d);const c=n&&!r&&this.hasDrawerableContent()&&(this.menuTooLarge||i||this.mobileMenu);c&&this.returnEndFocusToBurger(),this.menu.sliding=c,this.navigationConstrained=h?.tooWide??!1}centeredMenuCapacity(){const e=this.menuContainer.value?.parentElement;if(!(e instanceof HTMLElement))return 0;const t=d=>d?d.getBoundingClientRect().width:0,r=getComputedStyle(e),n=e.clientWidth-(Number.parseFloat(r.paddingLeft)||0)-(Number.parseFloat(r.paddingRight)||0),i=e.querySelector(":scope > section.brand"),a=e.querySelector(":scope > section.buttons");return n-t(i)-t(a)+t(a?.querySelector("esp-header-button.menu-toggle"))}menuHasContent(){return!!(this.menu??this.querySelector(':scope > [slot="menu"]'))?.querySelector("esp-menu-item, esp-menu-group")}hasDrawerableContent(){return this.showBurger||!!this.getExternalDrawerTarget()||this.menuHasContent()}getExternalDrawerTarget(){if(!this.drawerTarget)return null;const e=document.getElementById(this.drawerTarget);return e===this.menu?null:e&&"openDrawer"in e&&typeof e.openDrawer=="function"&&"closeDrawer"in e&&typeof e.closeDrawer=="function"?e:null}getBurgerFocusTarget(){const t=this.shadowRoot?.querySelector("esp-header-button.menu-toggle")?.shadowRoot?.querySelector("button"),r=this.menuButton.value?.shadowRoot?.querySelector("button");return t??r??null}getScrollTokens(){const e=this.scrollBehavior.split(/\s+/).map(t=>t.trim().toLowerCase()).filter(Boolean);return new Set(e.filter(t=>t!=="none"))}getEffectiveScrollThreshold(){return Number.isFinite(this.scrollThreshold)?Math.max(0,this.scrollThreshold):0}clearScrollState(){this.geometry.requestScroll(0,!1,!1,this.getEffectiveScrollThreshold(),!1),this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0}runScrollStateUpdate(e=!1){const t=this.getScrollTokens();if(!t.size){e||this.clearScrollState();return}const r=Math.max(0,window.scrollY||document.documentElement.scrollTop||0),n=this.getEffectiveScrollThreshold(),i=Number.isFinite(this.dockOffset)?Math.max(0,this.dockOffset):n,a=r>(t.has("dock")?i:n),d=r>this.lastScrollY,h=t.has("reveal")&&d&&r>n&&!this.menuOpen;if(this.geometry.requestScroll(r,t.has("compact"),t.has("collapse-topbar")&&a,n,this.headerOverlayHeld||this.keyboardFocusHeld),!e){if(this.scrolled=a,this.hiddenByScroll=h,t.has("progress")){const c=document.documentElement,u=Math.max(1,c.scrollHeight-window.innerHeight);this.scrollProgress=Math.min(1,r/u)}else this.scrollProgress=0;this.lastScrollY=r}}cancelScrollUpdate(){this.scrollFrame.cancel()}syncScrollListeners(){const e=this.getScrollTokens().size>0;if(e&&!this.scrollListenersAttached?(window.addEventListener("scroll",this.updateScrollState,{passive:!0}),window.addEventListener("resize",this.updateScrollState,{passive:!0}),this.scrollListenersAttached=!0):!e&&this.scrollListenersAttached&&this.removeScrollListeners(),e){this.updateScrollState();return}this.cancelScrollUpdate(),this.clearScrollState()}removeScrollListeners(){this.scrollListenersAttached&&(window.removeEventListener("scroll",this.updateScrollState),window.removeEventListener("resize",this.updateScrollState),this.scrollListenersAttached=!1)}addMenuDrawerListeners(){!this.menu||this.menuDrawerListenersAttached||(this.menu.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.addEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!0)}removeMenuDrawerListeners(){!this.menu||!this.menuDrawerListenersAttached||(this.menu.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.removeEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!1)}observeMenuContainer(){if(!this.menuContainer.value||this.observingMenuContainer)return;this.resizeObserver.observe(this.menuContainer.value);const e=this.menuContainer.value.parentElement;if(e){this.resizeObserver.observe(e);for(const t of e.querySelectorAll(":scope > section.brand, :scope > section.buttons, :scope > .brand-fit-probe"))this.resizeObserver.observe(t)}this.observingMenuContainer=!0}disconnectResizeObserver(){this.observingMenuContainer&&(this.resizeObserver.disconnect(),this.observingMenuContainer=!1)}observeMenuChildren(){if(this.usesIntrinsicNavigation){this.menuChildObserver?.disconnect(),this.menuChildObserver=null;return}!this.menu||this.menuChildObserver||(this.menuChildObserver=new MutationObserver(()=>{this.syncMenuLayout(),this.requestUpdate()}),this.menuChildObserver.observe(this.menu,{childList:!0,subtree:!0}))}syncMobileMenuQuery(){if("matchMedia"in window){if(!this.mobileMenuQuery){this.mobileMenuQuery=window.matchMedia(se),this.mobileMenu=this.mobileMenuQuery.matches,this.mobileMenuQuery.addEventListener("change",this.handleMobileMenuQueryChange);return}this.mobileMenu=this.mobileMenuQuery.matches}}getThemeRoot(){return this.traverseToClosest("esp-root")}syncExternalDrawerTarget(){const e=this.getExternalDrawerTarget(),t=e===this.menu?null:e;t!==this.externalDrawerTarget&&(this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=t,this.externalDrawerTarget?.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed)),this.syncExternalDrawerControl()}burgerVisibleForTarget(){if(this.menuDisplay==="inline")return!1;const e=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested;return this.menuTooLarge||this.mobileMenu||e}syncExternalDrawerControl(){this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=this.burgerVisibleForTarget())}openNav(){const e=this.getBurgerFocusTarget(),t=this.getExternalDrawerTarget();if(this.burger&&(this.burger.menuOpen=!0),t){this.menuOpen=!0,t.openDrawer(e),document.body.classList.add("menu-open");return}if(this.menu){this.menu.sliding=!0,this.menuOpen=!0,this.menu.isFullScreenDrawer&&this.canPromoteMenuToggle()&&(this.menu.liftedCloseControl=this.getMenuToggleElement()),this.menu.openDrawer(e),document.body.classList.add("menu-open");return}this.burger&&(this.burger.menuOpen=!1)}closeNav(){this.menuOpen=!1,this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle();const e=this.getExternalDrawerTarget();if(e){e.closeDrawer(),document.body.classList.remove("menu-open");return}this.menu&&(this.menu.closeDrawer(),document.body.classList.remove("menu-open"))}getMenuToggleElement(){return this.shadowRoot?.querySelector("esp-header-button.menu-toggle")??null}canPromoteMenuToggle(){const e=this.getMenuToggleElement();return!!e&&typeof e?.showPopover=="function"}setHeaderChromeInert(e){if(!e){for(const a of this.inertedHeaderChrome)a.inert=!1;this.inertedHeaderChrome=[];return}const t=this.menuContainer.value?.parentElement,r=this.getMenuToggleElement();if(!t||!r)return;const n=[];for(const a of t.querySelectorAll(":scope > section.brand, :scope > section.topbar"))n.push(a);const i=t.querySelector(":scope > section.buttons");for(const a of i?.children??[])if(!(!(a instanceof HTMLElement)||a===r)){if(a instanceof HTMLSlotElement){for(const d of a.assignedElements())d instanceof HTMLElement&&n.push(d);continue}n.push(a)}for(const a of n)a.inert||(a.inert=!0,this.inertedHeaderChrome.push(a))}promoteMenuToggle(){const e=this.getMenuToggleElement();if(!e||this.menuTogglePromoted||typeof e.showPopover!="function")return;const t=e.getBoundingClientRect();e.setAttribute("popover","manual"),Object.assign(e.style,{position:"fixed",inset:"auto",margin:"0",padding:"0",border:"0",background:"transparent",overflow:"visible"}),this.setPromotedTogglePosition(e,t.width);try{e.showPopover()}catch{e.removeAttribute("popover"),e.removeAttribute("style"),this.menu&&(this.menu.liftedCloseControl=null);return}this.menuTogglePromoted=!0,window.addEventListener("resize",this.handlePromotedViewportResize),this.menu&&(this.menu.liftedCloseControl=e),this.setHeaderChromeInert(!0)}positionPromotedToggle(){if(!this.menuTogglePromoted)return;const e=this.getMenuToggleElement();if(!e)return;const t=e.getBoundingClientRect();this.setPromotedTogglePosition(e,t.width)}setPromotedTogglePosition(e,t){const r=te(),n=getComputedStyle(e).direction==="rtl";e.style.left=`${n?0:Math.max(0,r.width-t)}px`,e.style.top="0px"}demoteMenuToggle(){if(window.removeEventListener("resize",this.handlePromotedViewportResize),this.promotedToggleFrame.cancel(),this.menu?.liftedCloseControl&&(this.menu.liftedCloseControl=null),!this.menuTogglePromoted)return;this.menuTogglePromoted=!1,this.setHeaderChromeInert(!1);const e=this.getMenuToggleElement();if(e){try{e.hidePopover()}catch{}e.removeAttribute("popover"),e.removeAttribute("style")}}syncDrawerBrand(){if(!this.menu)return;const e=this.resolveBrand(),t=e.brandLogo||this.brandText?{brandLogo:e.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt,brandColor:e.brandColor}:null,r=JSON.stringify(t);r!==this.lastDrawerBrandKey&&(this.lastDrawerBrandKey=r,this.menu.drawerBrand=t)}get burger(){return this.menuButton.value??void 0}willUpdate(e){super.willUpdate(e),j.has(this.heightMultiplier)||(this.heightMultiplier=1),j.has(this.minHeightMultiplier)||(this.minHeightMultiplier=1),P.allowedValues.has(this.compactSize)||(this.compactSize=P.defaultValue),["heightMultiplier","minHeightMultiplier","compactSize","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&this.geometry.configure(),["scheme","brandLogo","lightBrandLogo","darkBrandLogo","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&(this.readyCompactLogo=""),e.has("layout")&&!M.allowedValues.has(this.layout)&&(this.layout=M.defaultValue),e.has("brandAlign")&&!D.allowedValues.has(this.brandAlign)&&(this.brandAlign=D.defaultValue),e.has("brandWrap")&&!z.allowedValues.has(this.brandWrap)&&(this.brandWrap=z.defaultValue),e.has("menuDisplay")&&!B.allowedValues.has(this.menuDisplay)&&(this.menuDisplay=B.defaultValue),e.has("themeToggle")&&!O.allowedValues.has(this.themeToggle)&&(this.themeToggle=O.defaultValue)}firstUpdated(e){super.firstUpdated(e),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.menuContainer.value&&(this.syncPrimaryMenu(),this.observeMenuContainer(),this.syncExternalDrawerTarget(),this.syncMobileMenuQuery(),this.syncScrollListeners(),this.syncMenuLayout())}updated(e){super.updated(e),this.syncCompactLogoReadiness(),this.syncDrawerBrand(),this.syncEndProbeObserver(),(e.has("scheme")||e.has("layout")||e.has("brandLogo")||e.has("brandText")||e.has("lightBrandLogo")||e.has("darkBrandLogo"))&&this.geometry.invalidate(),(!e.size||[...e.keys()].some(t=>t!=="scrollProgress"&&t!=="hiddenByScroll"))&&this.geometry.measure(),this.observeMenuChildren(),(e.has("showBurger")||e.has("drawerTarget")||e.has("menuDisplay")||e.has("layout")||e.has("previewCollapseRequested"))&&(this.syncExternalDrawerTarget(),this.syncMenuLayout()),(e.has("mobileMenu")||e.has("menuTooLarge"))&&this.syncExternalDrawerControl(),e.has("scrollBehavior")?this.syncScrollListeners():(e.has("scrollThreshold")||e.has("dockOffset"))&&this.updateScrollState()}connectedCallback(){super.connectedCallback(),this.geometry.connect(),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.addEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.addEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.addEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.addEventListener("keydown",this.onGeometryKeyboard),this.addEventListener("pointerdown",this.onGeometryPointer),this.addEventListener("pointerup",this.onGeometryPointerEnd),this.addEventListener("pointercancel",this.onGeometryPointerEnd),this.addEventListener("focusin",this.onGeometryFocus),this.addEventListener("focusout",this.onGeometryFocusOut),this.addEventListener("slotchange",this.onGeometryContentChanged),this.syncScrollListeners(),this.syncMobileMenuQuery(),this.addMenuDrawerListeners(),this.syncExternalDrawerTarget(),this.observeMenuContainer(),this.hasUpdated&&this.syncPrimaryMenu(),this.observeMenuChildren()}disconnectedCallback(){this.geometry.disconnect(),this.shadowRoot?.removeEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.removeEventListener("error",this.syncCompactLogoReadiness,!0),this.readyCompactLogo="",this.removeEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.removeEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.removeEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.openHeaderPopovers.clear(),this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.removeEventListener("keydown",this.onGeometryKeyboard),this.removeEventListener("pointerdown",this.onGeometryPointer),this.removeEventListener("pointerup",this.onGeometryPointerEnd),this.removeEventListener("pointercancel",this.onGeometryPointerEnd),this.removeEventListener("focusin",this.onGeometryFocus),this.removeEventListener("focusout",this.onGeometryFocusOut),this.removeEventListener("slotchange",this.onGeometryContentChanged),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null),this.removeMenuDrawerListeners(),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=null,this.mobileMenuQuery?.removeEventListener("change",this.handleMobileMenuQueryChange),this.mobileMenuQuery=null,this.removeScrollListeners(),this.cancelScrollUpdate(),this.disconnectResizeObserver(),this.endProbeObserver?.disconnect(),this.observedEndProbe=null,this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.demoteMenuToggle(),super.disconnectedCallback()}renderHeaderEnd(e,t,r){return b`<nav
|
|
8
|
-
class=${
|
|
7
|
+
`;function L(f,e){const t=new Set(f);return{allowedValues:t,converter:{fromAttribute(n){return n??e},toAttribute(n){return t.has(n)?n:e}},defaultValue:e}}const se=["standard","centered-brand","centered-menu","extended","extended-centered","minimal"],de=["start","center","end"],le=["truncate","wrap","nowrap"],he=["auto","inline","drawer"],ce=["hidden","visible"],ue=["compact","standard"],j=new Set(Array.from({length:41},(f,e)=>(e+10)/10)),M=L(se,"standard"),D=L(de,"start"),B=L(le,"truncate"),z=L(he,"auto"),P=L(ce,"hidden"),k=L(ue,"compact");let o=class extends V{constructor(){super(...arguments),this.menuOpen=!1,this.navigationConstrained=!1,this.menuTooLarge=!1,this.mobileMenu=!1,this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0,this.showBurger=!1,this.layout=M.defaultValue,this.brandText="",this.brandLogo="",this.lightBrandLogo="",this.darkBrandLogo="",this.compactBrandLogo="",this.lightCompactBrandLogo="",this.darkCompactBrandLogo="",this.heightMultiplier=1,this.minHeightMultiplier=1,this.compactSize=k.defaultValue,this.brandHref="",this.brandAlt="",this.brandColor="",this.lightBrandColor="",this.darkBrandColor="",this.brandAlign=D.defaultValue,this.brandWrap=B.defaultValue,this.menuDisplay=z.defaultValue,this.themeToggle=P.defaultValue,this.scrollBehavior="none",this.scrollThreshold=16,this.dockOffset=0,this.drawerTarget="",this.previewCollapseRequested=!1,this.fullBleedContent=!1,this.geometry=new ie(this,()=>({heightMultiplier:this.heightMultiplier,minHeightMultiplier:this.minHeightMultiplier,compactSize:this.compactSize,compactLogo:!!(this.compactBrandLogo||this.lightCompactBrandLogo||this.darkCompactBrandLogo)}),()=>this.syncBrandFitWidth(),()=>this.runScrollStateUpdate(!0)),this.readyCompactLogo="",this.naturalBrandWidth=0,this.syncCompactLogoReadiness=()=>{const e=this.shadowRoot?.querySelector(".compact-brand-fit .brand-logo"),t=this.compactLogoSource,r=t&&e?.getAttribute("src")===t&&e.complete&&e.naturalWidth>0?t:"";r!==this.readyCompactLogo&&(this.readyCompactLogo=r)},this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.pointerActivation=null,this.onGeometryKeyboard=()=>{this.pointerFocusPending=!1,this.keyboardFocusHeld=!0,this.updateScrollState()},this.onGeometryPointer=e=>{if(!e.isPrimary||e.button!==0||this.pointerActivation)return;this.pointerFocusPending=!0;const t=e.composedPath();this.geometryPointerBlocked(t)||(this.pointerActivation={pointerId:e.pointerId,path:t}),this.keyboardFocusHeld=!1,this.updateScrollState()},this.releaseGeometryPointer=()=>{this.pointerActivation&&(this.pointerActivation=null,this.updateScrollState())},this.onGeometryPointerEnd=e=>{if(!e.isPrimary||this.pointerActivation&&e.pointerId!==this.pointerActivation.pointerId)return;this.pointerFocusPending=!1;const t=e.composedPath();(e.type==="pointercancel"||!t.includes(this)||this.geometryPointerBlocked(t)||this.pointerActivation&&this.geometryPointerBlocked(this.pointerActivation.path))&&this.releaseGeometryPointer()},this.onGeometryClick=e=>{e instanceof PointerEvent&&e.pointerId!==this.pointerActivation?.pointerId||this.releaseGeometryPointer()},this.onGeometryDrag=()=>{this.pointerFocusPending=!1,this.releaseGeometryPointer()},this.onGeometryBlur=()=>{this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.releaseGeometryPointer(),this.updateScrollState()},this.openHeaderPopovers=new Set,this.onHeaderPopoverOpened=e=>{e.target&&this.openHeaderPopovers.add(e.target),this.updateScrollState()},this.onHeaderPopoverClosed=e=>{e.target&&this.openHeaderPopovers.delete(e.target),this.updateScrollState()},this.onHeaderGroupToggle=e=>{e.detail.open?this.onHeaderPopoverOpened(e):this.onHeaderPopoverClosed(e)},this.onGeometryFocus=e=>{const t=e.composedPath();this.keyboardFocusHeld=!this.pointerFocusPending&&t.some(r=>r instanceof Element&&r.matches(":focus-visible")),this.updateScrollState()},this.onGeometryFocusOut=()=>{queueMicrotask(()=>{this.isConnected&&(this.matches(":focus-within")||(this.keyboardFocusHeld=!1,this.pointerFocusPending=!1),this.updateScrollState())})},this.menuContainer=A(),this.menuButton=A(),this.menu=void 0,this.externalDrawerTarget=null,this.lastScrollY=0,this.lastInlineMenuWidth=0,this.mobileMenuQuery=null,this.menuDrawerListenersAttached=!1,this.observingMenuContainer=!1,this.scrollListenersAttached=!1,this.scrollFrame=new q(()=>this.runScrollStateUpdate()),this.resizeObserver=new ResizeObserver(()=>this.syncMenuLayout()),this.menuChildObserver=null,this.endProbe=A(),this.observedEndProbe=null,this.endProbeObserver=null,this.invalidMenuSlot=null,this.actionsWidth=0,this.syncPrimaryMenu=()=>{const r=(this.menuContainer.value?.querySelector('slot[name="menu"]')?.assignedElements()??[])[0],n=r instanceof T&&r.parentElement===this?r:void 0,s=r&&!n?r:null;s&&s!==this.invalidMenuSlot&&console.warn("<esp-header>: the menu slot expects an <esp-menu> element, received",s),this.invalidMenuSlot=s,this.geometry.setPrimaryMenu(n),n!==this.menu&&(this.demoteMenuToggle(),this.removeMenuDrawerListeners(),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null,this.menu.sliding=!1),this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.menu=n,this.lastInlineMenuWidth=0,this.lastDrawerBrandKey="",this.addMenuDrawerListeners(),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.observeMenuChildren(),this.syncDrawerBrand(),this.requestUpdate()),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.menu?.addEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=this.menu.mode==="horizontal"?this:null),this.syncExternalDrawerTarget(),this.syncMenuLayout()},this.onPrimaryPresentationChanged=()=>{this.menu?.headerDrawerActive&&this.returnEndFocusToBurger(),this.requestUpdate()},this.onPrimaryLayoutChanged=()=>{if(!this.menu)return;this.geometry.invalidate();const e=this.menu.mode==="horizontal"&&this.menu.parentElement===this?this:null;this.menu.headerEndOwner!==e&&(this.menu.headerEndOwner=e),this.menu.headerDrawerActive&&this.returnEndFocusToBurger(),this.observeMenuChildren(),this.requestUpdate(),this.syncMenuLayout()},this.updateScrollState=()=>this.scrollFrame.schedule(),this.handleMobileMenuQueryChange=e=>{this.mobileMenu=e.matches,this.syncMenuLayout(),this.syncExternalDrawerControl()},this.toggleTheme=()=>{const e=this.getThemeRoot();if(!e)return;e.scheme=e.scheme==="dark"?"light":"dark";const t=e.scheme==="dark"?"dark":"light";this.dispatchEvent(new CustomEvent(x.HEADER_THEME_TOGGLE,{detail:{scheme:t},bubbles:!0,composed:!0}))},this.handleMenuToggleClicked=()=>{if(this.menuOpen){this.closeNav();return}this.openNav()},this.onMenuDrawerOpened=()=>{this.menuOpen=!0,document.body.classList.add("menu-open"),this.burger&&(this.burger.menuOpen=!0)},this.onMenuDrawerClosed=()=>{this.menuOpen=!1,document.body.classList.remove("menu-open"),this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle(),this.updateScrollState()},this.onMenuDrawerPresented=e=>{e.target!==this.menu||!this.menu?.isFullScreenDrawer||this.promoteMenuToggle()},this.menuTogglePromoted=!1,this.promotedToggleFrame=new q(()=>this.positionPromotedToggle()),this.handlePromotedViewportResize=()=>this.promotedToggleFrame.schedule(),this.lastDrawerBrandKey="",this.inertedHeaderChrome=[],this.onGeometryContentChanged=()=>this.geometry.invalidate()}resolveBrand(){return ne({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor})}get compactLogoSource(){if(!this.resolveBrand().brandLogo)return"";const e=this.scheme==="dark"?this.darkCompactBrandLogo:this.lightCompactBrandLogo,t=this.scheme==="dark"?this.lightCompactBrandLogo:this.darkCompactBrandLogo;return e||this.compactBrandLogo||t}syncBrandFitWidth(){const e=this.menuContainer.value?.parentElement;if(!e)return;const t=e.querySelector(".brand-fit-probe");this.naturalBrandWidth=t?.getBoundingClientRect().width??0;const r=e.querySelector('slot[name="brand"]')?.assignedElements().length,n=[...t?.querySelectorAll(".brand-logo")??[]].map(d=>d.getBoundingClientRect().width),s=getComputedStyle(e),i=[s.paddingTop,s.paddingBottom,s.borderTopWidth,s.borderBottomWidth].reduce((d,h)=>d+(parseFloat(h)||0),0);for(const[d,h]of[["--_esp-header-stable-brand-width",this.geometry.active&&!r?this.naturalBrandWidth:null],["--_esp-header-logo-reservation-width",Math.max(0,...n)],["--_esp-header-bar-block-insets",i]])if(h===null)e.style.removeProperty(d);else{const c=`${h}px`;e.style.getPropertyValue(d)!==c&&e.style.setProperty(d,c)}}geometryPointerBlocked(e){return e.some(t=>t instanceof Element&&(!t.isConnected||t.matches(":disabled, [aria-disabled=true], [inert]")))}get headerOverlayHeld(){for(const e of this.openHeaderPopovers)e instanceof Element&&!e.isConnected&&this.openHeaderPopovers.delete(e);return this.menuOpen||this.openHeaderPopovers.size>0}get usesIntrinsicNavigation(){return!!this.menu?.headerNavigationOwned}syncEndProbeObserver(){const e=this.endProbe.value??null;e!==this.observedEndProbe&&(this.endProbeObserver?.disconnect(),this.observedEndProbe=e,e&&(this.endProbeObserver??=new ResizeObserver(()=>this.syncMenuLayout()),this.endProbeObserver.observe(e,{box:"border-box"})),this.syncMenuLayout())}returnEndFocusToBurger(){const e=this.shadowRoot?.querySelector(".header-end"),t=this.shadowRoot?.activeElement;t&&e?.contains(t)&&this.updateComplete.then(()=>this.getBurgerFocusTarget()?.focus({preventScroll:!0}))}readHeaderEndFit(){const e=this.menuContainer.value?.parentElement;if(!e||!this.menu)return null;const t=getComputedStyle(e),r=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0),n=parseFloat(t.columnGap)||0,s=e.querySelector(":scope > .brand"),d=s?.querySelector("slot")?.assignedElements().length?Math.max(s?.scrollWidth??0,s?.getBoundingClientRect().width??0):this.naturalBrandWidth,h=e.querySelector(":scope > .buttons"),c=Array.from(h?.children??[]).flatMap(g=>g.matches(".header-end, .header-end-measurement, .menu-toggle")?[]:g instanceof HTMLSlotElement?g.assignedElements():[g]).filter(g=>getComputedStyle(g).display!=="none");let u=c.reduce((g,N)=>{const $=getComputedStyle(N);return g+N.getBoundingClientRect().width+(parseFloat($.marginLeft)||0)+(parseFloat($.marginRight)||0)},0);const E=this.endProbe.value?.getBoundingClientRect().width??0,m=h&&parseFloat(getComputedStyle(h).columnGap)||0;u+=m*Math.max(0,c.length-1+(E>0?1:0));const y=this.menu.getHeaderNavigationWidths().main,w=E+u,_=this.layout==="extended"?y>r||d+w+n>r:this.layout==="extended-centered"?y>r||d+2*w+2*n>r:this.layout==="centered-brand"?d+2*Math.max(y,w)+2*n>r:d+y+w+2*n>r,C=this.getExternalDrawerTarget()?h?.querySelector(".menu-toggle"):null,O=u+(C&&getComputedStyle(C).display!=="none"?C.getBoundingClientRect().width+(c.length||E?m:0):0);return{width:r,brandWidth:d,main:y,endWidth:E,actions:u,actionFloor:O,gap:n,tooWide:_}}syncMenuLayout(){if(this.syncBrandFitWidth(),!this.menuContainer.value||!this.menu||!this.menu.getWidth)return;this.positionPromotedToggle();const e=this.menu.getWidth();e>0&&(this.lastInlineMenuWidth=e);const t=this.lastInlineMenuWidth||e,r=this.getExternalDrawerTarget(),n=this.menuDisplay!=="inline",s=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested,i=n&&this.menuDisplay==="auto",d=i?this.layout==="centered-menu"?this.centeredMenuCapacity():this.menuContainer.value.clientWidth:0,h=this.usesIntrinsicNavigation?this.readHeaderEndFit():null;h&&this.actionsWidth!==h.actionFloor&&(this.actionsWidth=h.actionFloor,this.requestUpdate()),this.menuTooLarge=i&&(h?h.tooWide:t>d);const c=n&&!r&&this.hasDrawerableContent()&&(this.menuTooLarge||s||this.mobileMenu);c&&this.returnEndFocusToBurger(),this.menu.sliding=c,this.navigationConstrained=h?.tooWide??!1}centeredMenuCapacity(){const e=this.menuContainer.value?.parentElement;if(!(e instanceof HTMLElement))return 0;const t=d=>d?d.getBoundingClientRect().width:0,r=getComputedStyle(e),n=e.clientWidth-(Number.parseFloat(r.paddingLeft)||0)-(Number.parseFloat(r.paddingRight)||0),s=e.querySelector(":scope > section.brand"),i=e.querySelector(":scope > section.buttons");return n-t(s)-t(i)+t(i?.querySelector("esp-header-button.menu-toggle"))}menuHasContent(){return!!(this.menu??this.querySelector(':scope > [slot="menu"]'))?.querySelector("esp-menu-item, esp-menu-group")}hasDrawerableContent(){return this.showBurger||!!this.getExternalDrawerTarget()||this.menuHasContent()}getExternalDrawerTarget(){if(!this.drawerTarget)return null;const e=document.getElementById(this.drawerTarget);return e===this.menu?null:e&&"openDrawer"in e&&typeof e.openDrawer=="function"&&"closeDrawer"in e&&typeof e.closeDrawer=="function"?e:null}getBurgerFocusTarget(){const t=this.shadowRoot?.querySelector("esp-header-button.menu-toggle")?.shadowRoot?.querySelector("button"),r=this.menuButton.value?.shadowRoot?.querySelector("button");return t??r??null}getScrollTokens(){const e=this.scrollBehavior.split(/\s+/).map(t=>t.trim().toLowerCase()).filter(Boolean);return new Set(e.filter(t=>t!=="none"))}getEffectiveScrollThreshold(){return Number.isFinite(this.scrollThreshold)?Math.max(0,this.scrollThreshold):0}clearScrollState(){this.geometry.requestScroll(0,!1,!1,this.getEffectiveScrollThreshold(),!1),this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0}runScrollStateUpdate(e=!1){const t=this.getScrollTokens();if(!t.size){e||this.clearScrollState();return}const r=Math.max(0,window.scrollY||document.documentElement.scrollTop||0),n=this.getEffectiveScrollThreshold(),s=Number.isFinite(this.dockOffset)?Math.max(0,this.dockOffset):n,i=r>(t.has("dock")?s:n),d=r>this.lastScrollY,h=t.has("reveal")&&d&&r>n&&!this.menuOpen;if(this.geometry.requestScroll(r,t.has("compact"),t.has("collapse-topbar")&&i,n,this.headerOverlayHeld||this.keyboardFocusHeld||this.pointerActivation!==null),!e){if(this.scrolled=i,this.hiddenByScroll=h,t.has("progress")){const c=document.documentElement,u=Math.max(1,c.scrollHeight-window.innerHeight);this.scrollProgress=Math.min(1,r/u)}else this.scrollProgress=0;this.lastScrollY=r}}cancelScrollUpdate(){this.scrollFrame.cancel()}syncScrollListeners(){const e=this.getScrollTokens().size>0;if(e&&!this.scrollListenersAttached?(window.addEventListener("scroll",this.updateScrollState,{passive:!0}),window.addEventListener("resize",this.updateScrollState,{passive:!0}),this.scrollListenersAttached=!0):!e&&this.scrollListenersAttached&&this.removeScrollListeners(),e){this.updateScrollState();return}this.cancelScrollUpdate(),this.clearScrollState()}removeScrollListeners(){this.scrollListenersAttached&&(window.removeEventListener("scroll",this.updateScrollState),window.removeEventListener("resize",this.updateScrollState),this.scrollListenersAttached=!1)}addMenuDrawerListeners(){!this.menu||this.menuDrawerListenersAttached||(this.menu.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.addEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!0)}removeMenuDrawerListeners(){!this.menu||!this.menuDrawerListenersAttached||(this.menu.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.removeEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!1)}observeMenuContainer(){if(!this.menuContainer.value||this.observingMenuContainer)return;this.resizeObserver.observe(this.menuContainer.value);const e=this.menuContainer.value.parentElement;if(e){this.resizeObserver.observe(e);for(const t of e.querySelectorAll(":scope > section.brand, :scope > section.buttons, :scope > .brand-fit-probe"))this.resizeObserver.observe(t)}this.observingMenuContainer=!0}disconnectResizeObserver(){this.observingMenuContainer&&(this.resizeObserver.disconnect(),this.observingMenuContainer=!1)}observeMenuChildren(){if(this.usesIntrinsicNavigation){this.menuChildObserver?.disconnect(),this.menuChildObserver=null;return}!this.menu||this.menuChildObserver||(this.menuChildObserver=new MutationObserver(()=>{this.syncMenuLayout(),this.requestUpdate()}),this.menuChildObserver.observe(this.menu,{childList:!0,subtree:!0}))}syncMobileMenuQuery(){if("matchMedia"in window){if(!this.mobileMenuQuery){this.mobileMenuQuery=window.matchMedia(ae),this.mobileMenu=this.mobileMenuQuery.matches,this.mobileMenuQuery.addEventListener("change",this.handleMobileMenuQueryChange);return}this.mobileMenu=this.mobileMenuQuery.matches}}getThemeRoot(){return this.traverseToClosest("esp-root")}syncExternalDrawerTarget(){const e=this.getExternalDrawerTarget(),t=e===this.menu?null:e;t!==this.externalDrawerTarget&&(this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=t,this.externalDrawerTarget?.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed)),this.syncExternalDrawerControl()}burgerVisibleForTarget(){if(this.menuDisplay==="inline")return!1;const e=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested;return this.menuTooLarge||this.mobileMenu||e}syncExternalDrawerControl(){this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=this.burgerVisibleForTarget())}openNav(){const e=this.getBurgerFocusTarget(),t=this.getExternalDrawerTarget();if(this.burger&&(this.burger.menuOpen=!0),t){this.menuOpen=!0,t.openDrawer(e),document.body.classList.add("menu-open");return}if(this.menu){this.menu.sliding=!0,this.menuOpen=!0,this.menu.isFullScreenDrawer&&this.canPromoteMenuToggle()&&(this.menu.liftedCloseControl=this.getMenuToggleElement()),this.menu.openDrawer(e),document.body.classList.add("menu-open");return}this.burger&&(this.burger.menuOpen=!1)}closeNav(){this.menuOpen=!1,this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle();const e=this.getExternalDrawerTarget();if(e){e.closeDrawer(),document.body.classList.remove("menu-open");return}this.menu&&(this.menu.closeDrawer(),document.body.classList.remove("menu-open"))}getMenuToggleElement(){return this.shadowRoot?.querySelector("esp-header-button.menu-toggle")??null}canPromoteMenuToggle(){const e=this.getMenuToggleElement();return!!e&&typeof e?.showPopover=="function"}setHeaderChromeInert(e){if(!e){for(const i of this.inertedHeaderChrome)i.inert=!1;this.inertedHeaderChrome=[];return}const t=this.menuContainer.value?.parentElement,r=this.getMenuToggleElement();if(!t||!r)return;const n=[];for(const i of t.querySelectorAll(":scope > section.brand, :scope > section.topbar"))n.push(i);const s=t.querySelector(":scope > section.buttons");for(const i of s?.children??[])if(!(!(i instanceof HTMLElement)||i===r)){if(i instanceof HTMLSlotElement){for(const d of i.assignedElements())d instanceof HTMLElement&&n.push(d);continue}n.push(i)}for(const i of n)i.inert||(i.inert=!0,this.inertedHeaderChrome.push(i))}promoteMenuToggle(){const e=this.getMenuToggleElement();if(!e||this.menuTogglePromoted||typeof e.showPopover!="function")return;const t=e.getBoundingClientRect();e.setAttribute("popover","manual"),Object.assign(e.style,{position:"fixed",inset:"auto",margin:"0",padding:"0",border:"0",background:"transparent",overflow:"visible"}),this.setPromotedTogglePosition(e,t.width);try{e.showPopover()}catch{e.removeAttribute("popover"),e.removeAttribute("style"),this.menu&&(this.menu.liftedCloseControl=null);return}this.menuTogglePromoted=!0,window.addEventListener("resize",this.handlePromotedViewportResize),this.menu&&(this.menu.liftedCloseControl=e),this.setHeaderChromeInert(!0)}positionPromotedToggle(){if(!this.menuTogglePromoted)return;const e=this.getMenuToggleElement();if(!e)return;const t=e.getBoundingClientRect();this.setPromotedTogglePosition(e,t.width)}setPromotedTogglePosition(e,t){const r=te(),n=getComputedStyle(e).direction==="rtl";e.style.left=`${n?0:Math.max(0,r.width-t)}px`,e.style.top="0px"}demoteMenuToggle(){if(window.removeEventListener("resize",this.handlePromotedViewportResize),this.promotedToggleFrame.cancel(),this.menu?.liftedCloseControl&&(this.menu.liftedCloseControl=null),!this.menuTogglePromoted)return;this.menuTogglePromoted=!1,this.setHeaderChromeInert(!1);const e=this.getMenuToggleElement();if(e){try{e.hidePopover()}catch{}e.removeAttribute("popover"),e.removeAttribute("style")}}syncDrawerBrand(){if(!this.menu)return;const e=this.resolveBrand(),t=e.brandLogo||this.brandText?{brandLogo:e.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt,brandColor:e.brandColor}:null,r=JSON.stringify(t);r!==this.lastDrawerBrandKey&&(this.lastDrawerBrandKey=r,this.menu.drawerBrand=t)}get burger(){return this.menuButton.value??void 0}willUpdate(e){super.willUpdate(e),j.has(this.heightMultiplier)||(this.heightMultiplier=1),j.has(this.minHeightMultiplier)||(this.minHeightMultiplier=1),k.allowedValues.has(this.compactSize)||(this.compactSize=k.defaultValue),["heightMultiplier","minHeightMultiplier","compactSize","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&this.geometry.configure(),["scheme","brandLogo","lightBrandLogo","darkBrandLogo","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&(this.readyCompactLogo=""),e.has("layout")&&!M.allowedValues.has(this.layout)&&(this.layout=M.defaultValue),e.has("brandAlign")&&!D.allowedValues.has(this.brandAlign)&&(this.brandAlign=D.defaultValue),e.has("brandWrap")&&!B.allowedValues.has(this.brandWrap)&&(this.brandWrap=B.defaultValue),e.has("menuDisplay")&&!z.allowedValues.has(this.menuDisplay)&&(this.menuDisplay=z.defaultValue),e.has("themeToggle")&&!P.allowedValues.has(this.themeToggle)&&(this.themeToggle=P.defaultValue)}firstUpdated(e){super.firstUpdated(e),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.menuContainer.value&&(this.syncPrimaryMenu(),this.observeMenuContainer(),this.syncExternalDrawerTarget(),this.syncMobileMenuQuery(),this.syncScrollListeners(),this.syncMenuLayout())}updated(e){super.updated(e),this.syncCompactLogoReadiness(),this.syncDrawerBrand(),this.syncEndProbeObserver(),(e.has("scheme")||e.has("layout")||e.has("brandLogo")||e.has("brandText")||e.has("lightBrandLogo")||e.has("darkBrandLogo"))&&this.geometry.invalidate(),(!e.size||[...e.keys()].some(t=>t!=="scrollProgress"&&t!=="hiddenByScroll"))&&this.geometry.measure(),this.observeMenuChildren(),(e.has("showBurger")||e.has("drawerTarget")||e.has("menuDisplay")||e.has("layout")||e.has("previewCollapseRequested"))&&(this.syncExternalDrawerTarget(),this.syncMenuLayout()),(e.has("mobileMenu")||e.has("menuTooLarge"))&&this.syncExternalDrawerControl(),e.has("scrollBehavior")?this.syncScrollListeners():(e.has("scrollThreshold")||e.has("dockOffset"))&&this.updateScrollState()}connectedCallback(){super.connectedCallback(),this.geometry.connect(),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.addEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.addEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.addEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.addEventListener("keydown",this.onGeometryKeyboard),this.addEventListener("pointerdown",this.onGeometryPointer,!0),this.addEventListener("dragstart",this.onGeometryDrag,!0),window.addEventListener("pointerup",this.onGeometryPointerEnd,!0),window.addEventListener("pointercancel",this.onGeometryPointerEnd,!0),window.addEventListener("click",this.onGeometryClick,!0),window.addEventListener("blur",this.onGeometryBlur),this.addEventListener("focusin",this.onGeometryFocus),this.addEventListener("focusout",this.onGeometryFocusOut),this.addEventListener("slotchange",this.onGeometryContentChanged),this.syncScrollListeners(),this.syncMobileMenuQuery(),this.addMenuDrawerListeners(),this.syncExternalDrawerTarget(),this.observeMenuContainer(),this.hasUpdated&&this.syncPrimaryMenu(),this.observeMenuChildren()}disconnectedCallback(){this.geometry.disconnect(),this.shadowRoot?.removeEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.removeEventListener("error",this.syncCompactLogoReadiness,!0),this.readyCompactLogo="",this.removeEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.removeEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.removeEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.openHeaderPopovers.clear(),this.pointerActivation=null,this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.removeEventListener("keydown",this.onGeometryKeyboard),this.removeEventListener("pointerdown",this.onGeometryPointer,!0),this.removeEventListener("dragstart",this.onGeometryDrag,!0),window.removeEventListener("pointerup",this.onGeometryPointerEnd,!0),window.removeEventListener("pointercancel",this.onGeometryPointerEnd,!0),window.removeEventListener("click",this.onGeometryClick,!0),window.removeEventListener("blur",this.onGeometryBlur),this.removeEventListener("focusin",this.onGeometryFocus),this.removeEventListener("focusout",this.onGeometryFocusOut),this.removeEventListener("slotchange",this.onGeometryContentChanged),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null),this.removeMenuDrawerListeners(),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=null,this.mobileMenuQuery?.removeEventListener("change",this.handleMobileMenuQueryChange),this.mobileMenuQuery=null,this.removeScrollListeners(),this.cancelScrollUpdate(),this.disconnectResizeObserver(),this.endProbeObserver?.disconnect(),this.observedEndProbe=null,this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.demoteMenuToggle(),super.disconnectedCallback()}renderHeaderEnd(e,t,r){return b`<nav
|
|
8
|
+
class=${W({"header-end":!t,"header-end-probe":t})}
|
|
9
9
|
${t?H(this.endProbe):p}
|
|
10
10
|
aria-label=${t?p:`${this.menu?.ariaLabel??"Navigation"} links`}
|
|
11
11
|
aria-hidden=${t?"true":p}
|
|
@@ -14,8 +14,8 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
14
14
|
style=${X(this.menu)}
|
|
15
15
|
>
|
|
16
16
|
${e.map(n=>ee(n,{mode:"horizontal",sourceStyle:!0}))}
|
|
17
|
-
</nav>`}render(){const{menuOpen:e,menuTooLarge:t,mobileMenu:r}=this,n=this.menuDisplay!=="inline",
|
|
18
|
-
<header class=${
|
|
17
|
+
</nav>`}render(){const{menuOpen:e,menuTooLarge:t,mobileMenu:r}=this,n=this.menuDisplay!=="inline",s=n&&(this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested),i=this.getScrollTokens(),d=i.has("progress"),h=this.resolveBrand(),c={"--_esp-header-brand-color":h.brandColor||null,"--_esp-header-scroll-progress":String(this.scrollProgress),"--_esp-header-actions-width":`${this.actionsWidth}px`,"--_esp-header-height-multiplier":String(this.geometry.multiplier),"--_esp-header-min-height-multiplier":String(this.geometry.minimumMultiplier),"--_esp-header-scroll-row-size":this.geometry.scrollDriven?`${this.geometry.primarySize}px`:null,"--_esp-header-collapse-progress":String(this.geometry.progress),"--_esp-header-own-menu-offset":this.geometry.active?`${this.geometry.record.visibleBlockSize}px`:null},u=this.compactLogoSource,E=this.geometry.compact&&u&&this.readyCompactLogo===u,m=this.menu?.headerEndNodes??[],y=!m.length||!!this.menu?.headerDrawerActive,w=!!this.menu?.headerDrawerActive,_=this.menuDisplay==="inline"||this.usesIntrinsicNavigation&&!w&&!!this.getExternalDrawerTarget(),C={"primary-drawer":w,"has-header-end":m.length>0,"explicit-inline":_,"navigation-constrained":this.navigationConstrained,"menu-open":e,"too-wide":n&&this.hasDrawerableContent()&&(t||r||s),[`layout-${this.layout==="minimal"&&_?"standard":this.layout}`]:!0,"is-scrolled":this.scrolled,"geometry-topbar-collapsed":this.geometry.topbarCollapsed,"geometry-active":this.geometry.active,"scaled-header":this.heightMultiplier>1,"geometry-compact":this.geometry.compact,"geometry-scroll-driven":this.geometry.scrollDriven,"geometry-complete":this.geometry.complete,"geometry-tall-chrome":this.geometry.tallChrome,"geometry-standard":this.geometry.standard,"geometry-initial":this.geometry.pending,"hide-on-scroll":this.hiddenByScroll,"scroll-compact":i.has("compact"),"scroll-elevate":i.has("elevate"),"scroll-transparent":i.has("transparent")||i.has("transparent-to-solid"),"scroll-collapse-topbar":i.has("collapse-topbar")};this.toggleAttribute("data-esp-compact",this.geometry.compact);const O=this.scheme==="dark"?"light":"dark";return b`
|
|
18
|
+
<header class=${W(C)} style=${Z(c)}>
|
|
19
19
|
<section class="topbar">
|
|
20
20
|
<slot name="topbar" @slotchange=${this.onGeometryContentChanged}></slot>
|
|
21
21
|
</section>
|
|
@@ -39,7 +39,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
39
39
|
${this.themeToggle==="visible"?b`<esp-header-button
|
|
40
40
|
class="theme-toggle"
|
|
41
41
|
icon=${this.scheme==="dark"?"sun":"moon"}
|
|
42
|
-
aria-label=${`Switch to ${
|
|
42
|
+
aria-label=${`Switch to ${O} mode`}
|
|
43
43
|
@esp-clicked=${this.toggleTheme}
|
|
44
44
|
></esp-header-button>`:p}
|
|
45
45
|
|
|
@@ -68,7 +68,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
68
68
|
</div>
|
|
69
69
|
${d?b`<div class="scroll-progress" aria-hidden="true"></div>`:p}
|
|
70
70
|
</header>
|
|
71
|
-
`}};o.styles=[...V.styles,J,Q(2,"header"),re,
|
|
71
|
+
`}};o.styles=[...V.styles,J,Q(2,"header"),re,I`
|
|
72
72
|
:host {
|
|
73
73
|
--_esp-header-base-height: var(--esp-header-height, calc(4.5 * var(--esp-size-small)));
|
|
74
74
|
--_esp-header-current-height: var(--_esp-header-base-height);
|
|
@@ -109,7 +109,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
109
109
|
box-shadow: var(--esp-header-shadow, 0 0 2px var(--esp-color-shadow));
|
|
110
110
|
color: var(--esp-header-color, var(--esp-color-text));
|
|
111
111
|
transform: translateY(0);
|
|
112
|
-
transition: min-height 0.24s ease, ${
|
|
112
|
+
transition: min-height 0.24s ease, ${G};
|
|
113
113
|
|
|
114
114
|
> section {
|
|
115
115
|
min-height: var(--_esp-header-bar-height, var(--_esp-header-current-height));
|
|
@@ -221,7 +221,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
221
221
|
.brand-logo {
|
|
222
222
|
|
|
223
223
|
aspect-ratio: auto
|
|
224
|
-
var(--esp-header-brand-logo-aspect-ratio, ${
|
|
224
|
+
var(--esp-header-brand-logo-aspect-ratio, ${U});
|
|
225
225
|
width: auto;
|
|
226
226
|
height: var(
|
|
227
227
|
--esp-header-brand-logo-size,
|
|
@@ -567,7 +567,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
567
567
|
--_esp-header-compact-logo-size: min(var(--_esp-header-expanded-logo-size), max(0px, calc(var(--_esp-header-compact-bar-height) - var(--_esp-header-bar-block-insets, 0px))));
|
|
568
568
|
--_esp-header-resolved-logo-size: var(--_esp-header-expanded-logo-size);
|
|
569
569
|
grid-template-rows: min-content minmax(var(--_esp-header-bar-height), max-content);
|
|
570
|
-
transition: grid-template-rows 0.24s ease, min-height 0.24s ease, ${
|
|
570
|
+
transition: grid-template-rows 0.24s ease, min-height 0.24s ease, ${G};
|
|
571
571
|
|
|
572
572
|
> section:not(.topbar) { min-height: 0; }
|
|
573
573
|
section.menu-container { align-self: center; }
|
|
@@ -596,7 +596,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
596
596
|
--_esp-header-current-height: calc(var(--_esp-header-base-height) + (var(--_esp-header-compact-control-height) - var(--_esp-header-base-height)) * var(--_esp-header-collapse-progress));
|
|
597
597
|
--_esp-header-bar-height: var(--_esp-header-scroll-row-size);
|
|
598
598
|
--_esp-header-resolved-logo-size: calc(var(--_esp-header-expanded-logo-size) + (var(--_esp-header-compact-logo-size) - var(--_esp-header-expanded-logo-size)) * var(--_esp-header-collapse-progress));
|
|
599
|
-
transition: ${
|
|
599
|
+
transition: ${G};
|
|
600
600
|
|
|
601
601
|
.brand-logo { transition: none; }
|
|
602
602
|
}
|
|
@@ -614,7 +614,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
614
614
|
.brand-logo-reservation .brand-logo { max-inline-size: 100%; }
|
|
615
615
|
.compact-brand-fit .brand-logo {
|
|
616
616
|
height: var(--_esp-header-compact-logo-size);
|
|
617
|
-
aspect-ratio: auto var(--esp-header-compact-brand-logo-aspect-ratio, var(--esp-header-brand-logo-aspect-ratio, ${
|
|
617
|
+
aspect-ratio: auto var(--esp-header-compact-brand-logo-aspect-ratio, var(--esp-header-brand-logo-aspect-ratio, ${U}));
|
|
618
618
|
}
|
|
619
619
|
|
|
620
620
|
.header-expanded-size-probe,
|
|
@@ -792,4 +792,4 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
|
|
|
792
792
|
transition: none;
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
|
-
`],
|
|
795
|
+
`],a([v()],o.prototype,"menuOpen",void 0),a([v()],o.prototype,"navigationConstrained",void 0),a([v()],o.prototype,"menuTooLarge",void 0),a([v()],o.prototype,"mobileMenu",void 0),a([v()],o.prototype,"scrolled",void 0),a([v()],o.prototype,"hiddenByScroll",void 0),a([v()],o.prototype,"scrollProgress",void 0),a([l({attribute:"show-burger",type:Boolean})],o.prototype,"showBurger",void 0),a([l({converter:M.converter,reflect:!0})],o.prototype,"layout",void 0),a([l({attribute:"brand-text",type:String})],o.prototype,"brandText",void 0),a([l({attribute:"brand-logo",type:String})],o.prototype,"brandLogo",void 0),a([l({attribute:"light-brand-logo",type:String})],o.prototype,"lightBrandLogo",void 0),a([l({attribute:"dark-brand-logo",type:String})],o.prototype,"darkBrandLogo",void 0),a([l({attribute:"compact-brand-logo",type:String})],o.prototype,"compactBrandLogo",void 0),a([l({attribute:"light-compact-brand-logo",type:String})],o.prototype,"lightCompactBrandLogo",void 0),a([l({attribute:"dark-compact-brand-logo",type:String})],o.prototype,"darkCompactBrandLogo",void 0),a([l({attribute:"height-multiplier",type:Number,reflect:!0})],o.prototype,"heightMultiplier",void 0),a([l({attribute:"min-height-multiplier",type:Number,reflect:!0})],o.prototype,"minHeightMultiplier",void 0),a([l({attribute:"compact-size",converter:k.converter,reflect:!0})],o.prototype,"compactSize",void 0),a([l({attribute:"brand-href",type:String})],o.prototype,"brandHref",void 0),a([l({attribute:"brand-alt",type:String})],o.prototype,"brandAlt",void 0),a([l({attribute:"brand-color",type:String})],o.prototype,"brandColor",void 0),a([l({attribute:"light-brand-color",type:String})],o.prototype,"lightBrandColor",void 0),a([l({attribute:"dark-brand-color",type:String})],o.prototype,"darkBrandColor",void 0),a([l({attribute:"brand-align",converter:D.converter,reflect:!0})],o.prototype,"brandAlign",void 0),a([l({attribute:"brand-wrap",converter:B.converter,reflect:!0})],o.prototype,"brandWrap",void 0),a([l({attribute:"menu-display",converter:z.converter,reflect:!0})],o.prototype,"menuDisplay",void 0),a([l({attribute:"theme-toggle",converter:P.converter,reflect:!0})],o.prototype,"themeToggle",void 0),a([l({attribute:"scroll-behavior",type:String})],o.prototype,"scrollBehavior",void 0),a([l({attribute:"scroll-threshold",type:Number})],o.prototype,"scrollThreshold",void 0),a([l({attribute:"dock-offset",type:Number})],o.prototype,"dockOffset",void 0),a([l({attribute:"drawer-target",type:String})],o.prototype,"drawerTarget",void 0),a([l({attribute:!1})],o.prototype,"previewCollapseRequested",void 0),a([l({attribute:"full-bleed-content",type:Boolean,reflect:!0})],o.prototype,"fullBleedContent",void 0),a([v()],o.prototype,"readyCompactLogo",void 0),o=a([K("esp-header")],o);export{o as EspalierHeader};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/espalier",
|
|
3
|
-
"version": "6.15.
|
|
3
|
+
"version": "6.15.1",
|
|
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",
|