@uvalib/web-components 1.7.0 → 1.8.3

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +60 -15
  3. package/dist/base/states.d.ts +12 -0
  4. package/dist/base/states.js +33 -0
  5. package/dist/base/states.js.map +1 -0
  6. package/dist/base.css +69 -6
  7. package/dist/components/bento-box/BentoBox.js +1 -0
  8. package/dist/components/bento-box/BentoBox.js.map +1 -1
  9. package/dist/components/events-section/EventsSection.js +1 -0
  10. package/dist/components/events-section/EventsSection.js.map +1 -1
  11. package/dist/components/library-hours/hours-data.js +1 -1
  12. package/dist/components/library-hours/hours-data.js.map +1 -1
  13. package/dist/components/library-weekly-hours/LibraryWeeklyHours.js +1 -0
  14. package/dist/components/library-weekly-hours/LibraryWeeklyHours.js.map +1 -1
  15. package/dist/components/site-main-nav/SiteMainNav.d.ts +1 -1
  16. package/dist/components/site-main-nav/SiteMainNav.js +9 -2
  17. package/dist/components/site-main-nav/SiteMainNav.js.map +1 -1
  18. package/dist/components/site-page/SitePage.d.ts +1 -1
  19. package/dist/components/site-page/SitePage.js +3 -2
  20. package/dist/components/site-page/SitePage.js.map +1 -1
  21. package/dist/components/site-style/SiteStyle.d.ts +1 -1
  22. package/dist/components/site-style/SiteStyle.js +3 -2
  23. package/dist/components/site-style/SiteStyle.js.map +1 -1
  24. package/dist/components/uvalib-card/UvalibCard.js +6 -0
  25. package/dist/components/uvalib-card/UvalibCard.js.map +1 -1
  26. package/dist/components/uvalib-combobox/UvalibCombobox.d.ts +27 -0
  27. package/dist/components/uvalib-combobox/UvalibCombobox.js +85 -1
  28. package/dist/components/uvalib-combobox/UvalibCombobox.js.map +1 -1
  29. package/dist/components/uvalib-contents/UvalibContents.js +5 -0
  30. package/dist/components/uvalib-contents/UvalibContents.js.map +1 -1
  31. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.d.ts +6 -0
  32. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js +10 -0
  33. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js.map +1 -1
  34. package/dist/components/uvalib-image-regions/UvalibImageRegions.js +2 -0
  35. package/dist/components/uvalib-image-regions/UvalibImageRegions.js.map +1 -1
  36. package/dist/components/uvalib-image-regions/regions.d.ts +6 -2
  37. package/dist/components/uvalib-image-regions/regions.js +6 -3
  38. package/dist/components/uvalib-image-regions/regions.js.map +1 -1
  39. package/dist/components/uvalib-lightbox/UvalibLightbox.d.ts +9 -2
  40. package/dist/components/uvalib-lightbox/UvalibLightbox.js +23 -3
  41. package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -1
  42. package/dist/components/uvalib-lightbox/compare.d.ts +30 -3
  43. package/dist/components/uvalib-lightbox/compare.js +98 -29
  44. package/dist/components/uvalib-lightbox/compare.js.map +1 -1
  45. package/dist/components/uvalib-map/UvalibMap.js +2 -2
  46. package/dist/components/uvalib-map/UvalibMap.js.map +1 -1
  47. package/dist/components/uvalib-metadata/UvalibMetadata.js +3 -0
  48. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  49. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js +3 -1
  50. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js.map +1 -1
  51. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.d.ts +3 -3
  52. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js +16 -8
  53. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js.map +1 -1
  54. package/dist/components/uvalib-tag-list/UvalibTagList.d.ts +4 -1
  55. package/dist/components/uvalib-tag-list/UvalibTagList.js +9 -2
  56. package/dist/components/uvalib-tag-list/UvalibTagList.js.map +1 -1
  57. package/dist/custom-elements.json +1992 -1681
  58. package/dist/pagefind.css +8 -1
  59. package/dist/styles/base.js +8 -1
  60. package/dist/styles/base.js.map +1 -1
  61. package/dist/styles/font-fallback.d.ts +17 -0
  62. package/dist/styles/font-fallback.js +64 -0
  63. package/dist/styles/font-fallback.js.map +1 -0
  64. package/dist/styles/message.js +4 -0
  65. package/dist/styles/message.js.map +1 -1
  66. package/dist/styles/pagefind.js +8 -1
  67. package/dist/styles/pagefind.js.map +1 -1
  68. package/dist/styles/result-list.js +25 -4
  69. package/dist/styles/result-list.js.map +1 -1
  70. package/dist/styles/results.js +17 -2
  71. package/dist/styles/results.js.map +1 -1
  72. package/dist/styles/tokens.js +1 -1
  73. package/dist/tokens.css +47 -1
  74. package/dist-cdn/base.css +69 -6
  75. package/dist-cdn/bento-box.js +1 -0
  76. package/dist-cdn/bento-box.js.map +1 -1
  77. package/dist-cdn/chunks/{base-BI8h0Gf3.js → base-CIX_-Rmo.js} +58 -6
  78. package/dist-cdn/chunks/base-CIX_-Rmo.js.map +1 -0
  79. package/dist-cdn/chunks/{compare-DV6ltvsJ.js → compare-C0nhByn7.js} +66 -29
  80. package/dist-cdn/chunks/compare-C0nhByn7.js.map +1 -0
  81. package/dist-cdn/chunks/{hours-data-Bw6vkIw7.js → hours-data-gMu5uT7H.js} +2 -2
  82. package/dist-cdn/chunks/hours-data-gMu5uT7H.js.map +1 -0
  83. package/dist-cdn/chunks/{library-weekly-hours-CrV3TlP5.js → library-weekly-hours-BJgxAyah.js} +3 -2
  84. package/dist-cdn/chunks/library-weekly-hours-BJgxAyah.js.map +1 -0
  85. package/dist-cdn/chunks/{regions-B8ExwUGP.js → regions-B-rOwa-v.js} +15 -15
  86. package/dist-cdn/chunks/regions-B-rOwa-v.js.map +1 -0
  87. package/dist-cdn/chunks/{site-header-DYRMpdBj.js → site-header-CEmNtmk5.js} +2 -2
  88. package/dist-cdn/chunks/{site-header-DYRMpdBj.js.map → site-header-CEmNtmk5.js.map} +1 -1
  89. package/dist-cdn/chunks/{site-main-nav-DURrQMal.js → site-main-nav-CAwKq_x5.js} +9 -2
  90. package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +1 -0
  91. package/dist-cdn/chunks/states-DGXGzcte.js +17 -0
  92. package/dist-cdn/chunks/states-DGXGzcte.js.map +1 -0
  93. package/dist-cdn/custom-elements.json +1992 -1681
  94. package/dist-cdn/events-section.js +1 -0
  95. package/dist-cdn/events-section.js.map +1 -1
  96. package/dist-cdn/library-hours-setup.js +1 -1
  97. package/dist-cdn/library-weekly-hours.js +1 -1
  98. package/dist-cdn/manifest.json +1 -1
  99. package/dist-cdn/pagefind.css +8 -1
  100. package/dist-cdn/site-header.js +1 -1
  101. package/dist-cdn/site-hours-section.js +1 -1
  102. package/dist-cdn/site-main-nav.js +1 -1
  103. package/dist-cdn/site-page.js +50 -46
  104. package/dist-cdn/site-page.js.map +1 -1
  105. package/dist-cdn/site-style.js +6 -6
  106. package/dist-cdn/site-style.js.map +1 -1
  107. package/dist-cdn/skills/uvalib-web-components/SKILL.md +6 -5
  108. package/dist-cdn/skills/uvalib-web-components/reference/components.md +36 -9
  109. package/dist-cdn/tokens.css +47 -1
  110. package/dist-cdn/uvalib-card.js +6 -0
  111. package/dist-cdn/uvalib-card.js.map +1 -1
  112. package/dist-cdn/uvalib-combobox.js +107 -68
  113. package/dist-cdn/uvalib-combobox.js.map +1 -1
  114. package/dist-cdn/uvalib-contents.js +5 -0
  115. package/dist-cdn/uvalib-contents.js.map +1 -1
  116. package/dist-cdn/uvalib-filter-drawer.js +27 -25
  117. package/dist-cdn/uvalib-filter-drawer.js.map +1 -1
  118. package/dist-cdn/uvalib-image-regions.js +3 -1
  119. package/dist-cdn/uvalib-image-regions.js.map +1 -1
  120. package/dist-cdn/uvalib-lightbox.js +80 -69
  121. package/dist-cdn/uvalib-lightbox.js.map +1 -1
  122. package/dist-cdn/uvalib-map.js +2 -2
  123. package/dist-cdn/uvalib-map.js.map +1 -1
  124. package/dist-cdn/uvalib-metadata.js +3 -0
  125. package/dist-cdn/uvalib-metadata.js.map +1 -1
  126. package/dist-cdn/uvalib-pagefind-search.js +2 -1
  127. package/dist-cdn/uvalib-pagefind-search.js.map +1 -1
  128. package/dist-cdn/uvalib-photo-grid.js +4 -5
  129. package/dist-cdn/uvalib-photo-grid.js.map +1 -1
  130. package/dist-cdn/uvalib-tag-list.js +21 -16
  131. package/dist-cdn/uvalib-tag-list.js.map +1 -1
  132. package/package.json +1 -1
  133. package/skills/uvalib-web-components/SKILL.md +6 -5
  134. package/skills/uvalib-web-components/reference/components.md +36 -9
  135. package/dist-cdn/chunks/base-BI8h0Gf3.js.map +0 -1
  136. package/dist-cdn/chunks/compare-DV6ltvsJ.js.map +0 -1
  137. package/dist-cdn/chunks/hours-data-Bw6vkIw7.js.map +0 -1
  138. package/dist-cdn/chunks/library-weekly-hours-CrV3TlP5.js.map +0 -1
  139. package/dist-cdn/chunks/regions-B8ExwUGP.js.map +0 -1
  140. package/dist-cdn/chunks/site-main-nav-DURrQMal.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"site-page.js","names":["ifDefined","nothing","_decorate","property","state","n","i","r","b","define","__decorate","installLightDomStyles","UvalibElement","o","base","tokens","TYPEKIT_URL","accessible","ColorSchemeController","trackEvent","bufferAnalytics","loadAlerts","isAlertsEnv","alertsBase","ALERTS_PRODUCTION_SRC","ALERTS_UI","ALERTS_LIST_LABEL","slotOf","SitePage","_args","c","main","doc","name","value","link","count","changed","err","id","a","buffer","header","make","show","top","list","band","regional","content","records","el","ref","next","footer","nodes","slot","light","skip","alerts","alert","A"],"sources":["../src/components/site-page/SitePage.ts","../src/components/site-page/site-page.ts"],"sourcesContent":["import { html, css, nothing, type PropertyValues } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, state } 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, TYPEKIT_URL } from '../../styles/base.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { ColorSchemeController } from '../../base/color-scheme.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { bufferAnalytics } from '../../base/analytics-state.js';\nimport {\n ALERTS_PRODUCTION_SRC,\n alertsBase,\n isAlertsEnv,\n loadAlerts,\n} from '../site-alerts/alerts.js';\n\nexport { ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC } from '../site-alerts/alerts.js';\nexport type { AlertsEnv } from '../site-alerts/alerts.js';\n\n/** The `<site-alerts>` elements' `show` values: header banner, alert list, regional alerts. */\ntype AlertShow = 'header' | 'list' | 'regional';\nconst ALERTS_UI = 'site-alerts';\n/** Accessible name of the list band region. */\nconst ALERTS_LIST_LABEL = 'Library alerts';\n\nconst slotOf = (n: Node): string | null => (n instanceof Element ? n.getAttribute('slot') : null);\n\n/**\n * Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles.\n * Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`.\n *\n * The header shows the UVA Library main navigation by default (`no-main-nav` turns it off;\n * `header-variant=\"vendor\"` never shows it).\n *\n * Shows live UVA Library alerts by default with `<site-alerts>` (its code loads only then),\n * placed as Virgo places them: a full-bleed `<site-alerts show=\"header\">` banner at the top\n * of the header landmark (after the skip link), a full-bleed band between the header and\n * `<main>` holding `<site-alerts show=\"list\">` (a `<section aria-label=\"Library alerts\">`\n * region, hidden while the list has nothing to show), and `<site-alerts show=\"regional\">` as\n * the first child of `<main>`, inside its padding. Their data comes from one headless\n * `<uvalib-alerts>`, loaded once per document, with a module script, from the alerts CDN\n * (`alerts-env`, or `alerts-src`); if it fails to load, one console warning is logged and\n * the page works as before. `no-alerts` renders no alert elements and loads nothing.\n *\n * A `slot=\"breadcrumbs\"` child (a `<uvalib-breadcrumbs>`) is placed where library.virginia.edu\n * puts the trail: after the header and the alert list band, before `<main>` and outside it (so\n * the skip link lands past it), with the same gutters as `<main>`.\n *\n * Printing leaves out the chrome: the skip link, header (with the main navigation and the\n * header alert), alert list band, regional alerts, breadcrumbs, pre-footer and footer are not\n * printed, `<main>` loses its gutters, and the content prints black on white (a dark scheme\n * prints light), its links underlined. A short line above the content says where the page\n * came from (\"UVA Library — <site name or page title>\" and the page's URL). `print-chrome`\n * prints the page as it is shown instead. With `no-style` none of this applies.\n *\n * @tagname site-page\n * @slot - Main page content, rendered inside the single `<main>`.\n * @slot breadcrumbs - Optional breadcrumb trail (a `<uvalib-breadcrumbs>`), shown between the header (and alert list band) and `<main>`. In light mode it is moved there, never into `<main>`.\n * @slot pre-footer - Optional content shown in a band above the footer.\n * @slot site-links - Optional `<a href>` elements, forwarded to `<site-header>`, that replace the library utility links in the header (inline nav and Menu popover). Ignored with `header-variant=\"vendor\"`.\n * @slot main-nav - Optional `<nav>` forwarded to `<site-header>`, whose list replaces the UVA Library main navigation's links (see `<site-main-nav>`). Ignored with `no-main-nav` and `header-variant=\"vendor\"`.\n * @csspart main - The `<main>` landmark.\n * @csspart header - The `<header>` element inside `<site-header>` (shadow mode; exported through `exportparts`).\n * @csspart footer - The `<footer>` element inside `<site-footer>` (shadow mode; exported through `exportparts`).\n * @cssprop [--uva-brand-blue=#232d4b] - Skip link background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour (focus-visible outline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Page font family (global styles).\n * @cssprop [--uva-font-size-base=17px] - Page base font size (global styles).\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Page text colour (global styles).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (global styles; else none).\n * @cssprop --uva-color-text - Dark-mode role token: page text (global styles; else `--uva-grey-darkest`).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: skip-link background (else `--uva-brand-blue`).\n * @cssprop --uva-color-on-accent - Dark-mode role token: skip-link text (else #fff).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n */\nexport class SitePage extends UvalibElement {\n /** The page's content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n @property({ type: String, attribute: 'header-variant' }) headerVariant: 'full' | 'vendor' =\n 'full';\n @property({ type: Boolean, attribute: 'no-global-styles' }) noGlobalStyles = false;\n /**\n * Hide the footer (and any pre-footer band), for tools and app-like pages where the site\n * footer does not belong. The footer is kept hidden rather than removed, so toggling the\n * attribute keeps pre-footer content.\n */\n @property({ type: Boolean, attribute: 'no-footer', reflect: true }) noFooter = false;\n /**\n * Print the header, alerts, breadcrumbs and footer too. By default printing leaves them out\n * and prints only `<main>`, black on white.\n */\n @property({ type: Boolean, attribute: 'print-chrome', reflect: true }) printChrome = false;\n /** Accessible name of the header navigation when site links are given (default \"Site\"). */\n @property({ type: String, attribute: 'site-links-label' }) siteLinksLabel?: string;\n /** The sub-site's name, forwarded to `<site-header site-name>`: shown after the logo as a link to the site's home. */\n @property({ type: String, attribute: 'site-name' }) siteName?: string;\n /** Where the site name links, forwarded to `<site-header site-name-href>` (default `/`). */\n @property({ type: String, attribute: 'site-name-href' }) siteNameHref?: string;\n /** Hide the UVA Library main navigation in the header. */\n @property({ type: Boolean, attribute: 'no-main-nav' }) noMainNav = false;\n /** Accessible name of the header's main navigation (default \"Main\"). */\n @property({ type: String, attribute: 'main-nav-label' }) mainNavLabel?: string;\n /** URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. */\n @property({ type: String, attribute: 'main-nav-src' }) mainNavSrc?: string;\n /**\n * The URL whose main-navigation link is marked current, forwarded to `<site-header\n * main-nav-current>`. Default: the page location, followed through same-document\n * navigations; set it when a single-page app's route is not its URL.\n */\n @property({ type: String, attribute: 'main-nav-current' }) mainNavCurrent?: string;\n /**\n * Alerts environment: `production` (default) or `staging`. Any other value logs one\n * console warning and uses production. Ignored when `alerts-src` is set.\n */\n @property({ type: String, attribute: 'alerts-env' }) alertsEnv = 'production';\n /**\n * Alerts base URL (holding `config.json`, `alerts.json` and `v1/uvalib-alerts.js`); overrides\n * `alerts-env`. For a custom domain, local development and tests.\n */\n @property({ type: String, attribute: 'alerts-src' }) alertsSrc?: string;\n /** Render no alert elements and load no alerts script. */\n @property({ type: Boolean, attribute: 'no-alerts' }) noAlerts = false;\n /**\n * Opt in to dark mode, forwarded to `<site-header color-scheme-switch>`: the page follows\n * the OS preference, and a Light / Dark / System control in the header lets the visitor\n * override it (remembered per site). Off by default: the page is always light. The page's\n * own content must support it (see the README's \"Dark mode\").\n */\n @property({ type: Boolean, attribute: 'color-scheme-switch' }) colorSchemeSwitch = false;\n /**\n * Opt in to Matomo analytics: the site's Matomo id. The page then adds one\n * `<site-analytics>` for it (loading its code only then), which records the page view and\n * what the library's components report (see the README's \"Analytics\"). Off by default. With\n * an analytics element or a Matomo snippet already on the page nothing is counted twice.\n */\n @property({ type: Number, attribute: 'matomo-id' }) matomoId?: number;\n /** The Matomo server for `matomo-id`, ending in `/` (default: the library's). */\n @property({ type: String, attribute: 'matomo-url' }) matomoUrl?: string;\n /**\n * `event`: the `<site-analytics downloads=\"event\">` option for `matomo-id`, counting\n * downloads as `['download', '<extension>']` events without their URLs.\n */\n @property({ type: String, attribute: 'matomo-downloads' }) matomoDownloads?: string;\n\n /**\n * Sets the stored scheme on <html> as soon as the page connects, before the header renders,\n * so pages without the inline snippet flash as little as possible; without the switch it\n * removes a stray attribute. It renders nothing itself.\n */\n private readonly scheme = new ColorSchemeController(\n this,\n () => this.colorSchemeSwitch,\n () => this.noStyle,\n false,\n );\n\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n }\n site-header,\n site-footer,\n main {\n display: block;\n width: 100%;\n }\n site-footer[hidden] {\n display: none;\n }\n /* Virgo's alert list: a full-bleed band flush under the header, above main's padding. */\n .alerts-list {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n .alerts-list[hidden] {\n display: none;\n }\n .alerts-list > site-alerts {\n display: block;\n }\n /* The breadcrumb trail lines up with main's content (same max width and side padding). */\n ::slotted([slot='breadcrumbs']) {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* An empty or hidden trail takes no space. */\n ::slotted([slot='breadcrumbs']:is([hidden], [data-empty])) {\n display: none;\n }\n /* Light mode (this stylesheet is rewritten to \\`site-page > …\\` there). */\n :host > [slot='breadcrumbs']:is([hidden], [data-empty]) {\n display: none;\n }\n :host > [slot='breadcrumbs'] {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* Old layout: .main-container-inner (max 1600px, centred) > .w3-row-padding 8px\n > .w3-col 8px > .d8-fade 24px = 40px each side; 12px margin + 24px padding below. */\n main {\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 36px 40px;\n }\n @media screen and (min-width: 993px) {\n main {\n padding-top: 24px; /* old: .breadcrumb-found dropped its 12px top margin */\n }\n }\n /* Print (issue #20): only <main>, black on white, unless print-chrome. In shadow mode\n the breadcrumbs slot is hidden, which hides what is assigned to it; in light mode\n (rewritten to site-page …) the trail is a direct child. The pre-footer is in the\n footer. The base styles underline the content's links and print a dark scheme light. */\n @media print {\n :host(:not([print-chrome])) {\n color: #000;\n background: #fff;\n }\n :host(:not([print-chrome])) :is(site-header, site-footer, .alerts-list, .skip-link),\n :host(:not([print-chrome])) main > site-alerts,\n :host(:not([print-chrome])) slot[name='breadcrumbs'],\n :host(:not([print-chrome])) > [slot='breadcrumbs'] {\n display: none;\n }\n :host(:not([print-chrome])) main {\n max-width: none;\n padding: 0;\n }\n /* Where the page came from: a line above the content, from --uvalib-print-source\n (set on <main>: \"UVA Library — <site name or title> <URL>\"). Print only, so never\n read out on screen. */\n :host(:not([print-chrome])) main::before {\n content: var(--uvalib-print-source, none);\n display: block;\n margin: 0 0 1rem;\n padding: 0 0 0.25rem;\n border-bottom: 1px solid #000;\n color: #000;\n font-size: 0.875rem;\n overflow-wrap: anywhere;\n }\n }\n `,\n ];\n\n /** Light mode: nodes this element rendered itself (incl. Lit markers), never routed. */\n private chrome = new WeakSet<Node>();\n private observer?: MutationObserver;\n private globalsInstalled = false;\n /** The alerts base URL in use, from `alerts-src` or `alerts-env`. */\n private alertsUrl = ALERTS_PRODUCTION_SRC;\n /** Light mode: the alert elements this element created, and the list band. */\n private lightAlerts?: {\n top: HTMLElement;\n band: HTMLElement;\n list: HTMLElement;\n regional: HTMLElement;\n };\n /** The `<site-analytics>` this element added for `matomo-id`. */\n private analytics?: HTMLElement;\n /** Whether this element asked for `<site-alerts>`' code. */\n private alertsUiRequested = false;\n /** Whether the list alerts have anything to show, from their last update event. */\n @state() private listShown = false;\n /**\n * Shadow mode: whether a `slot=\"breadcrumbs\"` child exists, so the slot is rendered only\n * then and the page without breadcrumbs renders exactly what it did before them.\n */\n @state() private hasBreadcrumbs = false;\n private breadcrumbsObserver?: MutationObserver;\n\n private syncHasBreadcrumbs = (): void => {\n this.hasBreadcrumbs = [...this.children].some((c) => slotOf(c) === 'breadcrumbs');\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.lightDom) {\n this.syncHasBreadcrumbs();\n this.breadcrumbsObserver ??= new MutationObserver(this.syncHasBreadcrumbs);\n this.breadcrumbsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n this.ownerDocument.defaultView?.addEventListener('beforeprint', this.syncPrintSource);\n if (!this.noGlobalStyles && !this.globalsInstalled) {\n this.globalsInstalled = true;\n this.installGlobalStyles(this.ownerDocument);\n }\n // Reconnect after a disconnect; the first connect starts routing in update().\n if (this.lightDom && this.hasUpdated) {\n this.route(this.childNodes);\n this.observe();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.breadcrumbsObserver?.disconnect();\n this.ownerDocument.defaultView?.removeEventListener('beforeprint', this.syncPrintSource);\n }\n\n /**\n * The printed \"where from\" line, as a CSS string on <main> (`--uvalib-print-source`), read\n * by the print styles. Set on each update and again just before printing, so a single-page\n * app prints its current title and URL.\n */\n private syncPrintSource = (): void => {\n const main = this.renderRoot.querySelector<HTMLElement>(\n this.lightDom ? ':scope > main' : 'main',\n );\n if (!main) return;\n const doc = this.ownerDocument;\n const name = (this.siteName || doc.title || '').trim();\n const text = `UVA Library${name ? ` — ${name}` : ''} ${doc.defaultView?.location.href ?? ''}`;\n const value = `\"${text\n .trim()\n .replace(/[\\\\\"]/g, '\\\\$&')\n .replace(/[\\n\\r\\f]/g, ' ')}\"`;\n if (main.style.getPropertyValue('--uvalib-print-source') !== value)\n main.style.setProperty('--uvalib-print-source', value);\n };\n\n private installGlobalStyles(doc: Document): void {\n // Tokens stay layered so a host's own `:root { --uva-*: … }` wins; base and accessibility\n // rules are unlayered so they beat host resets.\n installLightDomStyles('uvalib-tokens', [tokens], { root: doc, scope: false });\n installLightDomStyles('uvalib-global', [base, accessible], {\n root: doc,\n scope: false,\n layer: false,\n });\n if (!doc.head.querySelector(`link[href=\"${TYPEKIT_URL}\"]`)) {\n const link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.href = TYPEKIT_URL;\n doc.head.append(link);\n }\n }\n\n /** The list element's `site-alerts-change`: show the band only while it lists alerts. */\n private onListChange(e: Event): void {\n if (e.target !== e.currentTarget) return;\n const count = (e as CustomEvent<{ count?: unknown }>).detail?.count;\n this.listShown = typeof count === 'number' && count > 0;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('colorSchemeSwitch')) this.scheme.sync();\n if (changed.has('noAlerts') && this.noAlerts) this.listShown = false;\n if (changed.has('alertsEnv') && this.alertsEnv && !isAlertsEnv(this.alertsEnv)) {\n console.warn(\n `${this.localName}: unknown alerts-env \"${this.alertsEnv}\"; using production. Valid values: production, staging.`,\n );\n }\n try {\n this.alertsUrl = alertsBase(this.alertsEnv, this.alertsSrc, this.ownerDocument.baseURI);\n } catch {\n if (changed.has('alertsSrc')) {\n console.warn(\n `${this.localName}: alerts-src \"${this.alertsSrc}\" is not a URL; ignoring it.`,\n );\n }\n this.alertsUrl = alertsBase(this.alertsEnv, null, this.ownerDocument.baseURI);\n }\n }\n\n protected override updated(): void {\n if (this.lightDom) this.syncLightAlerts();\n this.syncPrintSource();\n if (!this.noAlerts) {\n // The alerts script starts loading at once, alongside <site-alerts>' own code.\n loadAlerts(this.ownerDocument, this.alertsUrl);\n this.defineAlerts();\n }\n this.syncAnalytics();\n }\n\n /** Loads `<site-alerts>` (and registers it) on first use of the alerts. */\n protected loadAlertsUi(): Promise<unknown> {\n return import('../site-alerts/site-alerts.js');\n }\n\n private defineAlerts(): void {\n if (this.alertsUiRequested || customElements.get(ALERTS_UI)) return;\n this.alertsUiRequested = true;\n this.loadAlertsUi().catch((err) =>\n console.error(`${this.localName}: failed to load site-alerts`, err),\n );\n }\n\n /** Loads `<site-analytics>` (and registers it) on first use of `matomo-id`. */\n protected loadAnalytics(): Promise<unknown> {\n return import('../site-analytics/site-analytics.js');\n }\n\n /**\n * `matomo-id`: one `<site-analytics>`, at the very start of the render root, before Lit's\n * markers, so no render ever clears it and (being chrome) light DOM routing never moves it.\n * The element's own one-tracker guard keeps a second element or snippet from double-counting.\n */\n private syncAnalytics(): void {\n const id = Number(this.matomoId);\n if (!(id > 0)) {\n this.analytics?.remove();\n this.analytics = undefined;\n return;\n }\n if (!this.analytics) {\n // An analytics element the page has already (say the old v0.0.12 <uvalib-analytics>,\n // which does not share the one-tracker guard) records the page: don't add a second.\n if (this.ownerDocument.querySelector('site-analytics, uvalib-analytics')) return;\n const a = (this.analytics = this.ownerDocument.createElement('site-analytics'));\n this.chrome.add(a);\n if (!customElements.get('site-analytics')) {\n // Until the code arrives nothing forwards: keep what the components report meanwhile\n // (a bento search can settle first) and hand it over once the element is running.\n const buffer = bufferAnalytics(this.ownerDocument);\n this.loadAnalytics()\n .then(() => customElements.whenDefined('site-analytics'))\n .then(() => (a as HTMLElement & { updateComplete?: Promise<unknown> }).updateComplete)\n .then(\n () => buffer.flush(),\n (err) => {\n buffer.drop();\n console.error(`${this.localName}: failed to load site-analytics`, err);\n },\n );\n }\n }\n const a = this.analytics;\n if (a.getAttribute('matomoid') !== String(id)) a.setAttribute('matomoid', String(id));\n if (this.matomoUrl) a.setAttribute('matomourl', this.matomoUrl);\n else a.removeAttribute('matomourl');\n if (this.matomoDownloads) a.setAttribute('downloads', this.matomoDownloads);\n else a.removeAttribute('downloads');\n if (a.parentNode !== this.renderRoot) this.renderRoot.prepend(a);\n }\n\n /**\n * Light mode keeps <main> free of Lit parts, so the alert elements are managed here: the\n * header one is handed to <site-header> as a `slot=\"alerts\"` child (it moves it into its\n * <header>), the list band goes right after <site-header>, and regional stays the first\n * child of <main>. The band and the elements are chrome, so route() never moves them.\n */\n private syncLightAlerts(): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header) return;\n if (this.noAlerts) {\n const a = this.lightAlerts;\n for (const n of a ? [a.top, a.band, a.regional] : []) n.remove();\n this.lightAlerts = undefined;\n return;\n }\n if (!this.lightAlerts) {\n const doc = this.ownerDocument;\n const make = (show: AlertShow) => {\n const a = doc.createElement(ALERTS_UI);\n a.setAttribute('show', show);\n a.setAttribute('no-shadow-dom', '');\n this.chrome.add(a);\n return a;\n };\n const top = make('header');\n top.slot = 'alerts';\n const list = make('list');\n list.addEventListener('site-alerts-change', (e) => this.onListChange(e));\n const band = doc.createElement('section');\n band.className = 'alerts-list';\n band.setAttribute('aria-label', ALERTS_LIST_LABEL);\n band.append(list);\n this.chrome.add(band);\n this.lightAlerts = { top, band, list, regional: make('regional') };\n }\n const { top, band, list, regional } = this.lightAlerts;\n for (const a of [top, list, regional]) {\n if (a.getAttribute('alerts-src') !== this.alertsUrl)\n a.setAttribute('alerts-src', this.alertsUrl);\n a.toggleAttribute('no-style', this.noStyle);\n }\n band.hidden = !this.listShown;\n if (!header.contains(top)) header.append(top);\n // Directly after <site-header>, before any Lit marker, so no part ever clears it.\n if (header.nextSibling !== band) header.after(band);\n if (main.firstChild !== regional) main.prepend(regional);\n }\n\n protected override update(changed: PropertyValues): void {\n if (this.hasUpdated || !this.lightDom) {\n super.update(changed);\n return;\n }\n const content = [...this.childNodes];\n super.update(changed); // first render appends the chrome after the content\n for (const n of this.childNodes) if (!content.includes(n)) this.chrome.add(n);\n this.route(content);\n this.observe();\n }\n\n private observe(): void {\n this.observer ??= new MutationObserver((records) => {\n for (const r of records) {\n if (r.type === 'attributes') this.reslot(r.target as Element);\n else if (r.target === this) this.route(r.addedNodes);\n }\n });\n // One call: observing the same node again would replace these options. Children added to\n // the page are routed; a content node given slot=\"breadcrumbs\" later (or losing it) moves\n // out of (or back into) <main>.\n this.observer.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n /** Light mode: a top-level content node's `slot` changed to or from `breadcrumbs`. */\n private reslot(el: Element): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header || this.chrome.has(el)) return;\n if (el.parentNode === main && slotOf(el) === 'breadcrumbs') this.placeBreadcrumbs(el, header);\n else if (\n el.parentNode === this &&\n slotOf(el) !== 'breadcrumbs' &&\n main.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING\n )\n main.append(el);\n }\n\n /**\n * Light mode: a `slot=\"breadcrumbs\"` node goes after the header, the alert list band and any\n * breadcrumbs already there, before Lit's markers (so no render clears it) and `<main>`.\n */\n private placeBreadcrumbs(n: Node, header: Element): void {\n let ref: Node = header;\n for (let next = ref.nextSibling; next; next = ref.nextSibling) {\n if (next !== this.lightAlerts?.band && slotOf(next) !== 'breadcrumbs') break;\n if (next === n) return; // already in place\n ref = next;\n }\n (ref as ChildNode).after(n);\n }\n\n /**\n * Light mode has no slots: move content into `<main>`, pre-footer nodes to the footer,\n * site links and main-nav markup to the header and breadcrumbs before `<main>`.\n */\n private route(nodes: Iterable<Node>): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n const footer = this.querySelector(':scope > site-footer');\n if (!main || !header || !footer) return;\n for (const n of [...nodes]) {\n if (n.parentNode !== this || this.chrome.has(n)) continue;\n if (n.nodeType === Node.TEXT_NODE && !n.textContent?.trim()) continue;\n // The header and footer adopt their own slotted children, even before they upgrade.\n const slot = slotOf(n);\n if (slot === 'breadcrumbs') {\n this.placeBreadcrumbs(n, header);\n continue;\n }\n const to =\n slot === 'pre-footer'\n ? footer\n : slot === 'site-links' || slot === 'main-nav'\n ? header\n : main;\n to.append(n);\n }\n }\n\n private onSkip(e: Event): void {\n e.preventDefault();\n // Shadow mode: the link is in <site-header>'s skip-link slot, and the header reports it.\n if (this.lightDom) trackEvent(this, ['site-header', 'skip-link']);\n this.renderRoot.querySelector<HTMLElement>('main')?.focus();\n }\n\n protected override render() {\n const light = this.lightDom;\n // Light mode keeps <main> and <site-footer> free of Lit parts so moved content is never cleared.\n const skip = html`<a\n class=\"skip-link\"\n href=\"#main-content\"\n slot=${ifDefined(light ? undefined : 'skip-link')}\n @click=${this.onSkip}\n >Skip to main content</a\n >`;\n // Shadow mode: the link is slotted into <site-header>'s <header> landmark, because axe\n // looks the #main-content target up on the document and cannot see it in this shadow root,\n // so it would flag a skip link that sits outside every landmark (\"region\").\n // Light mode: the link stays the first child, where the target resolves.\n const alerts = !this.noAlerts && !light;\n const alert = (show: AlertShow) =>\n html`<site-alerts\n slot=${ifDefined(show === 'header' ? 'alerts' : undefined)}\n show=${show}\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n ></site-alerts>`;\n // Shadow mode's list band; light mode builds the same in syncLightAlerts().\n const band = html`<section\n class=\"alerts-list\"\n aria-label=${ALERTS_LIST_LABEL}\n ?hidden=${!this.listShown}\n >\n <site-alerts\n show=\"list\"\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n @site-alerts-change=${this.onListChange}\n ></site-alerts>\n </section>`;\n return html`\n ${light ? skip : nothing}\n <site-header\n exportparts=\"header\"\n ?no-shadow-dom=${light}\n ?no-style=${this.noStyle}\n variant=${this.headerVariant}\n root-link-domain=${this.rootLinkDomain}\n site-links-label=${ifDefined(this.siteLinksLabel)}\n site-name=${ifDefined(this.siteName)}\n site-name-href=${ifDefined(this.siteNameHref)}\n ?no-main-nav=${this.noMainNav}\n main-nav-label=${ifDefined(this.mainNavLabel)}\n main-nav-src=${ifDefined(this.mainNavSrc)}\n main-nav-current=${ifDefined(this.mainNavCurrent)}\n ?color-scheme-switch=${this.colorSchemeSwitch}\n >${\n light\n ? nothing\n : html`${skip}${alerts ? alert('header') : nothing}<slot\n name=\"site-links\"\n slot=\"site-links\"\n ></slot\n ><slot name=\"main-nav\" slot=\"main-nav\"></slot>`\n }</site-header\n >\n ${alerts ? band : nothing}\n ${!light && this.hasBreadcrumbs ? html`<slot name=\"breadcrumbs\"></slot>` : nothing}\n ${\n light\n ? html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\"></main>`\n : html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\">\n ${alerts ? alert('regional') : nothing}<slot></slot>\n </main>`\n }\n ${\n light\n ? html`<site-footer\n no-shadow-dom\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ></site-footer>`\n : html`<site-footer\n exportparts=\"footer\"\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ><slot name=\"pre-footer\" slot=\"pre-footer\"></slot\n ></site-footer>`\n }\n `;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SitePage } from './SitePage.js';\nimport '../site-header/site-header.js';\n// The footer sits at the bottom of the page, so it loads asynchronously.\nimport('../site-footer/site-footer.js').catch((err) =>\n console.error('site-page: failed to load site-footer', err),\n);\n\ndefine('site-page', SitePage);\n"],"mappings":";;;;;;;;;AAuBA,IAAMyB,IAAY,eAEZC,IAAoB,kBAEpBC,KAAU,MAA4BtB,aAAa,UAAUA,EAAE,aAAa,MAAM,IAAI,MAkD/EuB,IAAb,cAA8BhB,EAAc;;EAyPJ,A,aArPpC,KAAA,iBAAA,oC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Defined","nothing","_decorate","property","state","n","i","r","b","define","__decorate","installLightDomStyles","UvalibElement","o","fontFallback","base","tokens","TYPEKIT_URL","accessible","ColorSchemeController","trackEvent","bufferAnalytics","loadAlerts","isAlertsEnv","alertsBase","ALERTS_PRODUCTION_SRC","ALERTS_UI","ALERTS_LIST_LABEL","slotOf","SitePage","_args","c","main","doc","name","value","link","count","changed","err","id","a","buffer","header","make","show","top","list","band","regional","content","records","el","ref","next","footer","nodes","slot","light","skip","alerts","alert","A"],"sources":["../src/components/site-page/SitePage.ts","../src/components/site-page/site-page.ts"],"sourcesContent":["import { html, css, nothing, type PropertyValues } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, state } 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, TYPEKIT_URL } from '../../styles/base.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { ColorSchemeController } from '../../base/color-scheme.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { bufferAnalytics } from '../../base/analytics-state.js';\nimport {\n ALERTS_PRODUCTION_SRC,\n alertsBase,\n isAlertsEnv,\n loadAlerts,\n} from '../site-alerts/alerts.js';\n\nexport { ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC } from '../site-alerts/alerts.js';\nexport type { AlertsEnv } from '../site-alerts/alerts.js';\n\n/** The `<site-alerts>` elements' `show` values: header banner, alert list, regional alerts. */\ntype AlertShow = 'header' | 'list' | 'regional';\nconst ALERTS_UI = 'site-alerts';\n/** Accessible name of the list band region. */\nconst ALERTS_LIST_LABEL = 'Library alerts';\n\nconst slotOf = (n: Node): string | null => (n instanceof Element ? n.getAttribute('slot') : null);\n\n/**\n * Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles.\n * Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`.\n *\n * The header shows the UVA Library main navigation by default (`no-main-nav` turns it off;\n * `header-variant=\"vendor\"` never shows it).\n *\n * Shows live UVA Library alerts by default with `<site-alerts>` (its code loads only then),\n * placed as Virgo places them: a full-bleed `<site-alerts show=\"header\">` banner at the top\n * of the header landmark (after the skip link), a full-bleed band between the header and\n * `<main>` holding `<site-alerts show=\"list\">` (a `<section aria-label=\"Library alerts\">`\n * region, hidden while the list has nothing to show), and `<site-alerts show=\"regional\">` as\n * the first child of `<main>`, inside its padding. Their data comes from one headless\n * `<uvalib-alerts>`, loaded once per document, with a module script, from the alerts CDN\n * (`alerts-env`, or `alerts-src`); if it fails to load, one console warning is logged and\n * the page works as before. `no-alerts` renders no alert elements and loads nothing.\n *\n * A `slot=\"breadcrumbs\"` child (a `<uvalib-breadcrumbs>`) is placed where library.virginia.edu\n * puts the trail: after the header and the alert list band, before `<main>` and outside it (so\n * the skip link lands past it), with the same gutters as `<main>`.\n *\n * Printing leaves out the chrome: the skip link, header (with the main navigation and the\n * header alert), alert list band, regional alerts, breadcrumbs, pre-footer and footer are not\n * printed, `<main>` loses its gutters, and the content prints black on white (a dark scheme\n * prints light), its links underlined. A short line above the content says where the page\n * came from (\"UVA Library — <site name or page title>\" and the page's URL). `print-chrome`\n * prints the page as it is shown instead. With `no-style` none of this applies.\n *\n * @tagname site-page\n * @slot - Main page content, rendered inside the single `<main>`.\n * @slot breadcrumbs - Optional breadcrumb trail (a `<uvalib-breadcrumbs>`), shown between the header (and alert list band) and `<main>`. In light mode it is moved there, never into `<main>`.\n * @slot pre-footer - Optional content shown in a band above the footer.\n * @slot site-links - Optional `<a href>` elements, forwarded to `<site-header>`, that replace the library utility links in the header (inline nav and Menu popover). Ignored with `header-variant=\"vendor\"`.\n * @slot main-nav - Optional `<nav>` forwarded to `<site-header>`, whose list replaces the UVA Library main navigation's links (see `<site-main-nav>`). Ignored with `no-main-nav` and `header-variant=\"vendor\"`.\n * @csspart main - The `<main>` landmark.\n * @csspart header - The `<header>` element inside `<site-header>` (shadow mode; exported through `exportparts`).\n * @csspart footer - The `<footer>` element inside `<site-footer>` (shadow mode; exported through `exportparts`).\n * @cssprop [--uva-brand-blue=#232d4b] - Skip link background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour (focus-visible outline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, \"UVA Franklin Fallback\", Arial, Helvetica, sans-serif] - Page font family (global styles).\n * @cssprop [--uva-font-size-base=17px] - Page base font size (global styles).\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Page text colour (global styles).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (global styles; else none).\n * @cssprop --uva-color-text - Dark-mode role token: page text (global styles; else `--uva-grey-darkest`).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: skip-link background (else `--uva-brand-blue`).\n * @cssprop --uva-color-on-accent - Dark-mode role token: skip-link text (else #fff).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n */\nexport class SitePage extends UvalibElement {\n /** The page's content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n @property({ type: String, attribute: 'header-variant' }) headerVariant: 'full' | 'vendor' =\n 'full';\n @property({ type: Boolean, attribute: 'no-global-styles' }) noGlobalStyles = false;\n /**\n * Hide the footer (and any pre-footer band), for tools and app-like pages where the site\n * footer does not belong. The footer is kept hidden rather than removed, so toggling the\n * attribute keeps pre-footer content.\n */\n @property({ type: Boolean, attribute: 'no-footer', reflect: true }) noFooter = false;\n /**\n * Print the header, alerts, breadcrumbs and footer too. By default printing leaves them out\n * and prints only `<main>`, black on white.\n */\n @property({ type: Boolean, attribute: 'print-chrome', reflect: true }) printChrome = false;\n /** Accessible name of the header navigation when site links are given (default \"Site\"). */\n @property({ type: String, attribute: 'site-links-label' }) siteLinksLabel?: string;\n /** The sub-site's name, forwarded to `<site-header site-name>`: shown after the logo as a link to the site's home. */\n @property({ type: String, attribute: 'site-name' }) siteName?: string;\n /** Where the site name links, forwarded to `<site-header site-name-href>` (default `/`). */\n @property({ type: String, attribute: 'site-name-href' }) siteNameHref?: string;\n /** Hide the UVA Library main navigation in the header. */\n @property({ type: Boolean, attribute: 'no-main-nav' }) noMainNav = false;\n /** Accessible name of the header's main navigation (default \"Main\"). */\n @property({ type: String, attribute: 'main-nav-label' }) mainNavLabel?: string;\n /** URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. */\n @property({ type: String, attribute: 'main-nav-src' }) mainNavSrc?: string;\n /**\n * The URL whose main-navigation link is marked current, forwarded to `<site-header\n * main-nav-current>`. Default: the page location, followed through same-document\n * navigations; set it when a single-page app's route is not its URL.\n */\n @property({ type: String, attribute: 'main-nav-current' }) mainNavCurrent?: string;\n /**\n * Alerts environment: `production` (default) or `staging`. Any other value logs one\n * console warning and uses production. Ignored when `alerts-src` is set.\n */\n @property({ type: String, attribute: 'alerts-env' }) alertsEnv = 'production';\n /**\n * Alerts base URL (holding `config.json`, `alerts.json` and `v1/uvalib-alerts.js`); overrides\n * `alerts-env`. For a custom domain, local development and tests.\n */\n @property({ type: String, attribute: 'alerts-src' }) alertsSrc?: string;\n /** Render no alert elements and load no alerts script. */\n @property({ type: Boolean, attribute: 'no-alerts' }) noAlerts = false;\n /**\n * Opt in to dark mode, forwarded to `<site-header color-scheme-switch>`: the page follows\n * the OS preference, and a Light / Dark / System control in the header lets the visitor\n * override it (remembered per site). Off by default: the page is always light. The page's\n * own content must support it (see the README's \"Dark mode\").\n */\n @property({ type: Boolean, attribute: 'color-scheme-switch' }) colorSchemeSwitch = false;\n /**\n * Opt in to Matomo analytics: the site's Matomo id. The page then adds one\n * `<site-analytics>` for it (loading its code only then), which records the page view and\n * what the library's components report (see the README's \"Analytics\"). Off by default. With\n * an analytics element or a Matomo snippet already on the page nothing is counted twice.\n */\n @property({ type: Number, attribute: 'matomo-id' }) matomoId?: number;\n /** The Matomo server for `matomo-id`, ending in `/` (default: the library's). */\n @property({ type: String, attribute: 'matomo-url' }) matomoUrl?: string;\n /**\n * `event`: the `<site-analytics downloads=\"event\">` option for `matomo-id`, counting\n * downloads as `['download', '<extension>']` events without their URLs.\n */\n @property({ type: String, attribute: 'matomo-downloads' }) matomoDownloads?: string;\n\n /**\n * Sets the stored scheme on <html> as soon as the page connects, before the header renders,\n * so pages without the inline snippet flash as little as possible; without the switch it\n * removes a stray attribute. It renders nothing itself.\n */\n private readonly scheme = new ColorSchemeController(\n this,\n () => this.colorSchemeSwitch,\n () => this.noStyle,\n false,\n );\n\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n }\n site-header,\n site-footer,\n main {\n display: block;\n width: 100%;\n }\n site-footer[hidden] {\n display: none;\n }\n /* Virgo's alert list: a full-bleed band flush under the header, above main's padding. */\n .alerts-list {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n .alerts-list[hidden] {\n display: none;\n }\n .alerts-list > site-alerts {\n display: block;\n }\n /* The breadcrumb trail lines up with main's content (same max width and side padding). */\n ::slotted([slot='breadcrumbs']) {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* An empty or hidden trail takes no space. */\n ::slotted([slot='breadcrumbs']:is([hidden], [data-empty])) {\n display: none;\n }\n /* Light mode (this stylesheet is rewritten to \\`site-page > …\\` there). */\n :host > [slot='breadcrumbs']:is([hidden], [data-empty]) {\n display: none;\n }\n :host > [slot='breadcrumbs'] {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* Old layout: .main-container-inner (max 1600px, centred) > .w3-row-padding 8px\n > .w3-col 8px > .d8-fade 24px = 40px each side; 12px margin + 24px padding below. */\n main {\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 36px 40px;\n }\n @media screen and (min-width: 993px) {\n main {\n padding-top: 24px; /* old: .breadcrumb-found dropped its 12px top margin */\n }\n }\n /* Print (issue #20): only <main>, black on white, unless print-chrome. In shadow mode\n the breadcrumbs slot is hidden, which hides what is assigned to it; in light mode\n (rewritten to site-page …) the trail is a direct child. The pre-footer is in the\n footer. The base styles underline the content's links and print a dark scheme light. */\n @media print {\n :host(:not([print-chrome])) {\n color: #000;\n background: #fff;\n }\n :host(:not([print-chrome])) :is(site-header, site-footer, .alerts-list, .skip-link),\n :host(:not([print-chrome])) main > site-alerts,\n :host(:not([print-chrome])) slot[name='breadcrumbs'],\n :host(:not([print-chrome])) > [slot='breadcrumbs'] {\n display: none;\n }\n :host(:not([print-chrome])) main {\n max-width: none;\n padding: 0;\n }\n /* Where the page came from: a line above the content, from --uvalib-print-source\n (set on <main>: \"UVA Library — <site name or title> <URL>\"). Print only, so never\n read out on screen. */\n :host(:not([print-chrome])) main::before {\n content: var(--uvalib-print-source, none);\n display: block;\n margin: 0 0 1rem;\n padding: 0 0 0.25rem;\n border-bottom: 1px solid #000;\n color: #000;\n font-size: 0.875rem;\n overflow-wrap: anywhere;\n }\n }\n `,\n ];\n\n /** Light mode: nodes this element rendered itself (incl. Lit markers), never routed. */\n private chrome = new WeakSet<Node>();\n private observer?: MutationObserver;\n private globalsInstalled = false;\n /** The alerts base URL in use, from `alerts-src` or `alerts-env`. */\n private alertsUrl = ALERTS_PRODUCTION_SRC;\n /** Light mode: the alert elements this element created, and the list band. */\n private lightAlerts?: {\n top: HTMLElement;\n band: HTMLElement;\n list: HTMLElement;\n regional: HTMLElement;\n };\n /** The `<site-analytics>` this element added for `matomo-id`. */\n private analytics?: HTMLElement;\n /** Whether this element asked for `<site-alerts>`' code. */\n private alertsUiRequested = false;\n /** Whether the list alerts have anything to show, from their last update event. */\n @state() private listShown = false;\n /**\n * Shadow mode: whether a `slot=\"breadcrumbs\"` child exists, so the slot is rendered only\n * then and the page without breadcrumbs renders exactly what it did before them.\n */\n @state() private hasBreadcrumbs = false;\n private breadcrumbsObserver?: MutationObserver;\n\n private syncHasBreadcrumbs = (): void => {\n this.hasBreadcrumbs = [...this.children].some((c) => slotOf(c) === 'breadcrumbs');\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.lightDom) {\n this.syncHasBreadcrumbs();\n this.breadcrumbsObserver ??= new MutationObserver(this.syncHasBreadcrumbs);\n this.breadcrumbsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n this.ownerDocument.defaultView?.addEventListener('beforeprint', this.syncPrintSource);\n if (!this.noGlobalStyles && !this.globalsInstalled) {\n this.globalsInstalled = true;\n this.installGlobalStyles(this.ownerDocument);\n }\n // Reconnect after a disconnect; the first connect starts routing in update().\n if (this.lightDom && this.hasUpdated) {\n this.route(this.childNodes);\n this.observe();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.breadcrumbsObserver?.disconnect();\n this.ownerDocument.defaultView?.removeEventListener('beforeprint', this.syncPrintSource);\n }\n\n /**\n * The printed \"where from\" line, as a CSS string on <main> (`--uvalib-print-source`), read\n * by the print styles. Set on each update and again just before printing, so a single-page\n * app prints its current title and URL.\n */\n private syncPrintSource = (): void => {\n const main = this.renderRoot.querySelector<HTMLElement>(\n this.lightDom ? ':scope > main' : 'main',\n );\n if (!main) return;\n const doc = this.ownerDocument;\n const name = (this.siteName || doc.title || '').trim();\n const text = `UVA Library${name ? ` — ${name}` : ''} ${doc.defaultView?.location.href ?? ''}`;\n const value = `\"${text\n .trim()\n .replace(/[\\\\\"]/g, '\\\\$&')\n .replace(/[\\n\\r\\f]/g, ' ')}\"`;\n if (main.style.getPropertyValue('--uvalib-print-source') !== value)\n main.style.setProperty('--uvalib-print-source', value);\n };\n\n private installGlobalStyles(doc: Document): void {\n // Tokens stay layered so a host's own `:root { --uva-*: … }` wins; base and accessibility\n // rules are unlayered so they beat host resets.\n installLightDomStyles('uvalib-tokens', [tokens], { root: doc, scope: false });\n installLightDomStyles('uvalib-global', [fontFallback, base, accessible], {\n root: doc,\n scope: false,\n layer: false,\n });\n if (!doc.head.querySelector(`link[href=\"${TYPEKIT_URL}\"]`)) {\n const link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.href = TYPEKIT_URL;\n doc.head.append(link);\n }\n }\n\n /** The list element's `site-alerts-change`: show the band only while it lists alerts. */\n private onListChange(e: Event): void {\n if (e.target !== e.currentTarget) return;\n const count = (e as CustomEvent<{ count?: unknown }>).detail?.count;\n this.listShown = typeof count === 'number' && count > 0;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('colorSchemeSwitch')) this.scheme.sync();\n if (changed.has('noAlerts') && this.noAlerts) this.listShown = false;\n if (changed.has('alertsEnv') && this.alertsEnv && !isAlertsEnv(this.alertsEnv)) {\n console.warn(\n `${this.localName}: unknown alerts-env \"${this.alertsEnv}\"; using production. Valid values: production, staging.`,\n );\n }\n try {\n this.alertsUrl = alertsBase(this.alertsEnv, this.alertsSrc, this.ownerDocument.baseURI);\n } catch {\n if (changed.has('alertsSrc')) {\n console.warn(\n `${this.localName}: alerts-src \"${this.alertsSrc}\" is not a URL; ignoring it.`,\n );\n }\n this.alertsUrl = alertsBase(this.alertsEnv, null, this.ownerDocument.baseURI);\n }\n }\n\n protected override updated(): void {\n if (this.lightDom) this.syncLightAlerts();\n this.syncPrintSource();\n if (!this.noAlerts) {\n // The alerts script starts loading at once, alongside <site-alerts>' own code.\n loadAlerts(this.ownerDocument, this.alertsUrl);\n this.defineAlerts();\n }\n this.syncAnalytics();\n }\n\n /** Loads `<site-alerts>` (and registers it) on first use of the alerts. */\n protected loadAlertsUi(): Promise<unknown> {\n return import('../site-alerts/site-alerts.js');\n }\n\n private defineAlerts(): void {\n if (this.alertsUiRequested || customElements.get(ALERTS_UI)) return;\n this.alertsUiRequested = true;\n this.loadAlertsUi().catch((err) =>\n console.error(`${this.localName}: failed to load site-alerts`, err),\n );\n }\n\n /** Loads `<site-analytics>` (and registers it) on first use of `matomo-id`. */\n protected loadAnalytics(): Promise<unknown> {\n return import('../site-analytics/site-analytics.js');\n }\n\n /**\n * `matomo-id`: one `<site-analytics>`, at the very start of the render root, before Lit's\n * markers, so no render ever clears it and (being chrome) light DOM routing never moves it.\n * The element's own one-tracker guard keeps a second element or snippet from double-counting.\n */\n private syncAnalytics(): void {\n const id = Number(this.matomoId);\n if (!(id > 0)) {\n this.analytics?.remove();\n this.analytics = undefined;\n return;\n }\n if (!this.analytics) {\n // An analytics element the page has already (say the old v0.0.12 <uvalib-analytics>,\n // which does not share the one-tracker guard) records the page: don't add a second.\n if (this.ownerDocument.querySelector('site-analytics, uvalib-analytics')) return;\n const a = (this.analytics = this.ownerDocument.createElement('site-analytics'));\n this.chrome.add(a);\n if (!customElements.get('site-analytics')) {\n // Until the code arrives nothing forwards: keep what the components report meanwhile\n // (a bento search can settle first) and hand it over once the element is running.\n const buffer = bufferAnalytics(this.ownerDocument);\n this.loadAnalytics()\n .then(() => customElements.whenDefined('site-analytics'))\n .then(() => (a as HTMLElement & { updateComplete?: Promise<unknown> }).updateComplete)\n .then(\n () => buffer.flush(),\n (err) => {\n buffer.drop();\n console.error(`${this.localName}: failed to load site-analytics`, err);\n },\n );\n }\n }\n const a = this.analytics;\n if (a.getAttribute('matomoid') !== String(id)) a.setAttribute('matomoid', String(id));\n if (this.matomoUrl) a.setAttribute('matomourl', this.matomoUrl);\n else a.removeAttribute('matomourl');\n if (this.matomoDownloads) a.setAttribute('downloads', this.matomoDownloads);\n else a.removeAttribute('downloads');\n if (a.parentNode !== this.renderRoot) this.renderRoot.prepend(a);\n }\n\n /**\n * Light mode keeps <main> free of Lit parts, so the alert elements are managed here: the\n * header one is handed to <site-header> as a `slot=\"alerts\"` child (it moves it into its\n * <header>), the list band goes right after <site-header>, and regional stays the first\n * child of <main>. The band and the elements are chrome, so route() never moves them.\n */\n private syncLightAlerts(): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header) return;\n if (this.noAlerts) {\n const a = this.lightAlerts;\n for (const n of a ? [a.top, a.band, a.regional] : []) n.remove();\n this.lightAlerts = undefined;\n return;\n }\n if (!this.lightAlerts) {\n const doc = this.ownerDocument;\n const make = (show: AlertShow) => {\n const a = doc.createElement(ALERTS_UI);\n a.setAttribute('show', show);\n a.setAttribute('no-shadow-dom', '');\n this.chrome.add(a);\n return a;\n };\n const top = make('header');\n top.slot = 'alerts';\n const list = make('list');\n list.addEventListener('site-alerts-change', (e) => this.onListChange(e));\n const band = doc.createElement('section');\n band.className = 'alerts-list';\n band.setAttribute('aria-label', ALERTS_LIST_LABEL);\n band.append(list);\n this.chrome.add(band);\n this.lightAlerts = { top, band, list, regional: make('regional') };\n }\n const { top, band, list, regional } = this.lightAlerts;\n for (const a of [top, list, regional]) {\n if (a.getAttribute('alerts-src') !== this.alertsUrl)\n a.setAttribute('alerts-src', this.alertsUrl);\n a.toggleAttribute('no-style', this.noStyle);\n }\n band.hidden = !this.listShown;\n if (!header.contains(top)) header.append(top);\n // Directly after <site-header>, before any Lit marker, so no part ever clears it.\n if (header.nextSibling !== band) header.after(band);\n if (main.firstChild !== regional) main.prepend(regional);\n }\n\n protected override update(changed: PropertyValues): void {\n if (this.hasUpdated || !this.lightDom) {\n super.update(changed);\n return;\n }\n const content = [...this.childNodes];\n super.update(changed); // first render appends the chrome after the content\n for (const n of this.childNodes) if (!content.includes(n)) this.chrome.add(n);\n this.route(content);\n this.observe();\n }\n\n private observe(): void {\n this.observer ??= new MutationObserver((records) => {\n for (const r of records) {\n if (r.type === 'attributes') this.reslot(r.target as Element);\n else if (r.target === this) this.route(r.addedNodes);\n }\n });\n // One call: observing the same node again would replace these options. Children added to\n // the page are routed; a content node given slot=\"breadcrumbs\" later (or losing it) moves\n // out of (or back into) <main>.\n this.observer.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n /** Light mode: a top-level content node's `slot` changed to or from `breadcrumbs`. */\n private reslot(el: Element): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header || this.chrome.has(el)) return;\n if (el.parentNode === main && slotOf(el) === 'breadcrumbs') this.placeBreadcrumbs(el, header);\n else if (\n el.parentNode === this &&\n slotOf(el) !== 'breadcrumbs' &&\n main.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING\n )\n main.append(el);\n }\n\n /**\n * Light mode: a `slot=\"breadcrumbs\"` node goes after the header, the alert list band and any\n * breadcrumbs already there, before Lit's markers (so no render clears it) and `<main>`.\n */\n private placeBreadcrumbs(n: Node, header: Element): void {\n let ref: Node = header;\n for (let next = ref.nextSibling; next; next = ref.nextSibling) {\n if (next !== this.lightAlerts?.band && slotOf(next) !== 'breadcrumbs') break;\n if (next === n) return; // already in place\n ref = next;\n }\n (ref as ChildNode).after(n);\n }\n\n /**\n * Light mode has no slots: move content into `<main>`, pre-footer nodes to the footer,\n * site links and main-nav markup to the header and breadcrumbs before `<main>`.\n */\n private route(nodes: Iterable<Node>): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n const footer = this.querySelector(':scope > site-footer');\n if (!main || !header || !footer) return;\n for (const n of [...nodes]) {\n if (n.parentNode !== this || this.chrome.has(n)) continue;\n if (n.nodeType === Node.TEXT_NODE && !n.textContent?.trim()) continue;\n // The header and footer adopt their own slotted children, even before they upgrade.\n const slot = slotOf(n);\n if (slot === 'breadcrumbs') {\n this.placeBreadcrumbs(n, header);\n continue;\n }\n const to =\n slot === 'pre-footer'\n ? footer\n : slot === 'site-links' || slot === 'main-nav'\n ? header\n : main;\n to.append(n);\n }\n }\n\n private onSkip(e: Event): void {\n e.preventDefault();\n // Shadow mode: the link is in <site-header>'s skip-link slot, and the header reports it.\n if (this.lightDom) trackEvent(this, ['site-header', 'skip-link']);\n this.renderRoot.querySelector<HTMLElement>('main')?.focus();\n }\n\n protected override render() {\n const light = this.lightDom;\n // Light mode keeps <main> and <site-footer> free of Lit parts so moved content is never cleared.\n const skip = html`<a\n class=\"skip-link\"\n href=\"#main-content\"\n slot=${ifDefined(light ? undefined : 'skip-link')}\n @click=${this.onSkip}\n >Skip to main content</a\n >`;\n // Shadow mode: the link is slotted into <site-header>'s <header> landmark, because axe\n // looks the #main-content target up on the document and cannot see it in this shadow root,\n // so it would flag a skip link that sits outside every landmark (\"region\").\n // Light mode: the link stays the first child, where the target resolves.\n const alerts = !this.noAlerts && !light;\n const alert = (show: AlertShow) =>\n html`<site-alerts\n slot=${ifDefined(show === 'header' ? 'alerts' : undefined)}\n show=${show}\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n ></site-alerts>`;\n // Shadow mode's list band; light mode builds the same in syncLightAlerts().\n const band = html`<section\n class=\"alerts-list\"\n aria-label=${ALERTS_LIST_LABEL}\n ?hidden=${!this.listShown}\n >\n <site-alerts\n show=\"list\"\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n @site-alerts-change=${this.onListChange}\n ></site-alerts>\n </section>`;\n return html`\n ${light ? skip : nothing}\n <site-header\n exportparts=\"header\"\n ?no-shadow-dom=${light}\n ?no-style=${this.noStyle}\n variant=${this.headerVariant}\n root-link-domain=${this.rootLinkDomain}\n site-links-label=${ifDefined(this.siteLinksLabel)}\n site-name=${ifDefined(this.siteName)}\n site-name-href=${ifDefined(this.siteNameHref)}\n ?no-main-nav=${this.noMainNav}\n main-nav-label=${ifDefined(this.mainNavLabel)}\n main-nav-src=${ifDefined(this.mainNavSrc)}\n main-nav-current=${ifDefined(this.mainNavCurrent)}\n ?color-scheme-switch=${this.colorSchemeSwitch}\n >${\n light\n ? nothing\n : html`${skip}${alerts ? alert('header') : nothing}<slot\n name=\"site-links\"\n slot=\"site-links\"\n ></slot\n ><slot name=\"main-nav\" slot=\"main-nav\"></slot>`\n }</site-header\n >\n ${alerts ? band : nothing}\n ${!light && this.hasBreadcrumbs ? html`<slot name=\"breadcrumbs\"></slot>` : nothing}\n ${\n light\n ? html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\"></main>`\n : html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\">\n ${alerts ? alert('regional') : nothing}<slot></slot>\n </main>`\n }\n ${\n light\n ? html`<site-footer\n no-shadow-dom\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ></site-footer>`\n : html`<site-footer\n exportparts=\"footer\"\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ><slot name=\"pre-footer\" slot=\"pre-footer\"></slot\n ></site-footer>`\n }\n `;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SitePage } from './SitePage.js';\nimport '../site-header/site-header.js';\n// The footer sits at the bottom of the page, so it loads asynchronously.\nimport('../site-footer/site-footer.js').catch((err) =>\n console.error('site-page: failed to load site-footer', err),\n);\n\ndefine('site-page', SitePage);\n"],"mappings":";;;;;;;;;AAwBA,IAAM0B,IAAY,eAEZC,IAAoB,kBAEpBC,KAAU,MAA4BvB,aAAa,UAAUA,EAAE,aAAa,MAAM,IAAI,MAkD/EwB,IAAb,cAA8BjB,EAAc;;EAyPJ,A,aArPpC,KAAA,iBAAA,oCAEA,KAAA,gBAAA,QAC2E,KAAA,iBAAA,IAME,KAAA,WAAA,IAKM,KAAA,cAAA,IAQlB,KAAA,YAAA,IAeF,KAAA,YAAA,cAOD,KAAA,WAAA,IAOmB,KAAA,oBAAA,IAqBzD,KAAA,SAAA,IAAIO,EAC5B,YACM,KAAK,yBACL,KAAK,SACX,EACF,GAuGiB,KAAA,yBAAA,IAAI,QAAc,GAER,KAAA,mBAAA,IAEP,KAAA,YAAAM,GAWQ,KAAA,oBAAA,IAEC,KAAA,YAAA,IAKK,KAAA,iBAAA,IAGO,KAAA,2BAAA;GACvC,KAAK,iBAAiB,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,MAAM,MAAMG,EAAOG,CAAC,MAAM,aAAa;EAClF,GAsCsC,KAAA,wBAAA;GACpC,IAAMC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CAAA,GAOlD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAS,WAAW;AAAsB,CAAC,CAAA,GAAA0B,EAAA,WAAA,qBAAA,KAAA,CAAA,GAO5D3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA0B,EAAA,WAAA,YAAA,KAAA,CAAA,GAEjD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAA0B,EAAA,WAAA,aAAA,KAAA,CAAA,GAKlD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAmB,CAAC,CAAA,GAAA0B,EAAA,WAAA,mBAAA,KAAA,CAAA,GAoIxD3B,EAAA,CAAAE,EAAM,CAAA,GAAAyB,EAAA,WAAA,aAAA,KAAA,CAAA,GAKN3B,EAAA,CAAAE,EAAM,CAAA,GAAAyB,EAAA,WAAA,kBAAA,KAAA,CAAA,GCxRT,OAAO,mBAAgC,CAAC,OAAO,MAC7C,QAAQ,MAAM,yCAAyCU,CAAG,CAC5D,GAEA9B,EAAO,aAAaoB,CAAQ"}
