@uvalib/web-components 1.8.0 → 1.8.4
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 +35 -0
- package/README.md +26 -3
- package/dist/base.css +157 -1
- package/dist/components/site-main-nav/SiteMainNav.d.ts +1 -1
- package/dist/components/site-main-nav/SiteMainNav.js +9 -2
- package/dist/components/site-main-nav/SiteMainNav.js.map +1 -1
- package/dist/components/site-page/SitePage.d.ts +1 -1
- package/dist/components/site-page/SitePage.js +3 -2
- package/dist/components/site-page/SitePage.js.map +1 -1
- package/dist/components/site-style/SiteStyle.d.ts +1 -1
- package/dist/components/site-style/SiteStyle.js +3 -2
- package/dist/components/site-style/SiteStyle.js.map +1 -1
- package/dist/custom-elements.json +27 -5
- package/dist/pagefind.css +8 -1
- package/dist/styles/base.js +82 -2
- package/dist/styles/base.js.map +1 -1
- package/dist/styles/font-fallback.d.ts +17 -0
- package/dist/styles/font-fallback.js +64 -0
- package/dist/styles/font-fallback.js.map +1 -0
- package/dist/styles/pagefind.js +8 -1
- package/dist/styles/pagefind.js.map +1 -1
- package/dist/styles/tokens.js +1 -1
- package/dist/tokens.css +47 -1
- package/dist-cdn/base.css +157 -1
- package/dist-cdn/chunks/{base-BI8h0Gf3.js → base-DfLI8lpa.js} +119 -8
- package/dist-cdn/chunks/base-DfLI8lpa.js.map +1 -0
- package/dist-cdn/chunks/{site-header-DYRMpdBj.js → site-header-CEmNtmk5.js} +2 -2
- package/dist-cdn/chunks/{site-header-DYRMpdBj.js.map → site-header-CEmNtmk5.js.map} +1 -1
- package/dist-cdn/chunks/{site-main-nav-DURrQMal.js → site-main-nav-CAwKq_x5.js} +9 -2
- package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +1 -0
- package/dist-cdn/custom-elements.json +27 -5
- package/dist-cdn/manifest.json +1 -1
- package/dist-cdn/pagefind.css +8 -1
- package/dist-cdn/site-header.js +1 -1
- package/dist-cdn/site-main-nav.js +1 -1
- package/dist-cdn/site-page.js +50 -46
- package/dist-cdn/site-page.js.map +1 -1
- package/dist-cdn/site-style.js +6 -6
- package/dist-cdn/site-style.js.map +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +2 -2
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +3 -3
- package/dist-cdn/tokens.css +47 -1
- package/package.json +1 -1
- package/skills/uvalib-web-components/SKILL.md +2 -2
- package/skills/uvalib-web-components/reference/components.md +3 -3
- package/dist-cdn/chunks/base-BI8h0Gf3.js.map +0 -1
- package/dist-cdn/chunks/site-main-nav-DURrQMal.js.map +0 -1
package/dist-cdn/site-style.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as e, l as t, m as n, n as r, o as i, r as a, t as o } from "./chunks/UvalibElement-pGONDAwB.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as s, n as c, r as l } from "./chunks/base-DfLI8lpa.js";
|
|
3
3
|
// src/components/site-style/SiteStyle.ts
|
|
4
|
-
var
|
|
4
|
+
var u = class extends o {
|
|
5
5
|
constructor(...e) {
|
|
6
6
|
super(...e), this.imports = {}, this.importedStyles = "";
|
|
7
7
|
}
|
|
@@ -9,13 +9,13 @@ var l = class extends o {
|
|
|
9
9
|
this.hostColorScheme = !1;
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.styles = [
|
|
12
|
+
this.styles = [l, c];
|
|
13
13
|
}
|
|
14
14
|
installLightStyles() {
|
|
15
|
-
a("uvalib-tokens", [
|
|
15
|
+
a("uvalib-tokens", [l], {
|
|
16
16
|
root: this.ownerDocument,
|
|
17
17
|
scope: !1
|
|
18
|
-
}), a("uvalib-site-style", [s], {
|
|
18
|
+
}), a("uvalib-site-style", [s, c], {
|
|
19
19
|
root: this.ownerDocument,
|
|
20
20
|
scope: !1,
|
|
21
21
|
layer: !1
|
|
@@ -37,6 +37,6 @@ var l = class extends o {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
// src/components/site-style/site-style.ts
|
|
40
|
-
r([e({ type: Object })],
|
|
40
|
+
r([e({ type: Object })], u.prototype, "imports", void 0), r([e({ type: String })], u.prototype, "importedStyles", void 0), n("site-style", u);
|
|
41
41
|
|
|
42
42
|
//# sourceMappingURL=site-style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-style.js","names":["nothing","_decorate","property","n","b","define","__decorate","A","installLightDomStyles","UvalibElement","base","tokens","SiteStyle","_args","imp","key","css"],"sources":["../src/components/site-style/SiteStyle.ts","../src/components/site-style/site-style.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base } from '../../styles/base.js';\n\n/**\n * Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base page\n * styles on the document. Shadow mode only styles inside its own shadow root, so the\n * `:root` and `html, body` rules of those sheets match nothing there and the slotted content\n * is not restyled; it inherits whatever inherited tokens and fonts the page already provides.\n *\n * @tagname site-style\n * @slot - Content rendered in shadow mode; it is not restyled by this element. In light mode there is no shadow root and the children stay in place.\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Font family.\n * @cssprop [--uva-font-size-base=17px] - Base font size.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Text colour.\n * @cssprop --uva-color-text - Dark-mode role token: text colour (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (else none).\n */\nexport class SiteStyle extends UvalibElement {\n /** The wrapped content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n static styles = [tokens, base];\n\n /** Map of tag name to a module URL whose default export is a stylesheet; ported as is. */\n @property({ type: Object }) imports: { [key: string]: string } = {};\n\n /**\n * Accumulated text of the stylesheets loaded through `imports`. Carried over from the old\n * component for compatibility; it is not rendered anywhere.\n */\n @property({ type: String }) importedStyles = '';\n\n /**\n * Page-level styles: unscoped; the base rules are unlayered (so they beat host resets), the tokens layered, under their own dedupe key, always on the owner\n * document (not the root node) because `:root` tokens inherit into shadow roots.\n */\n protected override installLightStyles(): void {\n // Tokens layered (host `:root` overrides win), base unlayered (beats host resets).\n installLightDomStyles('uvalib-tokens', [tokens], { root: this.ownerDocument, scope: false });\n installLightDomStyles('uvalib-site-style', [base], {\n root: this.ownerDocument,\n scope: false,\n layer: false,\n });\n }\n\n protected override firstUpdated(): void {\n if (this.imports && !this.noStyle) {\n Object.keys(this.imports).forEach((key) => {\n const imp = this.imports[key];\n if (imp) {\n import(/* @vite-ignore */ imp).then((css: { default: { toString(): string } }) => {\n this.importedStyles += css.default.toString().replace(/:host/, key.toLowerCase());\n });\n }\n });\n }\n }\n\n protected override render() {\n return this.lightDom ? nothing : html`<slot></slot>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteStyle } from './SiteStyle.js';\n\ndefine('site-style', SiteStyle);\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"site-style.js","names":["nothing","_decorate","property","n","b","define","__decorate","A","installLightDomStyles","UvalibElement","fontFallback","base","tokens","SiteStyle","_args","imp","key","css"],"sources":["../src/components/site-style/SiteStyle.ts","../src/components/site-style/site-style.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { fontFallback } from '../../styles/font-fallback.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base } from '../../styles/base.js';\n\n/**\n * Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base page\n * styles on the document. Shadow mode only styles inside its own shadow root, so the\n * `:root` and `html, body` rules of those sheets match nothing there and the slotted content\n * is not restyled; it inherits whatever inherited tokens and fonts the page already provides.\n *\n * @tagname site-style\n * @slot - Content rendered in shadow mode; it is not restyled by this element. In light mode there is no shadow root and the children stay in place.\n * @cssprop [--uva-font-family=franklin-gothic-urw, \"UVA Franklin Fallback\", Arial, Helvetica, sans-serif] - Font family.\n * @cssprop [--uva-font-size-base=17px] - Base font size.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Text colour.\n * @cssprop --uva-color-text - Dark-mode role token: text colour (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (else none).\n */\nexport class SiteStyle extends UvalibElement {\n /** The wrapped content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n static styles = [tokens, base];\n\n /** Map of tag name to a module URL whose default export is a stylesheet; ported as is. */\n @property({ type: Object }) imports: { [key: string]: string } = {};\n\n /**\n * Accumulated text of the stylesheets loaded through `imports`. Carried over from the old\n * component for compatibility; it is not rendered anywhere.\n */\n @property({ type: String }) importedStyles = '';\n\n /**\n * Page-level styles: unscoped; the base rules are unlayered (so they beat host resets), the tokens layered, under their own dedupe key, always on the owner\n * document (not the root node) because `:root` tokens inherit into shadow roots.\n */\n protected override installLightStyles(): void {\n // Tokens layered (host `:root` overrides win), base unlayered (beats host resets).\n installLightDomStyles('uvalib-tokens', [tokens], { root: this.ownerDocument, scope: false });\n installLightDomStyles('uvalib-site-style', [fontFallback, base], {\n root: this.ownerDocument,\n scope: false,\n layer: false,\n });\n }\n\n protected override firstUpdated(): void {\n if (this.imports && !this.noStyle) {\n Object.keys(this.imports).forEach((key) => {\n const imp = this.imports[key];\n if (imp) {\n import(/* @vite-ignore */ imp).then((css: { default: { toString(): string } }) => {\n this.importedStyles += css.default.toString().replace(/:host/, key.toLowerCase());\n });\n }\n });\n }\n }\n\n protected override render() {\n return this.lightDom ? nothing : html`<slot></slot>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteStyle } from './SiteStyle.js';\n\ndefine('site-style', SiteStyle);\n"],"mappings":";;;AAsBA,IAAaa,IAAb,cAA+BJ,EAAc;;EAYE,A,aANoB,KAAA,UAAA,CAAC,GAMrB,KAAA,iBAAA;;;EAVD,KAAA,kBAAA;;;EAC5B,KAAA,SAAA,CAACG,GAAQD,CAAI;;CAe7B,qBAA8C;EAG5C,AADAH,EAAsB,iBAAiB,CAACI,CAAM,GAAG;GAAE,MAAM,KAAK;GAAe,OAAO;EAAM,CAAC,GAC3FJ,EAAsB,qBAAqB,CAACE,GAAcC,CAAI,GAAG;GAC/D,MAAM,KAAK;GACX,OAAO;GACP,OAAO;EACT,CAAC;CACH;CAEA,eAAwC;EACtC,AAAI,KAAK,WAAW,CAAC,KAAK,WACxB,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,SAAS,MAAQ;GACzC,IAAMI,IAAM,KAAK,QAAQC;GACzB,AAAID,KACF;;IAA0BA;CAAI,CAAC,MAAM,MAA6C;IAChF,KAAK,kBAAkBE,EAAI,QAAQ,SAAS,CAAC,CAAC,QAAQ,SAASD,EAAI,YAAY,CAAC;GAClF,CAAC;EAEL,CAAC;CAEL;CAEA,SAA4B;EAC1B,OAAO,KAAK,WAAWhB,IAAU,CAAI;CACvC;AACF;;AAtCGC,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAW,EAAA,WAAA,WAAA,KAAA,CAAA,GAMzBZ,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAW,EAAA,WAAA,kBAAA,KAAA,CAAA,GC/B5BR,EAAO,cAAcQ,CAAS"}
|
|
@@ -42,7 +42,7 @@ Loading rules:
|
|
|
42
42
|
- Breadcrumbs: a `<uvalib-breadcrumbs slot="breadcrumbs">` (from `uvalib-breadcrumbs.js`) inside `<site-page>`, never a hand-built trail. Its children are `<a href>` links ending with the current page (`<span>Title</span>`, or `<a href aria-current="page">`); apps can set its `items` property (`[{ label, href? }]`) instead. `<site-page>` places it between the header and `<main>`, outside `<main>`. Outside `<site-page>` it goes first in the content, above the `<h1>`. To return to the search the visitor came from, give that crumb `data-return-from="<search path>"` (it links to the same-origin referrer when it is that path with a query), never an inline script. In a single-page app with history routing, listen for `uvalib-breadcrumbs-navigate` and call `preventDefault()` to route in place (hash links need nothing).
|
|
43
43
|
- Cards and paging: a collection or photo is a `<uvalib-card>` (`uvalib-card.js`), inside `<uvalib-card-grid>` (`uvalib-card-grid.js`) when there are several. `href` makes the heading the one link for the whole card: never wrap the card in an `<a>`, and do not put another link, button or other control inside a clickable card. The heading needs an accessible name, or the link is hidden. A card with no `href` may contain its own links, including an `actions` slot row (“Read the story”, “Photos (132)”). Do not put that row in a clickable card: the card link covers it, and the component warns. `media-shape="circle"` draws a person or avatar as a circle and keeps the image alt; the count badge still sits on it. An image needs a real alt, or `alt=""` when the heading already names it. Previous/next sections, numbered pages, or `mode="load-more"` (a Load more button and “Showing N of M”, or “Showing N” with no `total`; with an unknown total add `has-more` and remove it, or set `hasMore = false`, after the last page) are one `<uvalib-pager>` (`uvalib-pager.js`); a second pager on the same page needs its own `label`. Load more fires `load-more` (`detail: { page }`, the next page). Call `loaded(firstNew)`, or set `for` to the list id and call `loaded()`, so focus moves to the new item. `<uvalib-tabs>` (`uvalib-tabs.js`) is a tab set: each child with `data-tab` is a panel, or pair `<button slot="tab">` with panels. Arrow keys move, Home and End jump, and `activation="manual"` waits for Enter or Space. `url-param` (or `url-param="hash"`) makes the selected tab linkable and Back restores it. In a single-page app, listen for `uvalib-card-navigate` and `uvalib-pager-navigate` and call `preventDefault()` to route in place.
|
|
44
44
|
- Sub-navigation and tables of contents: a `<uvalib-contents>` (from `uvalib-contents.js`) holding one `<ol>`/`<ul>` of `<li><a href>` entries, nested lists for sub-entries (plain text in an `<li>` for a group label), never a hand-built `<nav>` list or `<details>` for it. It is the `<nav>` landmark (named and headed by `label`, default "Contents"; set `heading-level` to fit the outline) and marks the current page (`aria-current="page"`) and in-page section (`"location"`, from the hash) itself: do not add `aria-current` by hand unless the route is not the URL, and then prefer `current="<url>"`. It collapses into a disclosure button at 64rem and below (`collapse-below`), closed until opened. In a sidebar add `sticky`. For a long document's table of contents without a build-time list, `headings-from="#article"` (with `levels="2-3"`, `min`) builds it from the headings and adds ids; a build-time list (children) is better where possible, since it works without JavaScript. Apps can set `items` (`[{ label, href?, children? }]`); with history routing, cancel `uvalib-contents-navigate` to route in place.
|
|
45
|
-
- Record details: a `<uvalib-metadata>` (from `uvalib-metadata.js`) around a plain `<dl>` (`<dt>` label, `<dd>` values; lists such as subjects as a `<ul>` in the `<dd>`). Downloads are `<a href download data-size="184 KB">EPUB</a>`. For credit and rights use its attributes, not your own rows: `creator`, `organization`, `rights` (a rightsstatements.org or Creative Commons URL; it shows the short name), `rights-info` (`https://www.library.virginia.edu/policies/use-of-materials`) and `citation` or `citation-title` (the Special Collections citation "<title>, Albert and Shirley Small Special Collections Library, University of Virginia"), which adds a Copy citation button. A long list (30 participants) gets `list-limit="8"` (or `data-limit` on its `<dd>`), not your own Show more script. Do not add icons from rightsstatements.org or creativecommons.org.
|
|
45
|
+
- Record details: a `<uvalib-metadata>` (from `uvalib-metadata.js`) around a plain `<dl>` (`<dt>` label, `<dd>` values; lists such as subjects as a `<ul>` in the `<dd>`). Downloads are `<a href download data-size="184 KB">EPUB</a>`. For credit and rights use its attributes, not your own rows: `creator`, `organization`, `rights` (a rightsstatements.org or Creative Commons URL; it shows the short name), `rights-info` (`https://www.library.virginia.edu/policies/use-of-materials`) and `citation` or `citation-title` (the Special Collections citation "<title>, Albert and Shirley Small Special Collections Library, University of Virginia"), which adds a Copy citation button. A long list (30 participants) gets `list-limit="8"` (or `data-limit` on its `<dd>`), not your own Show more script. Do not add icons from rightsstatements.org or creativecommons.org. With `base.css` linked the page does not move when it upgrades, including `list-limit` (or `data-limit`) from 1 to 12; for a larger limit add the page rule from the README ("No jump on upgrade").
|
|
46
46
|
- Long pages (minutes, finding aids, transcriptions, long result lists): a `<uvalib-back-to-top>` (from `uvalib-back-to-top.js`) last in the content inside `<site-page>`, never a hand-built button and scroll script. It stays hidden (`visibility: hidden`, not a tab stop) until the top 400px (`offset`) scroll away, then floats in the bottom corner; activating it scrolls to the top (smooth unless reduced motion) and moves focus to the page's `<h1>` (or `target`, a selector), adding `tabindex="-1"`. The element keeps 4.75rem of space at the end and the button rests there at the bottom, so it never covers the last lines or the footer: do not add your own padding for it. `label` changes its text. `<site-page>` has no attribute for it. It reports `click` to analytics itself.
|
|
47
47
|
- Content for a band above the footer: put an element with `slot="pre-footer"` inside `<site-page>`.
|
|
48
48
|
- `no-footer` on `<site-page>` hides the footer (and any pre-footer band). Use it only for tool or app-like pages, such as a full-screen editor, where the site footer does not belong; normal content pages keep the footer.
|
|
@@ -74,7 +74,7 @@ Loading rules:
|
|
|
74
74
|
|
|
75
75
|
Theme only through the documented surface, never by reaching into internals:
|
|
76
76
|
|
|
77
|
-
- Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason.
|
|
77
|
+
- Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason. If you override `--uva-font-family`, keep `"UVA Franklin Fallback"` right after `franklin-gothic-urw`: it is Arial matched to Franklin Gothic's metrics, so text does not rewrap and shift the page when the Adobe Fonts kit arrives.
|
|
78
78
|
- `::part()` in shadow mode. On a page, use `site-page::part(header)`, `site-page::part(footer)` and `site-page::part(main)` (`<site-page>` re-exports the header and footer parts; `site-header::part(header)` cannot reach through its shadow root). For a standalone `<site-header>` or `<site-footer>` use `site-header::part(header)` / `site-footer::part(footer)`. In light mode there are no shadow parts; style the elements with ordinary selectors.
|
|
79
79
|
- Custom states for runtime state, in shadow and light mode: `uvalib-combobox:state(open)`, `:state(invalid)`, `:state(loading)`; `uvalib-filter-drawer:state(modal)` (phone layout), `:state(open)`; `uvalib-lightbox:state(open)`; `uvalib-tag-list:state(expanded)`. Style them; never add or watch attributes for that state (there are none) or set it yourself (a page cannot). Browsers without custom states just never match.
|
|
80
80
|
- Never pierce shadow roots with JS, depend on internal class names, or use `!important` to fight the chrome.
|
|
@@ -453,7 +453,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
|
|
|
453
453
|
| `--uva-brand-blue` | `#232d4b` | Bar bottom border, chevrons, panel links, and the hover and expanded button text. |
|
|
454
454
|
| `--uva-grey-100` | `#dadada` | Hover and expanded button background, and panel link hover background. |
|
|
455
455
|
| `--uva-brand-orange` | `#e57200` | Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline). |
|
|
456
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
456
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
|
|
457
457
|
| `--uva-color-text` | | Dark-mode role token: top-level button text (else `--uva-grey-darkest`). |
|
|
458
458
|
| `--uva-color-link` | | Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`). |
|
|
459
459
|
| `--uva-color-surface-hover` | | Dark-mode role token: hover and open-group background (else `--uva-grey-100`). |
|
|
@@ -517,7 +517,7 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
|
|
|
517
517
|
|---|---|---|
|
|
518
518
|
| `--uva-brand-blue` | `#232d4b` | Skip link background. |
|
|
519
519
|
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
520
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Page font family (global styles). |
|
|
520
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Page font family (global styles). |
|
|
521
521
|
| `--uva-font-size-base` | `17px` | Page base font size (global styles). |
|
|
522
522
|
| `--uva-grey-darkest` | `#2b2b2b` | Page text colour (global styles). |
|
|
523
523
|
| `--uva-color-surface` | | Dark-mode role token: page background (global styles; else none). |
|
|
@@ -549,7 +549,7 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
|
|
|
549
549
|
|
|
550
550
|
| Property | Default | Description |
|
|
551
551
|
|---|---|---|
|
|
552
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
552
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
|
|
553
553
|
| `--uva-font-size-base` | `17px` | Base font size. |
|
|
554
554
|
| `--uva-grey-darkest` | `#2b2b2b` | Text colour. |
|
|
555
555
|
| `--uva-color-text` | | Dark-mode role token: text colour (else `--uva-grey-darkest`). |
|
package/dist-cdn/tokens.css
CHANGED
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'UVA Franklin Fallback';
|
|
4
|
+
src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');
|
|
5
|
+
font-weight: 100 450;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
size-adjust: 94.52%;
|
|
8
|
+
ascent-override: 100.93%;
|
|
9
|
+
descent-override: 26.56%;
|
|
10
|
+
line-gap-override: 0%;
|
|
11
|
+
}
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'UVA Franklin Fallback';
|
|
14
|
+
src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');
|
|
15
|
+
font-weight: 451 599;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
size-adjust: 95.99%;
|
|
18
|
+
ascent-override: 99.18%;
|
|
19
|
+
descent-override: 26.04%;
|
|
20
|
+
line-gap-override: 0%;
|
|
21
|
+
}
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: 'UVA Franklin Fallback';
|
|
24
|
+
src:
|
|
25
|
+
local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'),
|
|
26
|
+
local('LiberationSans-Bold');
|
|
27
|
+
font-weight: 600 1000;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
size-adjust: 91.32%;
|
|
30
|
+
ascent-override: 104.03%;
|
|
31
|
+
descent-override: 27.38%;
|
|
32
|
+
line-gap-override: 0%;
|
|
33
|
+
}
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'UVA Franklin Fallback';
|
|
36
|
+
src:
|
|
37
|
+
local('Arial Italic'), local('Arial-ItalicMT'), local('Liberation Sans Italic'),
|
|
38
|
+
local('LiberationSans-Italic');
|
|
39
|
+
font-weight: 100 599;
|
|
40
|
+
font-style: italic;
|
|
41
|
+
size-adjust: 95.06%;
|
|
42
|
+
ascent-override: 101.09%;
|
|
43
|
+
descent-override: 26.4%;
|
|
44
|
+
line-gap-override: 0%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
2
48
|
:root {
|
|
3
49
|
--uva-brand-blue-lightest: #87B9D9;
|
|
4
50
|
--uva-brand-blue-lighter: #3395D4;
|
|
@@ -76,7 +122,7 @@
|
|
|
76
122
|
--uva-grey: #808080;
|
|
77
123
|
--uva-grey-A: #4F4F4F;
|
|
78
124
|
--uva-grey-B: #2B2B2B;
|
|
79
|
-
--uva-font-family: franklin-gothic-urw, Arial, Helvetica, sans-serif;
|
|
125
|
+
--uva-font-family: franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif;
|
|
80
126
|
--uva-font-size-base: 17px;
|
|
81
127
|
}
|
|
82
128
|
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ Loading rules:
|
|
|
42
42
|
- Breadcrumbs: a `<uvalib-breadcrumbs slot="breadcrumbs">` (from `uvalib-breadcrumbs.js`) inside `<site-page>`, never a hand-built trail. Its children are `<a href>` links ending with the current page (`<span>Title</span>`, or `<a href aria-current="page">`); apps can set its `items` property (`[{ label, href? }]`) instead. `<site-page>` places it between the header and `<main>`, outside `<main>`. Outside `<site-page>` it goes first in the content, above the `<h1>`. To return to the search the visitor came from, give that crumb `data-return-from="<search path>"` (it links to the same-origin referrer when it is that path with a query), never an inline script. In a single-page app with history routing, listen for `uvalib-breadcrumbs-navigate` and call `preventDefault()` to route in place (hash links need nothing).
|
|
43
43
|
- Cards and paging: a collection or photo is a `<uvalib-card>` (`uvalib-card.js`), inside `<uvalib-card-grid>` (`uvalib-card-grid.js`) when there are several. `href` makes the heading the one link for the whole card: never wrap the card in an `<a>`, and do not put another link, button or other control inside a clickable card. The heading needs an accessible name, or the link is hidden. A card with no `href` may contain its own links, including an `actions` slot row (“Read the story”, “Photos (132)”). Do not put that row in a clickable card: the card link covers it, and the component warns. `media-shape="circle"` draws a person or avatar as a circle and keeps the image alt; the count badge still sits on it. An image needs a real alt, or `alt=""` when the heading already names it. Previous/next sections, numbered pages, or `mode="load-more"` (a Load more button and “Showing N of M”, or “Showing N” with no `total`; with an unknown total add `has-more` and remove it, or set `hasMore = false`, after the last page) are one `<uvalib-pager>` (`uvalib-pager.js`); a second pager on the same page needs its own `label`. Load more fires `load-more` (`detail: { page }`, the next page). Call `loaded(firstNew)`, or set `for` to the list id and call `loaded()`, so focus moves to the new item. `<uvalib-tabs>` (`uvalib-tabs.js`) is a tab set: each child with `data-tab` is a panel, or pair `<button slot="tab">` with panels. Arrow keys move, Home and End jump, and `activation="manual"` waits for Enter or Space. `url-param` (or `url-param="hash"`) makes the selected tab linkable and Back restores it. In a single-page app, listen for `uvalib-card-navigate` and `uvalib-pager-navigate` and call `preventDefault()` to route in place.
|
|
44
44
|
- Sub-navigation and tables of contents: a `<uvalib-contents>` (from `uvalib-contents.js`) holding one `<ol>`/`<ul>` of `<li><a href>` entries, nested lists for sub-entries (plain text in an `<li>` for a group label), never a hand-built `<nav>` list or `<details>` for it. It is the `<nav>` landmark (named and headed by `label`, default "Contents"; set `heading-level` to fit the outline) and marks the current page (`aria-current="page"`) and in-page section (`"location"`, from the hash) itself: do not add `aria-current` by hand unless the route is not the URL, and then prefer `current="<url>"`. It collapses into a disclosure button at 64rem and below (`collapse-below`), closed until opened. In a sidebar add `sticky`. For a long document's table of contents without a build-time list, `headings-from="#article"` (with `levels="2-3"`, `min`) builds it from the headings and adds ids; a build-time list (children) is better where possible, since it works without JavaScript. Apps can set `items` (`[{ label, href?, children? }]`); with history routing, cancel `uvalib-contents-navigate` to route in place.
|
|
45
|
-
- Record details: a `<uvalib-metadata>` (from `uvalib-metadata.js`) around a plain `<dl>` (`<dt>` label, `<dd>` values; lists such as subjects as a `<ul>` in the `<dd>`). Downloads are `<a href download data-size="184 KB">EPUB</a>`. For credit and rights use its attributes, not your own rows: `creator`, `organization`, `rights` (a rightsstatements.org or Creative Commons URL; it shows the short name), `rights-info` (`https://www.library.virginia.edu/policies/use-of-materials`) and `citation` or `citation-title` (the Special Collections citation "<title>, Albert and Shirley Small Special Collections Library, University of Virginia"), which adds a Copy citation button. A long list (30 participants) gets `list-limit="8"` (or `data-limit` on its `<dd>`), not your own Show more script. Do not add icons from rightsstatements.org or creativecommons.org.
|
|
45
|
+
- Record details: a `<uvalib-metadata>` (from `uvalib-metadata.js`) around a plain `<dl>` (`<dt>` label, `<dd>` values; lists such as subjects as a `<ul>` in the `<dd>`). Downloads are `<a href download data-size="184 KB">EPUB</a>`. For credit and rights use its attributes, not your own rows: `creator`, `organization`, `rights` (a rightsstatements.org or Creative Commons URL; it shows the short name), `rights-info` (`https://www.library.virginia.edu/policies/use-of-materials`) and `citation` or `citation-title` (the Special Collections citation "<title>, Albert and Shirley Small Special Collections Library, University of Virginia"), which adds a Copy citation button. A long list (30 participants) gets `list-limit="8"` (or `data-limit` on its `<dd>`), not your own Show more script. Do not add icons from rightsstatements.org or creativecommons.org. With `base.css` linked the page does not move when it upgrades, including `list-limit` (or `data-limit`) from 1 to 12; for a larger limit add the page rule from the README ("No jump on upgrade").
|
|
46
46
|
- Long pages (minutes, finding aids, transcriptions, long result lists): a `<uvalib-back-to-top>` (from `uvalib-back-to-top.js`) last in the content inside `<site-page>`, never a hand-built button and scroll script. It stays hidden (`visibility: hidden`, not a tab stop) until the top 400px (`offset`) scroll away, then floats in the bottom corner; activating it scrolls to the top (smooth unless reduced motion) and moves focus to the page's `<h1>` (or `target`, a selector), adding `tabindex="-1"`. The element keeps 4.75rem of space at the end and the button rests there at the bottom, so it never covers the last lines or the footer: do not add your own padding for it. `label` changes its text. `<site-page>` has no attribute for it. It reports `click` to analytics itself.
|
|
47
47
|
- Content for a band above the footer: put an element with `slot="pre-footer"` inside `<site-page>`.
|
|
48
48
|
- `no-footer` on `<site-page>` hides the footer (and any pre-footer band). Use it only for tool or app-like pages, such as a full-screen editor, where the site footer does not belong; normal content pages keep the footer.
|
|
@@ -74,7 +74,7 @@ Loading rules:
|
|
|
74
74
|
|
|
75
75
|
Theme only through the documented surface, never by reaching into internals:
|
|
76
76
|
|
|
77
|
-
- Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason.
|
|
77
|
+
- Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason. If you override `--uva-font-family`, keep `"UVA Franklin Fallback"` right after `franklin-gothic-urw`: it is Arial matched to Franklin Gothic's metrics, so text does not rewrap and shift the page when the Adobe Fonts kit arrives.
|
|
78
78
|
- `::part()` in shadow mode. On a page, use `site-page::part(header)`, `site-page::part(footer)` and `site-page::part(main)` (`<site-page>` re-exports the header and footer parts; `site-header::part(header)` cannot reach through its shadow root). For a standalone `<site-header>` or `<site-footer>` use `site-header::part(header)` / `site-footer::part(footer)`. In light mode there are no shadow parts; style the elements with ordinary selectors.
|
|
79
79
|
- Custom states for runtime state, in shadow and light mode: `uvalib-combobox:state(open)`, `:state(invalid)`, `:state(loading)`; `uvalib-filter-drawer:state(modal)` (phone layout), `:state(open)`; `uvalib-lightbox:state(open)`; `uvalib-tag-list:state(expanded)`. Style them; never add or watch attributes for that state (there are none) or set it yourself (a page cannot). Browsers without custom states just never match.
|
|
80
80
|
- Never pierce shadow roots with JS, depend on internal class names, or use `!important` to fight the chrome.
|
|
@@ -453,7 +453,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
|
|
|
453
453
|
| `--uva-brand-blue` | `#232d4b` | Bar bottom border, chevrons, panel links, and the hover and expanded button text. |
|
|
454
454
|
| `--uva-grey-100` | `#dadada` | Hover and expanded button background, and panel link hover background. |
|
|
455
455
|
| `--uva-brand-orange` | `#e57200` | Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline). |
|
|
456
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
456
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
|
|
457
457
|
| `--uva-color-text` | | Dark-mode role token: top-level button text (else `--uva-grey-darkest`). |
|
|
458
458
|
| `--uva-color-link` | | Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`). |
|
|
459
459
|
| `--uva-color-surface-hover` | | Dark-mode role token: hover and open-group background (else `--uva-grey-100`). |
|
|
@@ -517,7 +517,7 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
|
|
|
517
517
|
|---|---|---|
|
|
518
518
|
| `--uva-brand-blue` | `#232d4b` | Skip link background. |
|
|
519
519
|
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
520
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Page font family (global styles). |
|
|
520
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Page font family (global styles). |
|
|
521
521
|
| `--uva-font-size-base` | `17px` | Page base font size (global styles). |
|
|
522
522
|
| `--uva-grey-darkest` | `#2b2b2b` | Page text colour (global styles). |
|
|
523
523
|
| `--uva-color-surface` | | Dark-mode role token: page background (global styles; else none). |
|
|
@@ -549,7 +549,7 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
|
|
|
549
549
|
|
|
550
550
|
| Property | Default | Description |
|
|
551
551
|
|---|---|---|
|
|
552
|
-
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
552
|
+
| `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
|
|
553
553
|
| `--uva-font-size-base` | `17px` | Base font size. |
|
|
554
554
|
| `--uva-grey-darkest` | `#2b2b2b` | Text colour. |
|
|
555
555
|
| `--uva-color-text` | | Dark-mode role token: text colour (else `--uva-grey-darkest`). |
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-BI8h0Gf3.js","names":["i","tokens","TYPEKIT_URL","base"],"sources":["../../src/styles/tokens.ts","../../src/styles/base.ts"],"sourcesContent":["// GENERATED by scripts/sync-tokens.mjs from ../monorepo/packages/drupal_library_theme/src/scss/base — do not edit\nimport { css } from 'lit';\n\nexport const tokens = css`\n :root {\n --uva-brand-blue-lightest: #87B9D9;\n --uva-brand-blue-lighter: #3395D4;\n --uva-brand-blue-light: #0370B7;\n --uva-brand-blue-base: #232D4B;\n --uva-brand-blue-300: #87B9D9;\n --uva-brand-blue-200: #3395D4;\n --uva-brand-blue-100: #0370B7;\n --uva-brand-blue: #232D4B;\n --uva-brand-orange-lightest: #FFEAD6;\n --uva-brand-orange-lighter: #FFC999;\n --uva-brand-orange-light: #FFB370;\n --uva-brand-orange-base: #E57200;\n --uva-brand-orange-dark: #B35900;\n --uva-brand-orange-darker: #854200;\n --uva-brand-orange-300: #FFEAD6;\n --uva-brand-orange-200: #FFC999;\n --uva-brand-orange-100: #FFB370;\n --uva-brand-orange: #E57200;\n --uva-brand-orange-A: #B35900;\n --uva-brand-orange-B: #854200;\n --uva-blue-alt-lightest: #BFE7F7;\n --uva-blue-alt-lighter: #91D8F2;\n --uva-blue-alt-light: #55C4EC;\n --uva-blue-alt-base: #007BAC;\n --uva-blue-alt-dark: #005679;\n --uva-blue-alt-darkest: #141E3C;\n --uva-blue-alt-400: #e6f2f7;\n --uva-blue-alt-300: #BFE7F7;\n --uva-blue-alt-200: #91D8F2;\n --uva-blue-alt-100: #55C4EC;\n --uva-blue-alt: #007BAC;\n --uva-blue-alt-A: #005679;\n --uva-blue-alt-B: #141E3C;\n --uva-teal-lightest: #C8F2F4;\n --uva-teal-light: #5BD7DE;\n --uva-teal-base: #25CAD3;\n --uva-teal-dark: #1DA1A8;\n --uva-teal-darker: #16777C;\n --uva-teal-200: #C8F2F4;\n --uva-teal-100: #5BD7DE;\n --uva-teal: #25CAD3;\n --uva-teal-A: #1DA1A8;\n --uva-teal-B: #16777C;\n --uva-green-lightest: #DDEFDC;\n --uva-green-lighter: #89CC74;\n --uva-green-base: #62BB46;\n --uva-green-dark: #4E9737;\n --uva-green-200: #DDEFDC;\n --uva-green-100: #89CC74;\n --uva-green: #62BB46;\n --uva-green-A: #4E9737;\n --uva-red-lightest: #FBCFDA;\n --uva-red-base: #EF3F6B;\n --uva-red-dark: #DF1E43;\n --uva-red-darker: #B30000;\n --uva-red-100: #FBCFDA;\n --uva-red: #EF3F6B;\n --uva-red-A: #DF1E43;\n --uva-red-B: #B30000;\n --uva-yellow-lightest: #FEF6C8;\n --uva-yellow-base: #ECC602;\n --uva-yellow-dark: #B99C02;\n --uva-yellow-100: #FEF6C8;\n --uva-yellow: #ECC602;\n --uva-yellow-A: #B99C02;\n --uva-grey-lightest: #F1F1F1;\n --uva-grey-light: #DADADA;\n --uva-grey-base: #808080;\n --uva-grey-dark: #4F4F4F;\n --uva-grey-darkest: #2B2B2B;\n --uva-grey-200: #F1F1F1;\n --uva-grey-100: #DADADA;\n --uva-grey-50: #ADADAD;\n --uva-grey: #808080;\n --uva-grey-A: #4F4F4F;\n --uva-grey-B: #2B2B2B;\n --uva-font-family: franklin-gothic-urw, Arial, Helvetica, sans-serif;\n --uva-font-size-base: 17px;\n }\n`;\n","import { css } from 'lit';\n\nexport const TYPEKIT_URL = 'https://use.typekit.net/oym8nvz.css';\n\n// The body background has no fallback: without dark mode it stays transparent, as before.\n//\n// site-page:not(:defined) applies when base.css is linked in <head>, before the element\n// upgrades: its own formatting context (flow-root), so a heading's top margin cannot collapse\n// through to <body> and shift the page once the element upgrades, and invisible, so its\n// content does not paint above where the header will go. If the script never loads, the\n// content appears anyway after two seconds.\nexport const base = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n html,\n body {\n font-family: var(--uva-font-family, franklin-gothic-urw, Arial, Helvetica, sans-serif);\n }\n html {\n font-size: var(--uva-font-size-base, 17px);\n }\n body {\n margin: 0;\n line-height: 1.5;\n min-height: 100vh;\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n background-color: var(--uva-color-surface);\n }\n site-page:not(:defined) {\n display: flow-root;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-breadcrumbs:not(:defined),\n uvalib-card:not(:defined),\n uvalib-card-grid:not(:defined),\n uvalib-pager:not(:defined),\n uvalib-contents:not(:defined),\n uvalib-metadata:not(:defined),\n uvalib-tag-list:not(:defined) {\n display: block;\n line-height: 1.5;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n /* A chip row: hidden, one 44px row tall (with the scrolling row's padding), the raw\n children kept on one line so they cannot make it taller. */\n uvalib-chip-group:not(:defined) {\n display: block;\n min-height: 44px;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-chip-group[scroll]:not(:defined) {\n min-height: calc(44px + 0.75rem);\n }\n /* A description: one line of it (0.875rem at 1.5, 0.25rem below the row). */\n uvalib-chip-group[description]:not(:defined) {\n padding-block-end: 1.5625rem;\n }\n /* Its text is drawn from attributes: hold one line until it upgrades. */\n uvalib-results-count:not(:defined) {\n display: block;\n min-block-size: 1.5em;\n }\n uvalib-tag-list:not(:defined)[hidden],\n uvalib-results-count:not(:defined)[hidden] {\n display: none;\n }\n /* The pre-upgrade rules here set display, which beats the hidden attribute's (issue #7).\n More specific than each of them (two pseudo-classes or attributes), so it needs no importance flag. */\n :where(\n site-page,\n uvalib-breadcrumbs,\n uvalib-card,\n uvalib-card-grid,\n uvalib-pager,\n uvalib-contents,\n uvalib-metadata,\n uvalib-chip-group,\n uvalib-tabs,\n uvalib-combobox,\n uvalib-image-regions,\n uvalib-map,\n uvalib-filter-drawer\n ):not(:defined)[hidden],\n :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {\n display: none;\n }\n /* Tabs stay readable before the script runs: a block, one panel, and a gap the\n size of the tab row (44px) plus its 1rem margin, so the first panel does not\n jump when the element upgrades. Later data-tab panels stay hidden. */\n uvalib-tabs:not(:defined) {\n display: block;\n padding-block-start: calc(44px + 1rem);\n }\n uvalib-tabs:not(:defined) > [data-tab] ~ [data-tab] {\n display: none;\n }\n /* A combobox: its label (from the attribute) and one 44px field (plus a one-line\n description) held, so nothing moves when it upgrades. A fallback <input list> child\n works meanwhile; the other children (options, a datalist) stay out of sight. */\n uvalib-combobox:not(:defined) {\n display: block;\n min-block-size: calc(1.5em + 0.25rem + 44px);\n line-height: 1.5;\n }\n uvalib-combobox[description]:not(:defined) {\n min-block-size: calc(3em + 0.5rem + 44px);\n }\n uvalib-combobox:not(:defined)::before {\n content: attr(label);\n display: block;\n margin-block-end: 0.25rem;\n font-weight: 600;\n }\n uvalib-combobox:not(:defined) > :not(input) {\n display: none;\n }\n uvalib-combobox:not(:defined) > input {\n display: block;\n box-sizing: border-box;\n inline-size: 100%;\n min-block-size: 44px;\n font: inherit;\n line-height: 1.2;\n }\n /* Image regions: the image at its own width and the list beside it (or under it), the\n layout the element keeps once it upgrades, so the image does not move. */\n uvalib-image-regions:not(:defined) {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n align-items: flex-start;\n }\n uvalib-image-regions:not(:defined) > :is(img, picture) {\n display: block;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n height: auto;\n }\n uvalib-image-regions:not(:defined) > :is(ol, ul) {\n flex: 1 1 14rem;\n min-width: 0;\n }\n /* A map: its key instructions (the same text it shows) and the map's height held above\n the child list, so the list does not move when the map is drawn over the page's\n Leaflet. Padding, not margin, so it cannot collapse with the list's own top margin. */\n uvalib-map:not(:defined) {\n display: block;\n }\n uvalib-map:not(:defined)::before {\n content: 'Tab or arrow keys move between places; Enter opens one. With the map focused, arrow keys pan and + and − zoom.';\n display: block;\n padding-block-end: calc(0.5rem + max(12rem, var(--uvalib-map-height, min(24rem, 75vw))));\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--uva-color-text-muted, #4b5563);\n }\n /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px\n \"Search and filters\" button shows, so hold that height and keep the form and filters out\n of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the\n same two rules in a media query of that width (see the README). Low specificity, so the\n [hidden] rule above still wins. */\n @media (max-width: 48rem) {\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) {\n display: block;\n min-block-size: 44px;\n }\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) > * {\n display: none;\n }\n }\n /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme\n prints light (the role tokens resolve to their light values), and the content's links\n are black and underlined, so they are told apart without colour. Content is <main> in\n light DOM and the unslotted children in shadow DOM. print-chrome keeps the page as it is\n shown, apart from the light scheme. */\n @media print {\n :root[data-uva-color-scheme]:has(site-page) {\n color-scheme: light;\n --uva-color-scheme: light;\n }\n /* Light DOM's trail, here too, as the pre-upgrade rule above (unlayered) would win. */\n site-page:not([print-chrome]) > [slot='breadcrumbs'] {\n display: none;\n }\n site-page:not([print-chrome]) > :not([slot], site-header, site-footer, .alerts-list) :any-link,\n site-page:not([print-chrome]) > :any-link:not([slot], .skip-link) {\n color: #000;\n text-decoration: underline;\n }\n }\n @keyframes uvalib-site-page-reveal {\n to {\n visibility: visible;\n }\n }\n`;\n"],"mappings":";;AAGA,IAAaC,IAAS,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCDZC,IAAc,uCASdC,IAAO,CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"site-main-nav-DURrQMal.js","names":["t","unsafeCSS","ifDefined","_decorate","property","state","n","i","r$1","b","define","__decorate","r","installLightDomStyles","UvalibElement","trackEvent","accessible","siteLink","o","A","str","v","normalizeItems","out","raw","collect","nodes","label","href","kids","into","depth","links","text","el","readItemsMarkup","list","source","readLi","li","sub","k","head","mainNavTiming","fetchJson","error","attempts","response","url","cache","loadMainNavItems","p","promise","result","json","MAIN_NAV_SNAPSHOT","\"label\"","\"items\"","\"href\"","navCounter","MAIN_NAV","isSourceChild","SOURCE_ATTRS","FOCUS_RULES","focusRules","lightFocusRules","tag","pageKey","u","base","hashOf","SiteMainNav","_args","nav","root","win","on","target","type","kind","what","moved","sources","next","s","content","changed","src","key","index","opening","doc","to","tops","top","open","openButton","panel","button","here","matches","hrefs","h","hash","a","group","items","item","l","all","current","mark","marked","cur","id","expanded","has","linkMarked"],"sources":["../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/if-defined.js","../../src/components/site-main-nav/main-nav-items.ts","../../src/components/site-main-nav/main-nav-data.ts","../../src/components/site-main-nav/SiteMainNav.ts","../../src/components/site-main-nav/site-main-nav.ts"],"sourcesContent":["import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","// Data helpers for <site-main-nav>: the item types, normalising items from any source\n// (property, JSON, markup) to the two levels the nav shows, and the `items-src` loader.\n// Internal apart from the types. No side effects on import.\n\n/** A link inside a main-navigation group. */\nexport interface MainNavLink {\n label: string;\n href: string;\n}\n\n/**\n * One top-level main-navigation entry: a group (a button that discloses `items`) or, with\n * no `items`, a direct link to `href`. A group's own `href` is not shown.\n */\nexport interface MainNavItem {\n label: string;\n href?: string;\n items?: MainNavLink[];\n}\n\n/** What normalising found besides the items: skipped entries, flattened deeper levels. */\nexport interface NormalizeResult {\n items: MainNavItem[];\n invalid: boolean;\n flattened: boolean;\n}\n\nconst str = (v: unknown): string => (typeof v === 'string' ? v.replace(/\\s+/g, ' ').trim() : '');\n\n/**\n * Reduce untrusted items (a property, JSON or parsed markup) to the two levels the nav\n * shows. Entries without a label, links without an href, and groups with no valid links\n * are skipped (`invalid`); links nested deeper than a group are lifted into it\n * (`flattened`), and a deeper level's own label is dropped unless it has an href.\n */\nexport function normalizeItems(raw: unknown): NormalizeResult {\n const out: NormalizeResult = { items: [], invalid: false, flattened: false };\n if (!Array.isArray(raw)) {\n out.invalid = raw != null;\n return out;\n }\n const collect = (nodes: unknown[], into: MainNavLink[], depth: number): void => {\n for (const n of nodes) {\n const o = (n ?? {}) as Record<string, unknown>;\n const label = str(o.label);\n const href = str(o.href);\n const kids = Array.isArray(o.items) && o.items.length ? o.items : null;\n if (kids) {\n out.flattened = true;\n if (label && href) into.push({ label, href });\n collect(kids, into, depth + 1);\n } else if (label && href) {\n into.push({ label, href });\n } else {\n out.invalid = true;\n }\n }\n };\n for (const n of raw) {\n const o = (n ?? {}) as Record<string, unknown>;\n const label = str(o.label);\n const href = str(o.href);\n const kids = Array.isArray(o.items) && o.items.length ? o.items : null;\n if (!label) {\n out.invalid = true;\n } else if (kids) {\n const links: MainNavLink[] = [];\n collect(kids, links, 2);\n if (links.length) out.items.push({ label, items: links });\n else if (href) out.items.push({ label, href });\n else out.invalid = true;\n } else if (href) {\n out.items.push({ label, href });\n } else {\n out.invalid = true;\n }\n }\n return out;\n}\n\nconst text = (el: Element): string => (el.textContent ?? '').replace(/\\s+/g, ' ').trim();\n\n/**\n * Read `<nav><ul><li>…</li></ul></nav>` (or a bare `<ul>`) markup into raw items: an\n * `<li>` holding an `<a href>` (and no list) is a direct link; an `<li>` whose first child\n * element is a label (`<span>`, or any element but a list) followed by a `<ul>` is a group.\n * Anything else is reported as invalid by normalizeItems().\n */\nexport function readItemsMarkup(source: Element): unknown[] {\n const list =\n source.localName === 'ul' ? source : (source.querySelector(':scope > ul') ?? undefined);\n if (!list) return [{}];\n const readLi = (li: Element): unknown => {\n if (li.localName !== 'li') return {};\n const kids = [...li.children];\n const sub = kids.find((k) => k.localName === 'ul');\n const head = kids.find((k) => k.localName !== 'ul');\n if (!head) return {};\n const label = text(head);\n const href = head.localName === 'a' ? head.getAttribute('href') : null;\n if (!sub) return head.localName === 'a' ? { label, href } : { label };\n return { label, href, items: [...sub.children].map(readLi) };\n };\n return [...list.children].map(readLi);\n}\n\n/**\n * `items-src` fetch: how many attempts, the delay between them (ms) and each attempt's\n * timeout (ms). With the defaults a hung server is given up on after about 21 s.\n */\nexport const mainNavTiming = { attempts: 2, retryDelay: 1000, timeout: 10_000 };\n\nasync function fetchJson(url: string): Promise<unknown> {\n let error: unknown;\n const attempts = Math.max(1, mainNavTiming.attempts);\n for (let i = 0; i < attempts; i++) {\n if (i > 0) await new Promise((r) => setTimeout(r, mainNavTiming.retryDelay));\n try {\n // A hung attempt times out and counts as a failed attempt.\n const response = await fetch(url, { signal: AbortSignal.timeout(mainNavTiming.timeout) });\n if (!response.ok) throw new Error(`${response.status} ${response.statusText} for ${url}`);\n return await response.json();\n } catch (e) {\n error = e;\n }\n }\n throw error instanceof Error ? error : new Error(String(error));\n}\n\nconst cache = new Map<string, Promise<NormalizeResult>>();\n\n/**\n * The items at `url` (JSON in the `MainNavItem[]` shape), fetched once per URL and shared by\n * every nav on the page. A response with no valid entries is an error. Failures are not\n * cached, so a later load tries again.\n */\nexport function loadMainNavItems(url: string): Promise<NormalizeResult> {\n let p = cache.get(url);\n if (!p) {\n const promise = fetchJson(url).then((json) => {\n const result = normalizeItems(json);\n if (!result.items.length) throw new Error(`no valid main navigation entries in ${url}`);\n return result;\n });\n cache.set(url, (p = promise));\n promise.catch(() => {\n if (cache.get(url) === promise) cache.delete(url);\n });\n }\n return p;\n}\n","// GENERATED by scripts/sync-main-nav.mjs from a saved page on 2026-11-14 — do not edit.\n// The desktop \"Main navigation\" of library.virginia.edu. Regenerate with `pnpm sync:main-nav`.\nimport type { MainNavItem } from './main-nav-items.js';\n\n/** The day the snapshot was taken (YYYY-MM-DD). */\nexport const MAIN_NAV_SNAPSHOT_DATE = '2026-11-14';\n\n/** The library main navigation, as on library.virginia.edu when the snapshot was taken. */\nexport const MAIN_NAV_SNAPSHOT: readonly MainNavItem[] = [\n {\n \"label\": \"About\",\n \"items\": [\n {\n \"label\": \"About UVA Library\",\n \"href\": \"/about-uva-library\"\n },\n {\n \"label\": \"News & announcements\",\n \"href\": \"https://library.virginia.edu/news/all?mtm_campaign=main-nav\"\n },\n {\n \"label\": \"Plan a visit\",\n \"href\": \"/about-uva-library#visit\"\n },\n {\n \"label\": \"Library Assessment\",\n \"href\": \"/assessment\"\n },\n {\n \"label\": \"Staff directory\",\n \"href\": \"/staff\"\n }\n ]\n },\n {\n \"label\": \"Using the Library\",\n \"items\": [\n {\n \"label\": \"Search, borrow, request\",\n \"href\": \"/services\"\n },\n {\n \"label\": \"Library spaces\",\n \"href\": \"/spaces\"\n },\n {\n \"label\": \"Equipment & technology\",\n \"href\": \"/equipment-and-tech\"\n }\n ]\n },\n {\n \"label\": \"Research & teaching support\",\n \"items\": [\n {\n \"label\": \"Research & teaching support\",\n \"href\": \"/research-and-teaching\"\n },\n {\n \"label\": \"Research support\",\n \"href\": \"/research-and-teaching/research\"\n },\n {\n \"label\": \"Instruction assistance\",\n \"href\": \"/research-and-teaching/teach\"\n },\n {\n \"label\": \"Writing & publication\",\n \"href\": \"/research-and-teaching/write\"\n }\n ]\n },\n {\n \"label\": \"Get help\",\n \"items\": [\n {\n \"label\": \"Get help\",\n \"href\": \"/help\"\n },\n {\n \"label\": \"Ask a Librarian\",\n \"href\": \"/askalibrarian\"\n },\n {\n \"label\": \"Accessibility services\",\n \"href\": \"/accessibility\"\n },\n {\n \"label\": \"Subject specialists\",\n \"href\": \"https://guides.lib.virginia.edu/subjectlibrarians\"\n }\n ]\n }\n];\n","import { html, css, unsafeCSS, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { siteLink } from '../link.js';\nimport { MAIN_NAV_SNAPSHOT } from './main-nav-data.js';\nimport {\n loadMainNavItems,\n normalizeItems,\n readItemsMarkup,\n type MainNavItem,\n type NormalizeResult,\n} from './main-nav-items.js';\n\nexport type { MainNavItem, MainNavLink } from './main-nav-items.js';\n\n/** Light-DOM instances share the document id space, so every instance numbers its own ids. */\nlet navCounter = 0;\n\nconst MAIN_NAV = 'main-nav';\nconst isSourceChild = (n: Node): n is Element =>\n n instanceof Element && n.getAttribute('slot') === MAIN_NAV;\n/** Attributes of the source markup that change what the nav renders. */\nconst SOURCE_ATTRS = ['href', 'slot'];\n\n/**\n * Focus rings: inset (as on the live site) so an open panel or a neighbour never covers\n * them; orange on white, brand blue where the background is grey (hover, the open group),\n * so the ring keeps 3:1 contrast.\n */\nconst FOCUS_RULES = `\n .toggle:focus-visible,\n .top-link:focus-visible,\n .panel a:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: -4px;\n }\n .toggle[aria-expanded='true']:focus-visible,\n .toggle:hover:focus-visible,\n .top-link:hover:focus-visible,\n .panel a:hover:focus-visible {\n outline-color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n`;\nconst focusRules = unsafeCSS(FOCUS_RULES);\n/** The focus rules scoped to `tag`, for the unlayered light-mode sheet. */\nconst lightFocusRules = (tag: string) =>\n unsafeCSS(FOCUS_RULES.replace(/(^|,)\\s*\\./gm, `$1 ${tag} .`));\n\n/** A URL reduced to what \"the same page\" means here: host (without `www.`) and path. */\nfunction pageKey(href: string, base: string): string | null {\n try {\n const u = new URL(href, base);\n return `${u.host.replace(/^www\\./, '')}${u.pathname.replace(/\\/+$/, '')}`;\n } catch {\n return null;\n }\n}\nconst hashOf = (href: string, base: string): string => {\n try {\n return new URL(href, base).hash;\n } catch {\n return '';\n }\n};\n\n/**\n * The UVA Library main navigation (About, Using the Library, Research & teaching support,\n * Get help), as on library.virginia.edu, following the WAI-ARIA disclosure navigation\n * pattern: one `<nav>` landmark; each group is a `<button aria-expanded aria-controls>`\n * followed by its list of links, and an entry with no group is a plain link. Click, Enter or\n * Space toggles a group and only one is open at a time; Escape closes it and returns focus to\n * its button; arrow keys, Home and End move between the buttons and between a panel's links,\n * and ArrowDown on an open button moves into its panel. In the `bar` layout a panel also closes\n * when focus leaves the nav or on a pointer press outside it. There is no hover-to-open.\n *\n * The items come from, in order of precedence: a `<nav slot=\"main-nav\">` child holding\n * `<ul><li><a href>…</a></li></ul>` (a direct link) or `<li><span>Group</span><ul><li><a href>…`\n * (a group), kept hidden and watched for changes; the `items` property; JSON at `items-src`;\n * and the snapshot of the live menu bundled with the component (see `pnpm sync:main-nav`).\n * Invalid entries are skipped and levels deeper than two are flattened, each with one console\n * warning. Relative hrefs are joined to `root-link-domain`; absolute ones are kept, and\n * fragment-only ones (`#…`, a hash route) stay on this page. A plain click on a link closes\n * the open group.\n *\n * The link for the current page (`current`, default the page location, followed through\n * same-document navigations; host and path, ignoring the query, the hash, a trailing slash\n * and a leading `www.`) gets `aria-current=\"page\"`, and its group button\n * `aria-current=\"true\"`, shown bold with a thick underline. Of links that differ only by\n * hash, the one with the page's hash is marked, else the one without a hash; if every one\n * has a hash, the first is marked while the page has none, and none for a hash none has.\n *\n * `<site-header>` renders it: as a row under the logo on wide screens and as an accordion in\n * the Menu popover on narrow ones.\n *\n * @tagname site-main-nav\n * @slot main-nav - Optional `<nav>` (or `<ul>`) whose list replaces the menu: `<li><a href>` for a direct link, `<li><span>Group</span><ul><li><a href>…</a></li></ul></li>` for a group. It is never shown itself; in light mode it is moved into a hidden holder.\n * @fires site-main-nav-error - `items-src` could not be loaded: both attempts failed (network error, a 10 s timeout per attempt, or no valid entries), after about 21 s at worst; the nav shows the bundled snapshot. `detail` is `{ src, message }`. Bubbles and is composed.\n * @fires uvalib-analytics-event - For `<site-analytics>`: a group was opened, `['site-main-nav', 'menu-open', <the group's label>]` (not on close), and a link was clicked, `['site-main-nav', 'link-click', '<Group> > <Link>']` (a top-level link: its label alone; never the URL). Bubbles and is composed.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Top-level button colour.\n * @cssprop [--uva-brand-blue=#232d4b] - Bar bottom border, chevrons, panel links, and the hover and expanded button text.\n * @cssprop [--uva-grey-100=#dadada] - Hover and expanded button background, and panel link hover background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Font family.\n * @cssprop --uva-color-text - Dark-mode role token: top-level button text (else `--uva-grey-darkest`).\n * @cssprop --uva-color-link - Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`).\n * @cssprop --uva-color-surface-hover - Dark-mode role token: hover and open-group background (else `--uva-grey-100`).\n * @cssprop --uva-color-surface-raised - Dark-mode role token: bar and panel background (else #ffffff).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: bar bottom rule (else `--uva-brand-blue`).\n * @cssprop --uva-color-shadow - Dark-mode role token: panel shadow colour (else rgba(0, 0, 0, 0.2)).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n * @cssprop --uva-color-current - Dark-mode role token: current-page underline (else `--uva-brand-orange`).\n */\nexport class SiteMainNav extends UvalibElement {\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n font-family: var(--uva-font-family, franklin-gothic-urw, Arial, Helvetica, sans-serif);\n font-size: 17px;\n line-height: 1.5;\n }\n :host([hidden]) {\n display: none;\n }\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n .panel[hidden] {\n display: none;\n }\n .toggle,\n .top-link {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n margin: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n font: inherit;\n font-weight: 500;\n line-height: 1.5;\n text-align: start;\n text-decoration: none;\n cursor: pointer;\n }\n /* Chevron: a rotated border box, turned over when expanded. */\n .toggle::after {\n content: '';\n flex: none;\n inline-size: 0.5em;\n block-size: 0.5em;\n margin-inline-start: 0.75em;\n border-style: solid;\n border-color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n border-width: 0 1px 1px 0;\n transform: translateY(-0.15em) rotate(45deg);\n }\n .toggle[aria-expanded='true']::after {\n transform: translateY(0.15em) rotate(-135deg);\n }\n /* Grey for hover and the open group only, never for focus: the orange focus ring\n would fall below 3:1 against it. */\n .toggle:hover,\n .toggle[aria-expanded='true'],\n .top-link:hover {\n background-color: var(--uva-color-surface-hover, var(--uva-grey-100, #dadada));\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n .panel a {\n display: block;\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n font-weight: 400;\n text-decoration: underline;\n }\n .panel a:hover {\n background-color: var(--uva-color-surface-hover, var(--uva-grey-100, #dadada));\n text-decoration: none;\n }\n ${focusRules}\n /* Current page, and the group holding it: bold with a thick underline, not colour alone. */\n [aria-current]:not([aria-current='false']),\n .panel a[aria-current]:not([aria-current='false']):hover {\n font-weight: 700;\n text-decoration-line: underline;\n text-decoration-thickness: 3px;\n text-decoration-color: var(--uva-color-current, var(--uva-brand-orange, #e57200));\n text-underline-offset: 0.3em;\n }\n\n /* Bar: a full-width row with the brand-blue rule, content capped at 1600px. */\n .bar {\n border-bottom: 5px solid var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n background: var(--uva-color-surface-raised, #ffffff);\n }\n .bar > ul {\n display: flex;\n flex-wrap: wrap;\n box-sizing: border-box;\n max-inline-size: 1600px;\n margin-inline: auto;\n padding-inline: 16px;\n }\n .bar > ul > li {\n position: relative;\n display: flex;\n }\n .bar .toggle,\n .bar .top-link {\n padding: 11.5px 17px;\n }\n .bar .panel {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: 1000;\n box-sizing: border-box;\n inline-size: max-content;\n min-inline-size: 100%;\n max-inline-size: 20rem;\n background: var(--uva-color-surface-raised, #ffffff);\n border-radius: 0 0 4px 4px;\n box-shadow: 0 8px 16px var(--uva-color-shadow, rgba(0, 0, 0, 0.2));\n /* Invisible normally; forced colors paint it, so the panel keeps an edge. */\n outline: 1px solid transparent;\n }\n .bar .panel a {\n padding: 8.5px 17px;\n }\n\n /* Accordion (the header's narrow-screen Menu popover): full-width rows, panels in flow. */\n .accordion .toggle,\n .accordion .top-link {\n inline-size: 100%;\n justify-content: space-between;\n padding: 0.375rem 0.5rem;\n }\n .accordion .toggle::after {\n margin-inline-end: 0.25em;\n }\n .accordion .panel {\n position: static;\n padding-inline-start: 1rem;\n }\n .accordion .panel a {\n padding: 0.375rem 0.5rem;\n }\n\n /* Forced colors drop backgrounds and shadows: outline the open group and hovered\n controls instead. */\n @media (forced-colors: active) {\n .toggle[aria-expanded='true']:not(:focus-visible),\n .toggle:hover:not(:focus-visible),\n .top-link:hover:not(:focus-visible),\n .panel a:hover:not(:focus-visible) {\n outline: 1px solid CanvasText;\n outline-offset: -1px;\n }\n }\n `,\n ];\n\n /**\n * Light mode: the focus rules again, unlayered. A page's own accessibility sheet (which\n * `<site-page>` installs unlayered) would otherwise beat the layered component rules.\n */\n protected override installLightStyles(root?: Document | ShadowRoot): void {\n super.installLightStyles(root);\n installLightDomStyles(`${this.localName}-focus`, [lightFocusRules(this.localName)], {\n root,\n scope: false,\n layer: false,\n });\n }\n\n /** Accessible name of the navigation landmark. */\n @property({ type: String }) label = 'Main';\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n /** URL of JSON in the `MainNavItem[]` shape (needs CORS); the snapshot is shown until it loads, and if it fails. */\n @property({ type: String, attribute: 'items-src' }) itemsSrc?: string;\n /** `bar` (a row of buttons with floating panels) or `accordion` (stacked, panels in flow). */\n @property({ type: String }) layout: 'bar' | 'accordion' = 'bar';\n /**\n * The URL whose link is marked current. Default: the page location, followed through\n * same-document navigations (`popstate`, `hashchange`, and the Navigation API's\n * `currententrychange` where supported).\n */\n @property({ type: String }) current?: string;\n /**\n * The menu, replacing the bundled snapshot (but not `slot=\"main-nav\"` markup):\n * `{ label, href }` for a direct link, `{ label, items: [{ label, href }] }` for a group.\n * Unset or empty uses `items-src` or the snapshot.\n */\n @property({ attribute: false }) items?: MainNavItem[];\n\n /** Items from slotted markup, or null when there is none. */\n @state() private slotItems: MainNavItem[] | null = null;\n /** Items loaded from `items-src`. */\n @state() private fetched: MainNavItem[] | null = null;\n /** Index of the open group. */\n @state() private open: number | null = null;\n\n private propItems: MainNavItem[] | null = null;\n private fetchedFor?: string;\n /** The shown items last rendered, to close the open group when they change. */\n private shownKey?: string;\n private warned = new Set<string>();\n private observer?: MutationObserver;\n private holder?: HTMLDivElement;\n private readonly idBase = `main-nav-${++navCounter}`;\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Read the markup before the first render where it is already there (no second update);\n // the observer catches markup parsed or added later.\n this.syncSource();\n this.listenLocation(true);\n // Reconnected while a group was open: watch for outside presses again.\n this.listenOutside(this.open !== null && this.layout === 'bar');\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.listenOutside(false);\n this.listenLocation(false);\n }\n\n /** Same-document navigation: re-mark the current page when `current` is not set. */\n private onLocationChange = (): void => {\n if (!this.current) this.requestUpdate();\n };\n\n private locationTargets(): { target: EventTarget; type: string }[] {\n const win = this.ownerDocument.defaultView;\n if (!win) return [];\n const nav = (win as Window & { navigation?: EventTarget }).navigation;\n return [\n { target: win, type: 'popstate' },\n { target: win, type: 'hashchange' },\n ...(nav ? [{ target: nav, type: 'currententrychange' }] : []),\n ];\n }\n\n private listeningLocation = false;\n private listenLocation(on: boolean): void {\n if (on === this.listeningLocation) return;\n this.listeningLocation = on;\n for (const { target, type } of this.locationTargets()) {\n if (on) target.addEventListener(type, this.onLocationChange);\n else target.removeEventListener(type, this.onLocationChange);\n }\n }\n\n private warnOnce(kind: 'invalid' | 'flattened', what: string): void {\n if (this.warned.has(kind)) return;\n this.warned.add(kind);\n console.warn(\n kind === 'invalid'\n ? `${this.localName}: ignoring invalid ${what} entries (each needs a label, and an href or links).`\n : `${this.localName}: ${what} nests deeper than two levels; the deeper links are shown in their group.`,\n );\n }\n\n private use(result: NormalizeResult, what: string): MainNavItem[] | null {\n if (result.invalid) this.warnOnce('invalid', what);\n if (result.flattened) this.warnOnce('flattened', what);\n return result.items.length ? result.items : null;\n }\n\n /** Light mode: move `slot=\"main-nav\"` children into a hidden holder this element owns. */\n private adoptSource(): Element[] {\n const moved = [...this.children].filter(isSourceChild);\n if (moved.length && !this.holder) {\n this.holder = document.createElement('div');\n this.holder.hidden = true;\n this.holder.className = 'main-nav-source';\n }\n if (this.holder) {\n this.holder.append(...moved);\n if (this.holder.parentNode !== this) this.append(this.holder);\n }\n return this.holder ? [...this.holder.children] : [];\n }\n\n /** Read the `slot=\"main-nav\"` markup, render it, and watch it for changes. */\n private syncSource(): void {\n const sources = this.lightDom ? this.adoptSource() : [...this.children].filter(isSourceChild);\n let next: MainNavItem[] | null = null;\n if (sources.length) {\n const raw = sources.flatMap((s, i) => (i === 0 ? readItemsMarkup(s) : [{}]));\n next = this.use(normalizeItems(raw), 'slot=\"main-nav\"');\n }\n // Only a real change re-renders.\n if (JSON.stringify(next) !== JSON.stringify(this.slotItems)) this.slotItems = next;\n this.observer ??= new MutationObserver(() => this.syncSource());\n this.observer.disconnect();\n const content = {\n attributes: true,\n attributeFilter: SOURCE_ATTRS,\n characterData: true,\n childList: true,\n subtree: true,\n };\n if (this.lightDom) {\n this.observer.observe(this, { childList: true });\n if (this.holder) this.observer.observe(this.holder, content);\n } else {\n // Shadow mode: the host's children are only the source markup.\n this.observer.observe(this, content);\n }\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('items')) {\n this.propItems = this.items == null ? null : this.use(normalizeItems(this.items), 'items');\n }\n if (changed.has('itemsSrc') && this.fetchedFor !== this.itemsSrc) {\n this.fetched = null;\n this.fetchedFor = undefined;\n }\n const src = this.itemsSrc;\n // Fetch only when items-src is what would be shown. The result arrives asynchronously.\n if (src && !this.slotItems && !this.propItems && this.fetchedFor !== src) {\n this.fetchedFor = src;\n loadMainNavItems(src).then(\n (result) => {\n if (this.itemsSrc !== src) return;\n this.fetched = this.use(result, 'items-src');\n },\n (error: unknown) => {\n if (this.itemsSrc !== src) return;\n this.dispatchEvent(\n new CustomEvent('site-main-nav-error', {\n detail: { src, message: error instanceof Error ? error.message : String(error) },\n bubbles: true,\n composed: true,\n }),\n );\n },\n );\n }\n // A different menu: the open index would point at another group, so close it.\n const key = JSON.stringify(this.shown);\n if (this.shownKey !== undefined && key !== this.shownKey) this.open = null;\n this.shownKey = key;\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has('open') || changed.has('layout')) {\n this.listenOutside(this.isConnected && this.open !== null && this.layout === 'bar');\n }\n }\n\n /** The items shown, by precedence. */\n private get shown(): readonly MainNavItem[] {\n return this.slotItems ?? this.propItems ?? this.fetched ?? MAIN_NAV_SNAPSHOT;\n }\n\n // --- behaviour ----------------------------------------------------------------------\n\n private get navEl(): HTMLElement | null {\n return this.renderRoot.querySelector<HTMLElement>('nav.main-nav');\n }\n\n /** The top-level buttons and direct links, in order. */\n private get tops(): HTMLElement[] {\n const nav = this.navEl;\n return nav\n ? [...nav.querySelectorAll<HTMLElement>(':scope > ul > li > :is(.toggle, .top-link)')]\n : [];\n }\n\n private setOpen(index: number | null): void {\n this.open = index;\n }\n\n private onToggle(index: number): void {\n const opening = this.open !== index;\n this.setOpen(opening ? index : null);\n const label = this.shown[index]?.label;\n if (opening && label) trackEvent(this, ['site-main-nav', 'menu-open', label]);\n }\n\n private onOutsidePointer = (e: Event): void => {\n const nav = this.navEl;\n if (nav && !e.composedPath().includes(nav)) this.setOpen(null);\n };\n\n private listening = false;\n private listenOutside(on: boolean): void {\n if (on === this.listening) return;\n this.listening = on;\n const doc = this.ownerDocument;\n if (on) doc.addEventListener('pointerdown', this.onOutsidePointer, true);\n else doc.removeEventListener('pointerdown', this.onOutsidePointer, true);\n }\n\n private onFocusOut(e: FocusEvent): void {\n if (this.layout !== 'bar' || this.open === null) return;\n const to = e.relatedTarget as Node | null;\n // A null relatedTarget (a click on nothing focusable) is left to the pointerdown check.\n if (to && !this.navEl?.contains(to)) this.setOpen(null);\n }\n\n /** Arrow keys, Home and End over `nodes`, from `index` (as the live site's script does). */\n private move(e: KeyboardEvent, nodes: HTMLElement[], index: number): void {\n let to: number;\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n to = Math.max(0, index - 1);\n break;\n case 'ArrowDown':\n case 'ArrowRight':\n to = Math.min(nodes.length - 1, index + 1);\n break;\n case 'Home':\n to = 0;\n break;\n case 'End':\n to = nodes.length - 1;\n break;\n default:\n return;\n }\n e.preventDefault();\n nodes[to]?.focus();\n }\n\n private onKeyDown(e: KeyboardEvent): void {\n if (e.altKey || e.ctrlKey || e.metaKey) return;\n const target = e.target as HTMLElement;\n const tops = this.tops;\n const top = tops.indexOf(target);\n const open = this.open;\n const openButton = open === null ? null : this.toggleAt(open);\n if (top >= 0) {\n if (e.key === 'Escape') {\n if (open === null) return; // nothing to close: let a surrounding popover handle it\n e.preventDefault();\n this.setOpen(null);\n } else if (e.key === 'ArrowDown' && openButton === target) {\n e.preventDefault();\n this.panelOf(openButton)?.querySelector<HTMLElement>('a')?.focus();\n } else {\n this.move(e, tops, top);\n }\n return;\n }\n const panel = target.closest('.panel');\n if (!panel || !openButton || this.panelOf(openButton) !== panel) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n this.setOpen(null);\n openButton.focus();\n return;\n }\n const links = [...panel.querySelectorAll<HTMLElement>('a')];\n this.move(e, links, links.indexOf(target));\n }\n\n private toggleAt(index: number): HTMLElement | null {\n return (\n this.navEl?.querySelector<HTMLElement>(`[aria-controls=\"${this.panelId(index)}\"]`) ?? null\n );\n }\n\n /** A group button's panel: the list right after it, whose id it controls. */\n private panelOf(button: HTMLElement): HTMLElement | null {\n const next = button.nextElementSibling as HTMLElement | null;\n return next && next.id === button.getAttribute('aria-controls') ? next : null;\n }\n\n private panelId(index: number): string {\n return `${this.idBase}-${index}`;\n }\n\n // --- rendering ----------------------------------------------------------------------\n\n /** The one link to mark current: same host and path; then the same hash; then no hash. */\n private currentHref(hrefs: string[]): string | null {\n const here = this.current || this.ownerDocument.defaultView?.location.href || '';\n const base = this.ownerDocument.baseURI;\n const key = pageKey(here, base);\n if (!key) return null;\n const matches = hrefs.filter((h) => pageKey(h, base) === key);\n const hash = hashOf(here, base);\n return (\n matches.find((h) => hash && hashOf(h, base) === hash) ??\n matches.find((h) => !hashOf(h, base)) ??\n // Every match has a hash: with no hash of its own the page is theirs, so the first is\n // marked; a hash none of them has (a hash route the menu does not list) marks none.\n (hash ? null : matches[0]) ??\n null\n );\n }\n\n /** A link's href: fragment-only (`#…`) stays on this page; others go through siteLink. */\n private resolve(href: string): string {\n return href.startsWith('#') ? href : siteLink(this.rootLinkDomain, href);\n }\n\n /**\n * A plain click on a link closes the open group, so a single-page app that handles the\n * navigation in place does not leave the panel open. Modified clicks (a new tab or\n * window) keep it open.\n */\n private onClick(e: MouseEvent): void {\n const a = e.composedPath().find((n) => n instanceof HTMLAnchorElement);\n // Only the menu's own links (rendered here), never anything else on the click's path.\n if (a && this.renderRoot.contains(a)) {\n const text = (n: Node | null | undefined) =>\n (n?.textContent ?? '').replace(/\\s+/g, ' ').trim();\n // `Group > Link` for a link in a group, the link alone for a top-level one.\n const group = text(a.closest('.panel')?.previousElementSibling);\n const label = text(a);\n if (label)\n trackEvent(this, ['site-main-nav', 'link-click', group ? `${group} > ${label}` : label]);\n }\n if (this.open === null || e.button !== 0) return;\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n if (e.composedPath().some((n) => n instanceof Element && n.localName === 'a')) {\n this.setOpen(null);\n }\n }\n\n render() {\n const items = this.shown.map((item) => ({\n label: item.label,\n href: item.items ? undefined : this.resolve(item.href!),\n items: item.items?.map((l) => ({ label: l.label, href: this.resolve(l.href) })),\n }));\n const all = items.flatMap((i) => (i.items ? i.items.map((l) => l.href) : [i.href!]));\n const current = this.currentHref(all);\n const mark = (href: string) => (href === current ? 'page' : undefined);\n let marked = false;\n return html`<nav\n class=\"main-nav ${this.layout === 'accordion' ? 'accordion' : 'bar'}\"\n aria-label=${this.label}\n @keydown=${this.onKeyDown}\n @focusout=${this.onFocusOut}\n @click=${this.onClick}\n >\n <ul>\n ${items.map((item, i) => {\n if (!item.items) {\n const cur = !marked && mark(item.href!);\n if (cur) marked = true;\n return html`<li>\n <a class=\"top-link\" href=${item.href!} aria-current=${ifDefined(cur || undefined)}\n >${item.label}</a\n >\n </li>`;\n }\n const id = this.panelId(i);\n const expanded = this.open === i;\n const has = !marked && item.items.some((l) => l.href === current);\n let linkMarked = false;\n if (has) marked = true;\n return html`<li>\n <button\n type=\"button\"\n class=\"toggle\"\n aria-expanded=${expanded ? 'true' : 'false'}\n aria-controls=${id}\n aria-current=${ifDefined(has ? 'true' : undefined)}\n @click=${() => this.onToggle(i)}\n >\n ${item.label}\n </button>\n <ul class=\"panel\" id=${id} ?hidden=${!expanded}>\n ${item.items.map((l) => {\n const cur = has && !linkMarked && l.href === current;\n if (cur) linkMarked = true;\n return html`<li>\n <a href=${l.href} aria-current=${ifDefined(cur ? 'page' : undefined)}\n >${l.label}</a\n >\n </li>`;\n })}\n </ul>\n </li>`;\n })}\n </ul>\n </nav>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteMainNav } from './SiteMainNav.js';\n\ndefine('site-main-nav', SiteMainNav);\n"],"ignoreList":[0],"mappings":";;;;;AAKG,IAAMkB,KAAE,MAAGA,KAAGlB,GCsBXoB,KAAO,MAAwB,OAAOC,KAAM,WAAWA,EAAE,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK,IAAI;AAQ7F,SAAgBC,EAAe,GAA+B;CAC5D,IAAMC,IAAuB;EAAE,OAAO,CAAC;EAAG,SAAS;EAAO,WAAW;CAAM;CAC3E,IAAI,CAAC,MAAM,QAAQC,CAAG,GAEpB,OADA,EAAI,UAAUA,KAAO,MACdD;CAET,IAAME,KAAW,GAAkB,GAAqB,MAAwB;EAC9E,KAAK,IAAMnB,KAAKoB,GAAO;GACrB,IAAMR,IAAKZ,KAAK,CAAC,GACXqB,IAAQP,EAAIF,EAAE,KAAK,GACnBU,IAAOR,EAAIF,EAAE,IAAI,GACjBW,IAAO,MAAM,QAAQX,EAAE,KAAK,KAAKA,EAAE,MAAM,SAASA,EAAE,QAAQ;GAClE,AAAIW,KACF,EAAI,YAAY,IACZF,KAASC,KAAME,EAAK,KAAK;IAAE;IAAO;GAAK,CAAC,GAC5CL,EAAQI,GAAMC,GAAMC,IAAQ,CAAC,KACpBJ,KAASC,IAClBE,EAAK,KAAK;IAAE;IAAO;GAAK,CAAC,IAEzB,EAAI,UAAU;EAElB;CACF;CACA,KAAK,IAAMxB,KAAKkB,GAAK;EACnB,IAAMN,IAAKZ,KAAK,CAAC,GACXqB,IAAQP,EAAIF,EAAE,KAAK,GACnBU,IAAOR,EAAIF,EAA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