@@ -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 { n as s, r as c } from "./chunks/base-BI8h0Gf3.js";
2
+ import { i as s, n as c, r as l } from "./chunks/base-CIX_-Rmo.js";
3
3
  // src/components/site-style/SiteStyle.ts
4
- var l = class extends o {
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 = [c, s];
12
+ this.styles = [l, c];
13
13
  }
14
14
  installLightStyles() {
15
- a("uvalib-tokens", [c], {
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 })], l.prototype, "imports", void 0), r([e({ type: String })], l.prototype, "importedStyles", void 0), n("site-style", l);
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":";;;AAqBA,IAAaY,IAAb,cAA+BH,EAAc;;EAYE,A,aANoB,KAAA,UAAA,CAAC,GAMrB,KAAA,iBAAA;;;EAVD,KAAA,kBAAA;;;EAC5B,KAAA,SAAA,CAACE,GAAQD,CAAI;;CAe7B,qBAA8C;EAG5C,AADAF,EAAsB,iBAAiB,CAACG,CAAM,GAAG;GAAE,MAAM,KAAK;GAAe,OAAO;EAAM,CAAC,GAC3FH,EAAsB,qBAAqB,CAACE,CAAI,GAAG;GACjD,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,WAAWf,IAAU,CAAI;CACvC;AACF;;AAtCGC,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAU,EAAA,WAAA,WAAA,KAAA,CAAA,GAMzBX,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAU,EAAA,WAAA,kBAAA,KAAA,CAAA,GC9B5BP,EAAO,cAAcO,CAAS"}
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"}
@@ -74,8 +74,9 @@ 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
+ - 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.
79
80
  - Never pierce shadow roots with JS, depend on internal class names, or use `!important` to fight the chrome.
80
81
 
81
82
  ### Dark mode (opt-in)
@@ -594,10 +595,10 @@ A static site (11ty, Jekyll, a generated collection) that searches with [Pagefin
594
595
  For a results list of your own (a collection, a Virgo-like listing, a photo archive), use these instead of hand-made pills, counts and spinners. Classes are in `base.css`; the two elements load from `uvalib-tag-list.js` and `uvalib-results-count.js`.
595
596
 
596
597
  - Badges: `.uvalib-badge` (neutral) with `--category` (the card chip), `--count` (on media, inside `.uvalib-media`; several in `.uvalib-media__badges`), `--status` plus `--success` / `--warning` / `--danger` / `--info`, `--new`, and `--body` for body size. A status badge always says its state in words; an icon in it gets `aria-hidden="true"`. Inside `<uvalib-card>` use its `badge` and `chip` slots instead.
597
- - Toolbar: `.uvalib-toolbar` around `.uvalib-toolbar__field` (label over control; `--grow` takes the spare width), `.uvalib-toolbar__group` (`role="group"` with an `aria-label`, `.uvalib-button` toggles with `aria-pressed`) and `.uvalib-toolbar__summary`. It stacks on phones.
598
+ - Toolbar: `.uvalib-toolbar` around `.uvalib-toolbar__field` (label over control; `--grow` takes the spare width), `.uvalib-toolbar__group` (`role="group"` with an `aria-label`, `.uvalib-button` toggles with `aria-pressed`) and `.uvalib-toolbar__summary`. It stacks when it is itself 30em wide or less (a phone, a sidebar, a drawer): toolbar, result list and photo grid follow their own width (CSS size containers), so give one a width in a shrink-to-fit box.
598
599
  - `<uvalib-results-count shown total noun singular>`: the visible “Showing 48 of 3,694 shoots”, announced politely once it settles (1 s); never the first render, but the first count after an empty one (data loading) is. Leave `shown`/`total` unset while loading. Set `shown` and `total` after every filter change; do not add your own live region for the count. Not beside `<bento-box>` or `<uvalib-pagefind-search>`, which announce their own.
599
600
  - `<uvalib-tag-list label="Subjects" track-label limit="8" href-template="/search?q={tag}">` with `<a href>` or `<span>` children (or `items`): links are outlined pills, plain tags filled chips; a child's `lang`/`dir` and inline markup are kept; `limit` adds “Show all N”. Always set `label` (`hide-label` hides it visually). It reports tag clicks as `list N` and the tag's position, never the tag text; add `track-label` only when the label is fixed text you wrote, never one filled from a record.
600
- - Long result sets (hundreds or thousands of rows): `<ul class="uvalib-result-list">` of `<li class="uvalib-result">` rows holding `__meta` (badges, date), `__title` (the row's one link), `__snippet` (search terms in `<mark>`, drawn bold on `--uva-color-highlight`) and `__actions` (secondary buttons, each with a unique visually hidden name). Plain HTML, never a `<uvalib-card>` per row; rows skip rendering off screen (`content-visibility: auto`). A heading and a list per group for date order.
601
+ - Long result sets (hundreds or thousands of rows): `<ul class="uvalib-result-list">` of `<li class="uvalib-result">` rows holding `__meta` (badges, date), `__title` (the row's one link), `__snippet` (search terms in `<mark>`, drawn bold on `--uva-color-highlight`) and `__actions` (secondary buttons, each with a unique visually hidden name). Plain HTML, never a `<uvalib-card>` per row; rows skip rendering off screen (`content-visibility: auto`); the actions wrap below when the list itself is 40em or narrower. A heading and a list per group for date order.
601
602
  - No results: `.uvalib-empty-state` (decorative `__icon`, a heading, a sentence, one action). Loading: `.uvalib-skeleton` (give it a height, or `--media` for 3:2) and `.uvalib-skeleton-text` (one line), sized like what replaces them, inside an `aria-hidden="true"` container, with `aria-busy="true"` on the region while it loads.
602
603
 
603
604
  ```html snippet
@@ -723,8 +724,8 @@ Use these instead of a hand-built gallery or a carousel. There is no autoplay.
723
724
  - From the page: `open(idOrIndex)` (false if unknown) and `close({ focus })` (after deleting the open item; focus your heading); `uvalib-lightbox-open` (`{ id, index, restored }`) and `uvalib-lightbox-close` (`{ id, index, reason }`) report both. Never click the dialog's own Close.
724
725
  - `<uvalib-image-regions>` from `uvalib-image-regions.js`: numbered outlines on an image (people, objects, inscriptions) with a list of the same regions beside it. Write the page's own `<img width height alt>` and `<ol>` inside, each `<li data-xywh="percent:x,y,w,h">` (or pixels of the natural size, `160,120,320,240`; `image-width`/`image-height` for a IIIF derivative) holding the region's link and your own action buttons, which stay yours; or set `items` (`{ label, x, y, w, h, unit?, href?, description? }[]`). The list is the accessible route: the outlines are `aria-hidden`, not tab stops, and never the only place a name or action is; hovering or focusing an entry highlights its outline (thicker double outline and label) and back, and clicking an outline focuses its entry. `label` names the list. Listen for `uvalib-image-regions-activate` (an outline clicked, before its entry takes focus; `detail: { index, item, entry }`, `entry` the page's own `<li>`; cancelable, so the page can focus its own control in the entry, such as a "Who is this?" field) and `highlight`; never read the shadow DOM's outlines for it. Do not hand-build absolutely positioned outlines. It reports outline clicks itself (the list's label and the number, never a region's label).
725
726
  - Regions in the viewer: `data-regions` on a lightbox link (a JSON array, or `percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the lightbox's `regions` callback (`({ element, id, href, index }) => regions`). The open image then shows the outlines, their list and a "Show regions" toggle; `regions-label` names the list. For your own buttons in each entry, `data-regions-list="<id>"` (or the `regionsList` callback) names a hidden `<ol>` of `<li data-xywh>` in the page: it is lent to the viewer (same nodes, your listeners and CSS keep working) and put back on close; give each action a unique name ("Confirm Tim Kaine"). In React, create that `<ol>` (and a details element) outside React and make it the `createPortal` target for the entries, never render it inside a portal (README "React and other frameworks").
726
- - Versions in the viewer: `data-versions='[{"label":"Original"},{"label":"AI colorization","href":"color.jpg","note":"The colours are an AI model’s guess."}]'` on a lightbox link (first entry = the link's image; or the `versions` callback) compares them over the photo, the comparison loaded on first use: Switch (default), Reveal (`compare="wipe"`, a divider: click the photo or the slider) or Fade; label AI versions as such and give them a `note`; a version with a different framing (AI-expanded frame, whole plate, crop) gives `"frame": "percent:x,y,w,h"` (the original's box in it; pixels need its `width`/`height`) and is drawn at the original's scale around it; `version-param` (with `url-param`) keeps `?version=wipe:40`; `uvalib-lightbox-version` reports changes.
727
- - `<uvalib-photo-grid>` from `uvalib-photo-grid.js`: justified rows. Each direct `<a href>` or `<button>` is one photo and stays a real control. The row is about 220px, and 140px at 767px and below, unless `row-height` is set (a bare number is pixels). Give each image `width` and `height` so the row does not jump when it loads. An image with no visible text gets a caption from its alt, and a repeated alt is cleared (the original is kept for a lightbox). A different alt is kept. Do not set an `aria-label` that differs from the visible text; the grid will not add a caption beside one. Generated "Photo N" captions renumber when the photos change order. A `<span slot="badge">` inside the item, or `data-badge` on it (“seq”, “3 photos”), is drawn over the thumbnail and stays in the accessible name; an existing `aria-label` gains the badge text. A grid inside a lightbox opens the viewer. The grid reports no analytics.
727
+ - Versions in the viewer: `data-versions='[{"label":"Original"},{"label":"AI colorization","href":"color.jpg","note":"The colours are an AI model’s guess."}]'` on a lightbox link (first entry = the link's image; or the `versions` callback) compares them over the photo, the comparison loaded on first use: Switch (default), Reveal (`compare="wipe"`, a divider: click the photo or the slider) or Fade; label AI versions as such and give them a `note`; a version with a different framing (AI-expanded frame, whole plate, crop) gives `"frame": "percent:x,y,w,h"` (the original's box in it; pixels need its `width`/`height`) and is drawn at the original's scale around it (a crop's frame goes past it: `percent:-25,-25,150,150`); `data-version="1"` (the `version-param` format) opens a link on that version, the original still first; `version-param` (with `url-param`) keeps `?version=wipe:40`; `uvalib-lightbox-version` reports changes.
728
+ - `<uvalib-photo-grid>` from `uvalib-photo-grid.js`: justified rows. Each direct `<a href>` or `<button>` is one photo and stays a real control. The row is about 220px, and 140px when the grid itself is under 48rem (also in a sidebar), unless `row-height` is set (a bare number is pixels). Give each image `width` and `height` so the row does not jump when it loads. An image with no visible text gets a caption from its alt, and a repeated alt is cleared (the original is kept for a lightbox). A different alt is kept. Do not set an `aria-label` that differs from the visible text; the grid will not add a caption beside one. Generated "Photo N" captions renumber when the photos change order. A `<span slot="badge">` inside the item, or `data-badge` on it (“seq”, “3 photos”), is drawn over the thumbnail and stays in the accessible name; an existing `aria-label` gains the badge text. A grid inside a lightbox opens the viewer. The grid reports no analytics.
728
729
 
729
730
  ```html snippet
730
731
  <!doctype html>
@@ -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`). |
@@ -775,7 +775,7 @@ A row of chips: a segmented control or single-select filter (`mode="single"`), f
775
775
 
776
776
  ## `<uvalib-combobox>`
777
777
 
778
- An editable text field that suggests values as you type, from a local list or a URL: a person, place or subject picker. It follows the WAI-ARIA APG “Editable Combobox With List Autocomplete”: a real `<input role="combobox">` and a `role="listbox"` popup under it. Suggestions come from the `items` property (`{ value, label?, description?, disabled? }` objects, or strings), from `<option>` children (directly or inside a `<datalist>`; the `label` attribute or text is the label, `data-description` the second line), or from `src`, a URL template with `{q}` (fetched 250 ms after the last keystroke once the text has `min-length` characters, default 1; a newer keystroke aborts the older request; the response is a JSON array of the same shape, or anything `transform(data, query)` turns into one). `items` wins over the children while set. Local suggestions match anywhere in the label, ignoring case and accents, those starting with the text first, then those with a word starting with it; at most `max-results` (default 50, 0 for all) are shown, which keeps a list of 16,000 people fast. The matched text is bold and underlined in a `<mark>`. Keys: Down opens the list on the first suggestion and moves (wrapping), Up opens on the last, Alt+Down opens without moving, Alt+Up closes, Enter chooses the active suggestion (and then does not submit the form; with none active, Enter submits as in any field), Escape closes the list and a second Escape clears the field, Home, End, Left and Right move the caret, and Tab leaves without choosing. A real clear button (“Clear <label>”, 44px, shown only with text) empties the field and returns focus to it. Free text is allowed: `value` is whatever is in the field, and `selected` the chosen suggestion (or null); typing after choosing clears it, and leaving the field with text that is exactly one suggestion's label chooses it. `must-choose` makes any other text invalid (“Choose one of the suggestions.”). The element is form-associated: with `name` it submits the chosen suggestion's value, or else the text, and a form reset restores the `value` attribute. `required` and `disabled` (also from a disabled fieldset) work as on an input. A polite status says “5 suggestions”, “50 of 1,234 suggestions”, “No suggestions”, “Loading suggestions” or “Couldn't load suggestions” half a second after the list settles (never on the first render); the popup shows the same notes visibly. A failed load never throws. Before it upgrades, `base.css` shows the label (from the attribute) and holds the field's height. A fallback `<input list>` child works as a plain field meanwhile; on upgrade its text, `name` and `placeholder` carry over, and it is disabled so it does not submit twice.
778
+ An editable text field that suggests values as you type, from a local list or a URL: a person, place or subject picker. It follows the WAI-ARIA APG “Editable Combobox With List Autocomplete”: a real `<input role="combobox">` and a `role="listbox"` popup under it. Suggestions come from the `items` property (`{ value, label?, description?, disabled? }` objects, or strings), from `<option>` children (directly or inside a `<datalist>`; the `label` attribute or text is the label, `data-description` the second line), or from `src`, a URL template with `{q}` (fetched 250 ms after the last keystroke once the text has `min-length` characters, default 1; a newer keystroke aborts the older request; the response is a JSON array of the same shape, or anything `transform(data, query)` turns into one). `items` wins over the children while set. Local suggestions match anywhere in the label, ignoring case and accents, those starting with the text first, then those with a word starting with it; at most `max-results` (default 50, 0 for all) are shown, which keeps a list of 16,000 people fast. The matched text is bold and underlined in a `<mark>`. Keys: Down opens the list on the first suggestion and moves (wrapping), Up opens on the last, Alt+Down opens without moving, Alt+Up closes, Enter chooses the active suggestion (and then does not submit the form; with none active, Enter submits as in any field), Escape closes the list and a second Escape clears the field, Home, End, Left and Right move the caret, and Tab leaves without choosing. A real clear button (“Clear <label>”, 44px, shown only with text) empties the field and returns focus to it. Free text is allowed: `value` is whatever is in the field, and `selected` the chosen suggestion (or null); typing after choosing clears it, and leaving the field with text that is exactly one suggestion's label chooses it. `must-choose` makes any other text invalid (“Choose one of the suggestions.”). The element is form-associated: with `name` it submits the chosen suggestion's value, or else the text, and a form reset restores the `value` attribute. `required` and `disabled` (also from a disabled fieldset) work as on an input. A polite status says “5 suggestions”, “50 of 1,234 suggestions”, “No suggestions”, “Loading suggestions” or “Couldn't load suggestions” half a second after the list settles (never on the first render); the popup shows the same notes visibly. A failed load never throws. Where the browser supports the Popover API and CSS anchor positioning, the popup is a manual popover in the top layer, anchored under the field and as wide as it (above it when there is no room below), so an ancestor with `overflow: hidden` or a scrolling panel never clips it. Elsewhere it is positioned under the field inside the element, as before. Pages can style the runtime state with `:state(open)`, `:state(invalid)` and `:state(loading)` (no attributes are added). Before it upgrades, `base.css` shows the label (from the attribute) and holds the field's height. A fallback `<input list>` child works as a plain field meanwhile; on upgrade its text, `name` and `placeholder` carry over, and it is disabled so it does not submit twice.
779
779
 
780
780
  ### Attributes
781
781
 
@@ -806,6 +806,14 @@ An editable text field that suggests values as you type, from a local list or a
806
806
  | `option` | Each suggestion. |
807
807
  | `description` | The hint under the field. |
808
808
 
809
+ ### CSS states
810
+
811
+ | State | Description |
812
+ |---|---|
813
+ | `:state(open)` | The popup is showing (suggestions or a note such as “No suggestions”). |
814
+ | `:state(invalid)` | The text was shown as invalid (`aria-invalid="true"`: `must-choose` text that is not a suggestion, after leaving the field or pressing Enter). |
815
+ | `:state(loading)` | Suggestions from `src` are loading. |
816
+
809
817
  ### Events
810
818
 
811
819
  | Event | Description |
@@ -1022,7 +1030,7 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
1022
1030
 
1023
1031
  ## `<uvalib-filter-drawer>`
1024
1032
 
1025
- A search page's form and filters: a plain sidebar on wide screens, and on narrow ones a “Search and filters” button that opens them in a modal panel from the side. Put the page's search form, `<uvalib-filter>`s and other facets inside. Above `breakpoint` (default `48rem`) they are shown as written: no button, no dialog role. At and below it only the button is shown; it opens a native `<dialog>` (`showModal()`) with a visible heading (the `label`) and a 44px Close button, which takes focus. Escape, Close and a click on the backdrop close it, and focus returns to the button; widening the window past the breakpoint closes it and keeps focus where it was. While it is open the rest of the page, including `<site-page>`'s header, skip link and alerts, is inert (the browser's modal dialog), so focus cannot leave it except to the browser itself, and nothing else is announced. The children are the same nodes in both layouts (moved, never re-created): typed text, checked boxes, listeners and each filter's state are kept. Inert content is not announced, so results counts and status notices outside the panel would go silent while the visitor filters: name them in `live` (space-separated ids) and the drawer repeats what they announce in its own polite live region while it is open. `count` (the page's number of active filters) is shown on the button when above 0. The drawer never counts by itself: only the page knows which inputs are filters.
1033
+ A search page's form and filters: a plain sidebar on wide screens, and on narrow ones a “Search and filters” button that opens them in a modal panel from the side. Put the page's search form, `<uvalib-filter>`s and other facets inside. Above `breakpoint` (default `48rem`) they are shown as written: no button, no dialog role. At and below it only the button is shown; it opens a native `<dialog>` (`showModal()`) with a visible heading (the `label`) and a 44px Close button, which takes focus. Escape, Close and a click on the backdrop close it, and focus returns to the button; widening the window past the breakpoint closes it and keeps focus where it was. While it is open the rest of the page, including `<site-page>`'s header, skip link and alerts, is inert (the browser's modal dialog), so focus cannot leave it except to the browser itself, and nothing else is announced. The children are the same nodes in both layouts (moved, never re-created): typed text, checked boxes, listeners and each filter's state are kept. Inert content is not announced, so results counts and status notices outside the panel would go silent while the visitor filters: name them in `live` (space-separated ids) and the drawer repeats what they announce in its own polite live region while it is open. `count` (the page's number of active filters) is shown on the button when above 0. The drawer never counts by itself: only the page knows which inputs are filters. Pages can style the runtime layout with `:state(modal)` (at or below the breakpoint: the button and panel) and `:state(open)` (the panel is open).
1026
1034
 
1027
1035
  ### Attributes
1028
1036
 
@@ -1054,6 +1062,13 @@ A search page's form and filters: a plain sidebar on wide screens, and on narrow
1054
1062
  | `close` | The Close button. |
1055
1063
  | `body` | The wrapper of the children, in the sidebar or the panel. |
1056
1064
 
1065
+ ### CSS states
1066
+
1067
+ | State | Description |
1068
+ |---|---|
1069
+ | `:state(modal)` | The viewport is at or below the breakpoint: the button and panel, not the sidebar. |
1070
+ | `:state(open)` | The panel is open. |
1071
+
1057
1072
  ### Events
1058
1073
 
1059
1074
  | Event | Description |
@@ -1136,7 +1151,7 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
1136
1151
 
1137
1152
  ## `<uvalib-lightbox>`
1138
1153
 
1139
- An accessible image viewer over a set of plain links. With JavaScript a primary click opens a modal dialog; without it (or with a modified click) the link opens the image as before. Wrap the links, or point at them with `selector` (for example `a.pb-image` on a reading page). There is no autoplay and no carousel. The dialog is labelled by the caption (`data-caption`, else the image alt, else the link text). Focus moves to Close on open and back to the trigger on close. Escape and a click on the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the original image in a new tab. A IIIF Image API URL keeps its region; only the size becomes `!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for example `photo`) keeps `?photo=<id>` in sync, including on a hash route (`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and Back closes. Optional details: children with `slot="details"` (and `data-for` equal to the item's id or its position from 1; without `data-for` they show for every image), or `data-details-id` on a link pointing at an element elsewhere on the page. Either is shown inside the dialog and put back exactly (same place, `hidden` and `slot`) when the viewer moves on or closes. The `data-details-id` element stays in the page (in shadow mode it becomes a child of the lightbox slotted into the dialog), so `getElementById`, the page's CSS (except selectors through its old ancestors) and listeners keep working; nothing is cloned. Details that appear while their image is open (rendered after a fetch) are shown then. `open(idOrIndex)` and `close({ focus })` let the page open or close the viewer itself; `uvalib-lightbox-open` and `uvalib-lightbox-close` say when it did. Optional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of `{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by `;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback. The open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use) and a list of the regions beside it, with a "Show regions" toggle (`aria-pressed`) that hides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height` when set (the viewer shows a resized IIIF image), else in the image's natural size. Or the page's own list, with its own buttons: `data-regions-list="<id>"` on a link (or the `regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page, usually `hidden`. While that image is open the list (the same nodes, so the page's listeners keep working) is the region list: in shadow mode it becomes a child of the lightbox slotted into the viewer, not moved into the shadow root, so the page's CSS still applies to it. When the image changes or the viewer closes it goes back where it was, `hidden` as before. It wins over `data-regions`. Optional versions of an image (an original scan and an AI colorization, a restoration, an infrared capture): `data-versions` on a link, a JSON array of `{ label, href?, note? }` whose first entry is the link's own image, or the `versions` callback. The viewer then compares them over the photo (loaded on first use): Switch (a segmented control), Reveal (a divider: click or tap the photo, or use the slider) or Fade (a slider), `compare` choosing the first. A version's `note` shows under the photo while it is visible, and the image's accessible name ends with the label of the version shown. `version-param` (with `url-param`) keeps the comparison in the address: `?version=2` (Switch, the version from 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version shown; `wipe:40:2` compares the original with version 2). A version with a different framing (an AI-expanded frame, a crop, the whole plate) gives `frame`, the original's box in it (`percent:x,y,w,h`, or pixels of its `width` × `height`): the viewer draws every version at the original's scale in one box, the original lined up, and regions stay on it.
1154
+ An accessible image viewer over a set of plain links. With JavaScript a primary click opens a modal dialog; without it (or with a modified click) the link opens the image as before. Wrap the links, or point at them with `selector` (for example `a.pb-image` on a reading page). There is no autoplay and no carousel. The dialog is labelled by the caption (`data-caption`, else the image alt, else the link text). Focus moves to Close on open and back to the trigger on close. Escape and a click on the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the original image in a new tab. A IIIF Image API URL keeps its region; only the size becomes `!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for example `photo`) keeps `?photo=<id>` in sync, including on a hash route (`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and Back closes. Optional details: children with `slot="details"` (and `data-for` equal to the item's id or its position from 1; without `data-for` they show for every image), or `data-details-id` on a link pointing at an element elsewhere on the page. Either is shown inside the dialog and put back exactly (same place, `hidden` and `slot`) when the viewer moves on or closes. The `data-details-id` element stays in the page (in shadow mode it becomes a child of the lightbox slotted into the dialog), so `getElementById`, the page's CSS (except selectors through its old ancestors) and listeners keep working; nothing is cloned. Details that appear while their image is open (rendered after a fetch) are shown then. `open(idOrIndex)` and `close({ focus })` let the page open or close the viewer itself; `uvalib-lightbox-open` and `uvalib-lightbox-close` say when it did. Optional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of `{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by `;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback. The open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use) and a list of the regions beside it, with a "Show regions" toggle (`aria-pressed`) that hides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height` when set (the viewer shows a resized IIIF image), else in the image's natural size. Or the page's own list, with its own buttons: `data-regions-list="<id>"` on a link (or the `regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page, usually `hidden`. While that image is open the list (the same nodes, so the page's listeners keep working) is the region list: in shadow mode it becomes a child of the lightbox slotted into the viewer, not moved into the shadow root, so the page's CSS still applies to it. When the image changes or the viewer closes it goes back where it was, `hidden` as before. It wins over `data-regions`. Optional versions of an image (an original scan and an AI colorization, a restoration, an infrared capture): `data-versions` on a link, a JSON array of `{ label, href?, note? }` whose first entry is the link's own image, or the `versions` callback. The viewer then compares them over the photo (loaded on first use): Switch (a segmented control), Reveal (a divider: click or tap the photo, or use the slider) or Fade (a slider), `compare` choosing the first. A version's `note` shows under the photo while it is visible, and the image's accessible name ends with the label of the version shown. `version-param` (with `url-param`) keeps the comparison in the address: `?version=2` (Switch, the version from 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version shown; `wipe:40:2` compares the original with version 2). `data-version` on a link (the same values) opens that image on that version, from a click, `open()` or Previous and Next; an address with `version-param` wins. A version with a different framing (an AI-expanded frame, a crop, the whole plate) gives `frame`, the original's box in it (`percent:x,y,w,h`, or pixels of its `width` × `height`): the viewer draws every version at the original's scale in one box, the original lined up, and regions stay on it. Pages can style the element while the viewer is open with `:state(open)`.
1140
1155
 
1141
1156
  ### Attributes
1142
1157
 
@@ -1170,6 +1185,12 @@ An accessible image viewer over a set of plain links. With JavaScript a primary
1170
1185
  | `regions` | The `<uvalib-image-regions>` around an image with regions. |
1171
1186
  | `compare` | The version comparison controls and notes under the photo. |
1172
1187
 
1188
+ ### CSS states
1189
+
1190
+ | State | Description |
1191
+ |---|---|
1192
+ | `:state(open)` | The viewer is open. |
1193
+
1173
1194
  ### Events
1174
1195
 
1175
1196
  | Event | Description |
@@ -1378,13 +1399,13 @@ Previous/next section links, as on a reading page, or a numbered page list. Prev
1378
1399
 
1379
1400
  ## `<uvalib-photo-grid>`
1380
1401
 
1381
- Justified rows of thumbnails. Each direct child that is a link or a button is one photo; its image keeps its shape from the `width` and `height` attributes, or from the loaded image, so the row does not jump when the picture arrives. The row is about 220px tall and shorter on a phone; `row-height` sets that height. Every item stays a real link or button. An image with no visible text gets a visible caption from its alt (the caption is then the accessible name, and a repeated alt is cleared). The original alt is kept in `data-uvalib-alt` so a lightbox still describes the picture. An item with no name at all is captioned “Photo N” and warned about once; that caption is renumbered when the photos change order. An `aria-label` is left as the name: the grid does not add a caption that would disagree with it. Put the grid inside `<uvalib-lightbox>` and a plain click opens the viewer. A badge sits on the thumbnail: `<span slot="badge">` inside the link or button, or `data-badge` on that item (for example “seq” or “3 photos”). It is read after the caption (“The Lawn, 3 photos”). When the item already has an `aria-label`, the badge is appended to that label (the author’s words stay in `data-uvalib-label`) and an alt that repeats those words is cleared. A badge does not replace the alt caption.
1402
+ Justified rows of thumbnails. Each direct child that is a link or a button is one photo; its image keeps its shape from the `width` and `height` attributes, or from the loaded image, so the row does not jump when the picture arrives. The row is about 220px tall and shorter when the grid is narrow (a phone, a sidebar); `row-height` sets that height. Every item stays a real link or button. An image with no visible text gets a visible caption from its alt (the caption is then the accessible name, and a repeated alt is cleared). The original alt is kept in `data-uvalib-alt` so a lightbox still describes the picture. An item with no name at all is captioned “Photo N” and warned about once; that caption is renumbered when the photos change order. An `aria-label` is left as the name: the grid does not add a caption that would disagree with it. Put the grid inside `<uvalib-lightbox>` and a plain click opens the viewer. A badge sits on the thumbnail: `<span slot="badge">` inside the link or button, or `data-badge` on that item (for example “seq” or “3 photos”). It is read after the caption (“The Lawn, 3 photos”). When the item already has an `aria-label`, the badge is appended to that label (the author’s words stay in `data-uvalib-label`) and an alt that repeats those words is cleared. A badge does not replace the alt caption.
1382
1403
 
1383
1404
  ### Attributes
1384
1405
 
1385
1406
  | Attribute | Type | Default | Description |
1386
1407
  |---|---|---|---|
1387
- | `row-height` | `string` | `''` | Row height. A bare number is pixels (`220` is 220px); `px`, `rem`, `em`, `vh`, `vw`, `vmin`, `vmax`, `ch` and `%` are kept. Empty uses 220px, or 140px when the viewport is 767px or narrower. |
1408
+ | `row-height` | `string` | `''` | Row height. A bare number is pixels (`220` is 220px); `px`, `rem`, `em`, `vh`, `vw`, `vmin`, `vmax`, `ch` and `%` are kept. Empty uses 220px, or 140px when the grid itself is narrower than 48rem (a phone, a sidebar, a drawer). |
1388
1409
  | `no-shadow-dom` | `boolean` | `false` | |
1389
1410
  | `no-style` | `boolean` | `false` | |
1390
1411
 
@@ -1478,7 +1499,7 @@ Tabs, as on library.virginia.edu: a row of buttons over one visible panel. Each
1478
1499
 
1479
1500
  ## `<uvalib-tag-list>`
1480
1501
 
1481
- A labelled list of keywords or subjects that wraps: each tag a link (for example a search for that term) or plain text. Link tags are outlined pills in the link colour; plain tags are filled chips (the card chip's colours), so a link never looks like a label. Every tag and the toggle are at least 2rem (34px) tall and wide, 0.5rem apart. Give the tags as children: `<a href>` for a link, any other element (`<span>`) for plain text. A child's `lang` and `dir` are kept, and so is inline markup inside it (`em`, `cite`, `abbr`, `bdi`, a `span lang`…), copied element by element (never parsed as HTML). Or set `href-template` (with `{tag}`, replaced by the URL-encoded text) to make every tag without its own href a link; a blank href counts as none. Apps can set the `items` property (`{ label, href?, lang?, dir? }`) instead; it wins over the children. Children with no text are skipped with one warning. `label` names the list (shown above it, or visually hidden with `hide-label`); without one a console warning is logged. `limit` shows that many tags and a “Show all N” button (`aria-expanded`, `aria-controls`), which reveals the rest in place and keeps focus. Analytics never sends a tag's text (record tags can be user-submitted or machine-made), and by default not the label either, which a template may fill from a record: the name is the list's place among the tag lists on the page, `list N`. Add `track-label` when the label is fixed text the page author wrote (“Subjects”), to send it instead.
1502
+ A labelled list of keywords or subjects that wraps: each tag a link (for example a search for that term) or plain text. Link tags are outlined pills in the link colour; plain tags are filled chips (the card chip's colours), so a link never looks like a label. Every tag and the toggle are at least 2rem (34px) tall and wide, 0.5rem apart. Give the tags as children: `<a href>` for a link, any other element (`<span>`) for plain text. A child's `lang` and `dir` are kept, and so is inline markup inside it (`em`, `cite`, `abbr`, `bdi`, a `span lang`…), copied element by element (never parsed as HTML). Or set `href-template` (with `{tag}`, replaced by the URL-encoded text) to make every tag without its own href a link; a blank href counts as none. Apps can set the `items` property (`{ label, href?, lang?, dir? }`) instead; it wins over the children. Children with no text are skipped with one warning. `label` names the list (shown above it, or visually hidden with `hide-label`); without one a console warning is logged. `limit` shows that many tags and a “Show all N” button (`aria-expanded`, `aria-controls`), which reveals the rest in place and keeps focus. Pages can style the list while every tag is shown with `:state(expanded)`. Analytics never sends a tag's text (record tags can be user-submitted or machine-made), and by default not the label either, which a template may fill from a record: the name is the list's place among the tag lists on the page, `list N`. Add `track-label` when the label is fixed text the page author wrote (“Subjects”), to send it instead.
1482
1503
 
1483
1504
  ### Attributes
1484
1505
 
@@ -1492,6 +1513,12 @@ A labelled list of keywords or subjects that wraps: each tag a link (for example
1492
1513
  | `no-shadow-dom` | `boolean` | `false` | |
1493
1514
  | `no-style` | `boolean` | `false` | |
1494
1515
 
1516
+ ### CSS states
1517
+
1518
+ | State | Description |
1519
+ |---|---|
1520
+ | `:state(expanded)` | Show all was pressed: every tag is shown (the toggle's `aria-expanded="true"`). |
1521
+
1495
1522
  ### Events
1496
1523
 
1497
1524
  | Event | Description |
@@ -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
 
@@ -168,10 +168,16 @@ var m = 3, h = /* @__PURE__ */ new Set([
168
168
  padding: 1rem 1.25rem;
169
169
  flex: 1 1 auto;
170
170
  }
171
+ /* Short heading: balanced lines. Longer excerpt: no one-word last line. Both are
172
+ look, not structure (dropped with no-style), and ignored where unsupported. */
171
173
  .title {
172
174
  font-size: 1.25rem;
173
175
  line-height: 1.3;
174
176
  font-weight: 600;
177
+ text-wrap: balance;
178
+ }
179
+ .excerpt {
180
+ text-wrap: pretty;
175
181
  }
176
182
  .title-link {
177
183
  color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));