@uvalib/web-components 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/README.md +772 -33
- package/dist/base/analytics-state.d.ts +36 -0
- package/dist/base/analytics-state.js +44 -0
- package/dist/base/analytics-state.js.map +1 -0
- package/dist/base/analytics.d.ts +31 -27
- package/dist/base/analytics.js +48 -37
- package/dist/base/analytics.js.map +1 -1
- package/dist/base/inline-copy.d.ts +16 -0
- package/dist/base/inline-copy.js +92 -0
- package/dist/base/inline-copy.js.map +1 -0
- package/dist/base/source-children.d.ts +46 -0
- package/dist/base/source-children.js +116 -0
- package/dist/base/source-children.js.map +1 -0
- package/dist/base.css +199 -0
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -1
- package/dist/base.js.map +1 -1
- package/dist/components/bento-box/BentoSection.d.ts +1 -1
- package/dist/components/bento-box/BentoSection.js +7 -2
- package/dist/components/bento-box/BentoSection.js.map +1 -1
- package/dist/components/events-section/EventsSection.d.ts +3 -0
- package/dist/components/events-section/EventsSection.js +12 -1
- package/dist/components/events-section/EventsSection.js.map +1 -1
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.d.ts +1 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js +5 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js.map +1 -1
- package/dist/components/site-alerts/SiteAlerts.d.ts +109 -0
- package/dist/components/site-alerts/SiteAlerts.js +542 -0
- package/dist/components/site-alerts/SiteAlerts.js.map +1 -0
- package/dist/components/site-alerts/alerts-source.d.ts +36 -0
- package/dist/components/site-alerts/alerts-source.js +115 -0
- package/dist/components/site-alerts/alerts-source.js.map +1 -0
- package/dist/components/{site-page → site-alerts}/alerts.js +8 -3
- package/dist/components/site-alerts/alerts.js.map +1 -0
- package/dist/components/site-alerts/body.d.ts +10 -0
- package/dist/components/site-alerts/body.js +48 -0
- package/dist/components/site-alerts/body.js.map +1 -0
- package/dist/components/site-alerts/dismissed.d.ts +12 -0
- package/dist/components/site-alerts/dismissed.js +72 -0
- package/dist/components/site-alerts/dismissed.js.map +1 -0
- package/dist/components/site-alerts/icons.d.ts +8 -0
- package/dist/components/site-alerts/icons.js +15 -0
- package/dist/components/site-alerts/icons.js.map +1 -0
- package/dist/components/site-alerts/site-alerts.d.ts +1 -0
- package/dist/components/site-alerts/site-alerts.js +4 -0
- package/dist/components/site-alerts/site-alerts.js.map +1 -0
- package/dist/components/site-analytics/SiteAnalytics.d.ts +26 -2
- package/dist/components/site-analytics/SiteAnalytics.js +140 -4
- package/dist/components/site-analytics/SiteAnalytics.js.map +1 -1
- package/dist/components/site-footer/SiteFooter.d.ts +4 -0
- package/dist/components/site-footer/SiteFooter.js +28 -4
- package/dist/components/site-footer/SiteFooter.js.map +1 -1
- package/dist/components/site-header/SiteHeader.d.ts +47 -3
- package/dist/components/site-header/SiteHeader.js +198 -21
- package/dist/components/site-header/SiteHeader.js.map +1 -1
- package/dist/components/site-hours-section/SiteHoursSection.d.ts +4 -1
- package/dist/components/site-hours-section/SiteHoursSection.js +18 -3
- package/dist/components/site-hours-section/SiteHoursSection.js.map +1 -1
- package/dist/components/site-main-nav/SiteMainNav.d.ts +1 -1
- package/dist/components/site-main-nav/SiteMainNav.js +11 -1
- package/dist/components/site-main-nav/SiteMainNav.js.map +1 -1
- package/dist/components/site-page/SitePage.d.ts +43 -15
- package/dist/components/site-page/SitePage.js +161 -34
- package/dist/components/site-page/SitePage.js.map +1 -1
- package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.d.ts +91 -0
- package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js +310 -0
- package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js.map +1 -0
- package/dist/components/uvalib-breadcrumbs/uvalib-breadcrumbs.d.ts +1 -0
- package/dist/components/uvalib-breadcrumbs/uvalib-breadcrumbs.js +4 -0
- package/dist/components/uvalib-breadcrumbs/uvalib-breadcrumbs.js.map +1 -0
- package/dist/components/uvalib-card/UvalibCard.d.ts +113 -0
- package/dist/components/uvalib-card/UvalibCard.js +643 -0
- package/dist/components/uvalib-card/UvalibCard.js.map +1 -0
- package/dist/components/uvalib-card/uvalib-card.d.ts +1 -0
- package/dist/components/uvalib-card/uvalib-card.js +4 -0
- package/dist/components/uvalib-card/uvalib-card.js.map +1 -0
- package/dist/components/uvalib-card-grid/UvalibCardGrid.d.ts +60 -0
- package/dist/components/uvalib-card-grid/UvalibCardGrid.js +305 -0
- package/dist/components/uvalib-card-grid/UvalibCardGrid.js.map +1 -0
- package/dist/components/uvalib-card-grid/uvalib-card-grid.d.ts +1 -0
- package/dist/components/uvalib-card-grid/uvalib-card-grid.js +4 -0
- package/dist/components/uvalib-card-grid/uvalib-card-grid.js.map +1 -0
- package/dist/components/uvalib-contents/UvalibContents.d.ts +134 -0
- package/dist/components/uvalib-contents/UvalibContents.js +613 -0
- package/dist/components/uvalib-contents/UvalibContents.js.map +1 -0
- package/dist/components/uvalib-contents/uvalib-contents.d.ts +1 -0
- package/dist/components/uvalib-contents/uvalib-contents.js +4 -0
- package/dist/components/uvalib-contents/uvalib-contents.js.map +1 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +10 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js +21 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -1
- package/dist/components/uvalib-filter/UvalibFilter.d.ts +1 -0
- package/dist/components/uvalib-filter/UvalibFilter.js +11 -1
- package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -1
- package/dist/components/uvalib-lightbox/UvalibLightbox.d.ts +204 -0
- package/dist/components/uvalib-lightbox/UvalibLightbox.js +1115 -0
- package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -0
- package/dist/components/uvalib-lightbox/media.d.ts +51 -0
- package/dist/components/uvalib-lightbox/media.js +127 -0
- package/dist/components/uvalib-lightbox/media.js.map +1 -0
- package/dist/components/uvalib-lightbox/uvalib-lightbox.d.ts +1 -0
- package/dist/components/uvalib-lightbox/uvalib-lightbox.js +4 -0
- package/dist/components/uvalib-lightbox/uvalib-lightbox.js.map +1 -0
- package/dist/components/uvalib-metadata/UvalibMetadata.d.ts +124 -0
- package/dist/components/uvalib-metadata/UvalibMetadata.js +443 -0
- package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -0
- package/dist/components/uvalib-metadata/rights.d.ts +8 -0
- package/dist/components/uvalib-metadata/rights.js +47 -0
- package/dist/components/uvalib-metadata/rights.js.map +1 -0
- package/dist/components/uvalib-metadata/uvalib-metadata.d.ts +1 -0
- package/dist/components/uvalib-metadata/uvalib-metadata.js +4 -0
- package/dist/components/uvalib-metadata/uvalib-metadata.js.map +1 -0
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.d.ts +103 -0
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js +410 -0
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js.map +1 -0
- package/dist/components/uvalib-pagefind-search/uvalib-pagefind-search.d.ts +1 -0
- package/dist/components/uvalib-pagefind-search/uvalib-pagefind-search.js +7 -0
- package/dist/components/uvalib-pagefind-search/uvalib-pagefind-search.js.map +1 -0
- package/dist/components/uvalib-pager/UvalibPager.d.ts +94 -0
- package/dist/components/uvalib-pager/UvalibPager.js +390 -0
- package/dist/components/uvalib-pager/UvalibPager.js.map +1 -0
- package/dist/components/uvalib-pager/uvalib-pager.d.ts +1 -0
- package/dist/components/uvalib-pager/uvalib-pager.js +4 -0
- package/dist/components/uvalib-pager/uvalib-pager.js.map +1 -0
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.d.ts +59 -0
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js +350 -0
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js.map +1 -0
- package/dist/components/uvalib-photo-grid/uvalib-photo-grid.d.ts +1 -0
- package/dist/components/uvalib-photo-grid/uvalib-photo-grid.js +4 -0
- package/dist/components/uvalib-photo-grid/uvalib-photo-grid.js.map +1 -0
- package/dist/custom-elements.json +10916 -3049
- package/dist/index.d.ts +16 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/pagefind.css +388 -0
- package/dist/styles/base.js +11 -0
- package/dist/styles/base.js.map +1 -1
- package/dist/styles/color-scheme.js +24 -11
- package/dist/styles/color-scheme.js.map +1 -1
- package/dist/styles/controls.d.ts +2 -0
- package/dist/styles/controls.js +200 -0
- package/dist/styles/controls.js.map +1 -0
- package/dist/styles/pagefind.d.ts +1 -0
- package/dist/styles/pagefind.js +395 -0
- package/dist/styles/pagefind.js.map +1 -0
- package/dist/tokens.css +23 -20
- package/dist-cdn/base.css +199 -0
- package/dist-cdn/bento-box.js +103 -95
- package/dist-cdn/bento-box.js.map +1 -1
- package/dist-cdn/chunks/SiteAnalytics-Cm-FyhYS.js +243 -0
- package/dist-cdn/chunks/SiteAnalytics-Cm-FyhYS.js.map +1 -0
- package/dist-cdn/chunks/alerts-C5vkeb-f.js +39 -0
- package/dist-cdn/chunks/alerts-C5vkeb-f.js.map +1 -0
- package/dist-cdn/chunks/analytics-DTTihuBD.js +43 -0
- package/dist-cdn/chunks/analytics-DTTihuBD.js.map +1 -0
- package/dist-cdn/chunks/analytics-state-Ce8DKe4F.js +39 -0
- package/dist-cdn/chunks/analytics-state-Ce8DKe4F.js.map +1 -0
- package/dist-cdn/chunks/{base-DCGd2Oii.js → base-CAFQWnZG.js} +12 -1
- package/dist-cdn/chunks/{base-DCGd2Oii.js.map → base-CAFQWnZG.js.map} +1 -1
- package/dist-cdn/chunks/{library-weekly-hours-ByQ8ugxh.js → library-weekly-hours-COE7Vv6V.js} +47 -38
- package/dist-cdn/chunks/library-weekly-hours-COE7Vv6V.js.map +1 -0
- package/dist-cdn/chunks/{site-header-BwDkZ2LL.js → site-header-C9V7Wuw2.js} +169 -49
- package/dist-cdn/chunks/site-header-C9V7Wuw2.js.map +1 -0
- package/dist-cdn/chunks/{site-main-nav-BLAAunnr.js → site-main-nav-AaxZ9rQf.js} +11 -2
- package/dist-cdn/chunks/site-main-nav-AaxZ9rQf.js.map +1 -0
- package/dist-cdn/chunks/source-children-RuAec527.js +119 -0
- package/dist-cdn/chunks/source-children-RuAec527.js.map +1 -0
- package/dist-cdn/custom-elements.json +10916 -3049
- package/dist-cdn/events-section.js +78 -66
- package/dist-cdn/events-section.js.map +1 -1
- package/dist-cdn/library-hours-setup.js +1 -1
- package/dist-cdn/library-weekly-hours.js +1 -1
- package/dist-cdn/manifest.json +13 -2
- package/dist-cdn/pagefind.css +388 -0
- package/dist-cdn/site-alerts.js +516 -0
- package/dist-cdn/site-alerts.js.map +1 -0
- package/dist-cdn/site-analytics.js +1 -1
- package/dist-cdn/site-footer.js +33 -18
- package/dist-cdn/site-footer.js.map +1 -1
- package/dist-cdn/site-header.js +1 -1
- package/dist-cdn/site-hours-section.js +33 -21
- package/dist-cdn/site-hours-section.js.map +1 -1
- package/dist-cdn/site-main-nav.js +1 -1
- package/dist-cdn/site-page.js +116 -81
- package/dist-cdn/site-page.js.map +1 -1
- package/dist-cdn/site-style.js +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +394 -11
- package/dist-cdn/skills/uvalib-web-components/reference/accessibility-testing.md +170 -0
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +414 -12
- package/dist-cdn/skills/uvalib-web-components/reference/migration.md +15 -0
- package/dist-cdn/tokens.css +23 -20
- package/dist-cdn/uvalib-analytics.js +1 -1
- package/dist-cdn/uvalib-breadcrumbs.js +176 -0
- package/dist-cdn/uvalib-breadcrumbs.js.map +1 -0
- package/dist-cdn/uvalib-card-grid.js +163 -0
- package/dist-cdn/uvalib-card-grid.js.map +1 -0
- package/dist-cdn/uvalib-card.js +424 -0
- package/dist-cdn/uvalib-card.js.map +1 -0
- package/dist-cdn/uvalib-contents.js +381 -0
- package/dist-cdn/uvalib-contents.js.map +1 -0
- package/dist-cdn/uvalib-date-range.js +33 -18
- package/dist-cdn/uvalib-date-range.js.map +1 -1
- package/dist-cdn/uvalib-filter.js +32 -11
- package/dist-cdn/uvalib-filter.js.map +1 -1
- package/dist-cdn/uvalib-lightbox.js +662 -0
- package/dist-cdn/uvalib-lightbox.js.map +1 -0
- package/dist-cdn/uvalib-metadata.js +313 -0
- package/dist-cdn/uvalib-metadata.js.map +1 -0
- package/dist-cdn/uvalib-pagefind-search.js +207 -0
- package/dist-cdn/uvalib-pagefind-search.js.map +1 -0
- package/dist-cdn/uvalib-pager.js +278 -0
- package/dist-cdn/uvalib-pager.js.map +1 -0
- package/dist-cdn/uvalib-photo-grid.js +202 -0
- package/dist-cdn/uvalib-photo-grid.js.map +1 -0
- package/package.json +43 -1
- package/skills/uvalib-web-components/SKILL.md +394 -11
- package/skills/uvalib-web-components/reference/accessibility-testing.md +170 -0
- package/skills/uvalib-web-components/reference/components.md +414 -12
- package/skills/uvalib-web-components/reference/migration.md +15 -0
- package/dist/components/site-page/alerts.js.map +0 -1
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js +0 -174
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js.map +0 -1
- package/dist-cdn/chunks/analytics-C8D8n_wt.js +0 -55
- package/dist-cdn/chunks/analytics-C8D8n_wt.js.map +0 -1
- package/dist-cdn/chunks/library-weekly-hours-ByQ8ugxh.js.map +0 -1
- package/dist-cdn/chunks/site-header-BwDkZ2LL.js.map +0 -1
- package/dist-cdn/chunks/site-main-nav-BLAAunnr.js.map +0 -1
- /package/dist/components/{site-page → site-alerts}/alerts.d.ts +0 -0
|
@@ -23,7 +23,7 @@ Virgo's first article results for `query`. Articles Virgo hides from guests keep
|
|
|
23
23
|
|---|---|
|
|
24
24
|
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
25
25
|
| `uvalib-analytics-search` | For `<site-analytics>`: once per settled search (results or none, not an error): the query, the section's `analyticsName` as category and its total when known. Bubbles and is composed. |
|
|
26
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; never titles or URLs. Bubbles and is composed. |
|
|
26
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; `['bento-box', 'retry', <section>]` for its Retry button; `['bento-box', 'error', 'section-load: <section>']` once when its results cannot be loaded; never titles or URLs. Bubbles and is composed. |
|
|
27
27
|
|
|
28
28
|
### CSS custom properties
|
|
29
29
|
|
|
@@ -87,7 +87,7 @@ The Virgo catalog's first results for `query` (books, journals, archives, maps,
|
|
|
87
87
|
|---|---|
|
|
88
88
|
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
89
89
|
| `uvalib-analytics-search` | For `<site-analytics>`: once per settled search (results or none, not an error): the query, the section's `analyticsName` as category and its total when known. Bubbles and is composed. |
|
|
90
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; never titles or URLs. Bubbles and is composed. |
|
|
90
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; `['bento-box', 'retry', <section>]` for its Retry button; `['bento-box', 'error', 'section-load: <section>']` once when its results cannot be loaded; never titles or URLs. Bubbles and is composed. |
|
|
91
91
|
|
|
92
92
|
### CSS custom properties
|
|
93
93
|
|
|
@@ -116,6 +116,12 @@ Upcoming UVA Library events from LibCal, as on the library.virginia.edu home pag
|
|
|
116
116
|
| `no-shadow-dom` | `boolean` | `false` | |
|
|
117
117
|
| `no-style` | `boolean` | `false` | |
|
|
118
118
|
|
|
119
|
+
### Events
|
|
120
|
+
|
|
121
|
+
| Event | Description |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a click on an event, `['events-section', 'event-click', <category id, or all>, <position, from 1>]` (never its title or URL), and `['events-section', 'error', 'events-load']` once when the events cannot be loaded. Bubbles and is composed. |
|
|
124
|
+
|
|
119
125
|
### CSS custom properties
|
|
120
126
|
|
|
121
127
|
| Property | Default | Description |
|
|
@@ -150,7 +156,7 @@ The first subject guide pages (LibGuides) matching `query`: the page and its gui
|
|
|
150
156
|
|---|---|
|
|
151
157
|
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
152
158
|
| `uvalib-analytics-search` | For `<site-analytics>`: once per settled search (results or none, not an error): the query, the section's `analyticsName` as category and its total when known. Bubbles and is composed. |
|
|
153
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; never titles or URLs. Bubbles and is composed. |
|
|
159
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; `['bento-box', 'retry', <section>]` for its Retry button; `['bento-box', 'error', 'section-load: <section>']` once when its results cannot be loaded; never titles or URLs. Bubbles and is composed. |
|
|
154
160
|
|
|
155
161
|
### CSS custom properties
|
|
156
162
|
|
|
@@ -190,6 +196,12 @@ One library's opening hours for a week (Sunday to Saturday, in America/New_York)
|
|
|
190
196
|
|---|---|
|
|
191
197
|
| `building-hours` | The "Building hours" table row (shadow mode). |
|
|
192
198
|
|
|
199
|
+
### Events
|
|
200
|
+
|
|
201
|
+
| Event | Description |
|
|
202
|
+
|---|---|
|
|
203
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['library-weekly-hours', 'week-change', 'next' \| 'previous']` for the week buttons, and `['library-weekly-hours', 'error', 'hours-load']` once when the hours cannot be loaded. Bubbles and is composed. |
|
|
204
|
+
|
|
193
205
|
### CSS custom properties
|
|
194
206
|
|
|
195
207
|
| Property | Default | Description |
|
|
@@ -203,9 +215,47 @@ One library's opening hours for a week (Sunday to Saturday, in America/New_York)
|
|
|
203
215
|
| `--uva-color-surface-raised` | | Dark-mode role token: button background (else #fff). |
|
|
204
216
|
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
205
217
|
|
|
218
|
+
## `<site-alerts>`
|
|
219
|
+
|
|
220
|
+
Live UVA Library alerts, drawn as library.virginia.edu draws them. The alerts project (github.com/uvalib/uvalib-alerts) keeps the data: a headless `<uvalib-alerts>` loaded at runtime from the alerts CDN (`alerts-env`, or `alerts-src`), one per document, shared by every `<site-alerts>` and created hidden at the end of `<body>`. It keeps the live connection, the dismissals (per site, synced across tabs) and the regional matching (the page URL, followed through single-page-app navigation). If its script fails to load, one console warning is logged and nothing is shown. `show` picks the alerts: `header` (the banner: a polite `role="status"` row on teal), `list` (critical, warning and information alerts, most severe first; only critical ones are an assertive `role="alert"`), `regional` (alerts targeted at this page), `sitewide` (header and list) or `all` (the default). Each list alert has a decorative icon and a visually hidden "Critical:", "Warning:" or "Information:" before its title, a heading (`heading-level`, default 2, as on library.virginia.edu). Warning and information alerts have a dismiss button; after a dismissal focus moves to the next alert's button (or the alert), else to the page's `<main>`, never to `<body>`. Alert bodies are server-sanitized HTML, re-sanitized with the browser's `setHTML()` where it exists. `<site-page>` places three of these itself (banner, list band, regional); use this element directly only on pages without `<site-page>`.
|
|
221
|
+
|
|
222
|
+
### Attributes
|
|
223
|
+
|
|
224
|
+
| Attribute | Type | Default | Description |
|
|
225
|
+
|---|---|---|---|
|
|
226
|
+
| `show` | `SiteAlertsShow` | `'all'` | Which alerts to show: `header`, `list`, `regional`, `sitewide` (header and list) or `all`. |
|
|
227
|
+
| `alerts-env` | `string` | `'production'` | Alerts environment: `production` (default) or `staging`. Any other value logs one console warning and uses production. Ignored when `alerts-src` is set. |
|
|
228
|
+
| `alerts-src` | `string \| undefined` | | Alerts base URL (holding `config.json`, `alerts.json` and `v1/uvalib-alerts.js`); overrides `alerts-env`. For a custom domain, local development and tests. |
|
|
229
|
+
| `heading-level` | | `DEFAULT_LEVEL` | The level of each list alert's title heading, 1 to 6 (default 2). |
|
|
230
|
+
| `storage-key` | `string \| undefined` | | The localStorage key for dismissed alerts, passed to the headless element (default: the alerts project's, `uvalib-alerts-seen`). Elements with different keys use different headless elements. |
|
|
231
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
232
|
+
| `no-style` | `boolean` | `false` | |
|
|
233
|
+
|
|
234
|
+
### Events
|
|
235
|
+
|
|
236
|
+
| Event | Description |
|
|
237
|
+
|---|---|
|
|
238
|
+
| `site-alerts-change` | The number of alerts this element shows changed: `detail` is `{ count }`. Bubbles and is composed. The host also has `data-empty` while it shows none. |
|
|
239
|
+
|
|
240
|
+
### CSS custom properties
|
|
241
|
+
|
|
242
|
+
| Property | Default | Description |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| `--uva-teal` | `#25cad3` | Header banner background. |
|
|
245
|
+
| `--uva-red-100` | `#fbcfda` | Critical alert background (`--uva-red-B` #b30000 border). |
|
|
246
|
+
| `--uva-yellow-100` | `#fef6c8` | Warning alert and regional alert background (`--uva-yellow` #ecc602 border). |
|
|
247
|
+
| `--uva-blue-alt-300` | `#bfe7f7` | Information alert background (`--uva-blue-alt` #007bac border). |
|
|
248
|
+
| `--uva-teal-200` | `#c8f2f4` | Information regional alert background (`--uva-teal` border). |
|
|
249
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Alert text. |
|
|
250
|
+
| `--uva-blue-alt-B` | `#141e3c` | Links in alert text. |
|
|
251
|
+
| `--uva-color-alert-text` | | Dark-mode role token: alert text, icons and focus ring (else `--uva-grey-darkest`; the banner's is `--uva-color-alert-header-text`, else #000). |
|
|
252
|
+
| `--uva-color-alert-link` | | Dark-mode role token: links in alert text (else `--uva-blue-alt-B`). |
|
|
253
|
+
| `--uva-color-alert-header-bg` | | Dark-mode role token: banner background (else `--uva-teal`). |
|
|
254
|
+
| `--uva-color-alert-critical-bg` | | Dark-mode role token: critical alert background; `-border` for its border. Also `--uva-color-alert-warning-*`, `--uva-color-alert-info-*`, `--uva-color-alert-regional-*` and `--uva-color-alert-regional-info-*`. |
|
|
255
|
+
|
|
206
256
|
## `<site-analytics>`
|
|
207
257
|
|
|
208
|
-
Matomo analytics, with no visual output. Loads matomo.js for the site and records the page view, then forwards the events below, fired anywhere in the page, to Matomo. Every call goes through Matomo's `_paq` queue, so events fired before matomo.js loads are kept. One tracker per page: however many `<site-analytics>` and `<uvalib-analytics>` elements there are (from any copy of this library), matomo.js is loaded and the page view recorded once, and only one element forwards each event; if it is removed, the next takes over. A Matomo snippet already on the page is used as it is (nothing is loaded or recorded again). The same element is registered as `<uvalib-analytics>` by `uvalib-analytics.js`.
|
|
258
|
+
Matomo analytics, with no visual output. Loads matomo.js for the site and records the page view, then forwards the events below, fired anywhere in the page, to Matomo. Every call goes through Matomo's `_paq` queue, so events fired before matomo.js loads are kept. One tracker per page: however many `<site-analytics>` and `<uvalib-analytics>` elements there are (from any copy of this library), matomo.js is loaded and the page view recorded once, and only one element forwards each event; if it is removed, the next takes over. A Matomo snippet already on the page is used as it is (nothing is loaded or recorded again). When the browser sends Do Not Track or Global Privacy Control, or the page has `<html data-uvalib-analytics="off">`, it loads nothing and records nothing. A click on an element with `data-uvalib-track="category,action[,name[,value]]"` (or inside one, in light or shadow DOM) sends that event, unless `<html data-uvalib-analytics="off">` or a `no-analytics` ancestor opts it out. The same element is registered as `<uvalib-analytics>` by `uvalib-analytics.js`.
|
|
209
259
|
|
|
210
260
|
### Attributes
|
|
211
261
|
|
|
@@ -213,7 +263,7 @@ Matomo analytics, with no visual output. Loads matomo.js for the site and record
|
|
|
213
263
|
|---|---|---|---|
|
|
214
264
|
| `matomourl` | `string` | `'https://analytics.lib.virginia.edu/'` | The Matomo server, ending in `/` (attribute `matomourl`). |
|
|
215
265
|
| `matomoid` | `number \| undefined` | | The Matomo site id (attribute `matomoid`). Default: the site whose URL the page is under. |
|
|
216
|
-
| `spa` | `boolean` | `false` | A single-page app records its own page views (`uvalib-analytics-pageview`)
|
|
266
|
+
| `spa` | `boolean \| 'auto'` | `false` | A single-page app. `spa` (no value): it records its own page views (`uvalib-analytics-pageview`), none on load. `spa="auto"`: a page view on load and one per same-document route change (hash change, Back and Forward, `history.pushState`), once the title has settled, never twice in a row for the same URL, with the previous URL as the referrer. Either way Matomo's link tracking is off. |
|
|
217
267
|
| `variables` | `Record<string, unknown> \| null` | `null` | Custom dimensions, a JSON object of `{ id: value }`, set before the page view. |
|
|
218
268
|
| `no-shadow-dom` | `boolean` | `false` | |
|
|
219
269
|
| `no-style` | `boolean` | `false` | |
|
|
@@ -225,9 +275,11 @@ Matomo analytics, with no visual output. Loads matomo.js for the site and record
|
|
|
225
275
|
| `uvalib-analytics-pageview` | Listened for on `document` (not fired): records a page view; `detail` is `{ customTitle?, referrer? }` (default: the document's title and referrer; a referrer without `http` is taken as a path on this origin). |
|
|
226
276
|
| `uvalib-analytics-search` | Listened for on `document` (not fired): a Matomo site search; `detail` is `{ searchQuery, searchCategory?, resultCount? }`. |
|
|
227
277
|
| `uvalib-analytics-event` | Listened for on `document` (not fired): a Matomo event; `detail` is `{ event: [category, action, name?, value?] }` (`track` is the old name of `event`). |
|
|
278
|
+
| `uvalib-analytics-content` | Listened for on `document` (not fired): a Matomo content impression; `detail` is `{ name, piece, target?, interaction? }` (with `interaction`, a content interaction instead). |
|
|
228
279
|
| `site-analytics-pageview` | Listened for on `document` too: the same as `uvalib-analytics-pageview`. |
|
|
229
280
|
| `site-analytics-search` | Listened for on `document` too: the same as `uvalib-analytics-search`. |
|
|
230
281
|
| `site-analytics-event` | Listened for on `document` too: the same as `uvalib-analytics-event`. |
|
|
282
|
+
| `site-analytics-content` | Listened for on `document` too: the same as `uvalib-analytics-content`. |
|
|
231
283
|
|
|
232
284
|
## `<site-footer>`
|
|
233
285
|
|
|
@@ -253,6 +305,12 @@ UVA Library site footer: link columns, contact details and copyright.
|
|
|
253
305
|
|---|---|
|
|
254
306
|
| `footer` | The `<footer>` element. |
|
|
255
307
|
|
|
308
|
+
### Events
|
|
309
|
+
|
|
310
|
+
| Event | Description |
|
|
311
|
+
|---|---|
|
|
312
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a click on one of the footer's own links (not the pre-footer's), `['site-footer', 'link-click', '<Column>: <Link>']`, for example `Using the Library: Get help`; the phone and email links are `Contact us: Phone` and `Contact us: Email`, the social links `Social: Facebook` and `Social: Instagram`. Never a URL. Bubbles and is composed. |
|
|
313
|
+
|
|
256
314
|
### CSS custom properties
|
|
257
315
|
|
|
258
316
|
| Property | Default | Description |
|
|
@@ -266,7 +324,7 @@ UVA Library site footer: link columns, contact details and copyright.
|
|
|
266
324
|
|
|
267
325
|
## `<site-header>`
|
|
268
326
|
|
|
269
|
-
UVA Library site header: logo, utility navigation, and a popover menu on narrow screens. A site can replace the library utility links (My account, Ask a Librarian, Hours, Give, Alerts, Search) with its own: give the header `<a slot="site-links" href="…">` children. They are shown, in order, in the inline nav and the Menu popover, with `href` as written (not joined to `root-link-domain`) and their `aria-current`, `target`, `rel` and `hreflang`. The source anchors themselves stay hidden. Children that are not `<a href>` with text (empty or whitespace-only text counts as none) are ignored with one console warning. The `vendor` variant ignores site links and keeps its own reduced link set. The full header also shows the UVA Library main navigation (`<site-main-nav>`): a row under the logo row on wide screens, and an accordion at the top of the Menu popover on narrow ones (992px and below), above the utility or site links. `no-main-nav` turns it off, leaving the header exactly as it was without it; the `vendor` variant never shows it. A `<nav slot="main-nav">` child replaces its links (see `<site-main-nav>`), and `main-nav-src` loads them from JSON; `main-nav-current` sets the URL marked current. `color-scheme-switch` opts in to dark mode (off by default; see the README's "Dark mode"): a Light / Dark / System radio group ("Theme") at the end of the utility-links row on wide screens and at the bottom of the Menu popover on narrow ones. The `vendor` variant, which has no Menu, shows it after its inline link, on a row of its own under the logo row on narrow screens. In dark mode the logo is the reversed (white) one.
|
|
327
|
+
UVA Library site header: logo, utility navigation, and a popover menu on narrow screens. A site can replace the library utility links (My account, Ask a Librarian, Hours, Give, Alerts, Search) with its own: give the header `<a slot="site-links" href="…">` children. They are shown, in order, in the inline nav and the Menu popover, with `href` as written (not joined to `root-link-domain`) and their `aria-current`, `target`, `rel` and `hreflang`. The source anchors themselves stay hidden. Children that are not `<a href>` with text (empty or whitespace-only text counts as none) are ignored with one console warning. The `vendor` variant ignores site links and keeps its own reduced link set. The full header also shows the UVA Library main navigation (`<site-main-nav>`): a row under the logo row on wide screens, and an accordion at the top of the Menu popover on narrow ones (992px and below), above the utility or site links. `no-main-nav` turns it off, leaving the header exactly as it was without it; the `vendor` variant never shows it. A `<nav slot="main-nav">` child replaces its links (see `<site-main-nav>`), and `main-nav-src` loads them from JSON; `main-nav-current` sets the URL marked current. `color-scheme-switch` opts in to dark mode (off by default; see the README's "Dark mode"): a Light / Dark / System radio group ("Theme") at the end of the utility-links row on wide screens and at the bottom of the Menu popover on narrow ones. The `vendor` variant, which has no Menu, shows it after its inline link, on a row of its own under the logo row on narrow screens. In dark mode the logo is the reversed (white) one. `site-name` shows a sub-site's name after the logo, past a thin divider, as a link to the site's home (`site-name-href`, default `/`); the logo still links to library.virginia.edu. The name is not a heading (the page keeps its own `<h1>`) and its link is named "<name> home". On wide screens it sits in the logo row, wrapping to at most two lines (keep it short), so the header is no taller, while the links (and theme control) fit beside it on one line; when they would not, and at 992px and below, it gets its own lines under the logo, so the links are laid out exactly as without it. The `vendor` variant shows it too.
|
|
270
328
|
|
|
271
329
|
### Attributes
|
|
272
330
|
|
|
@@ -275,6 +333,8 @@ UVA Library site header: logo, utility navigation, and a popover menu on narrow
|
|
|
275
333
|
| `root-link-domain` | `string` | `'https://www.library.virginia.edu'` | |
|
|
276
334
|
| `variant` | `'full' \| 'vendor'` | `'full'` | |
|
|
277
335
|
| `site-links-label` | `string \| undefined` | | Accessible name of the nav when site links replace the utility links (default "Site"; the popover nav's name adds " menu"). |
|
|
336
|
+
| `site-name` | `string \| undefined` | | The sub-site's name, shown after the library logo as a link to the site's home (`site-name-href`). The logo still links to library.virginia.edu. Not a heading. |
|
|
337
|
+
| `site-name-href` | `string \| undefined` | | Where the site name links (default `/`, the site's own home). |
|
|
278
338
|
| `no-main-nav` | `boolean` | `false` | Hide the UVA Library main navigation (the row under the logo and the popover accordion). |
|
|
279
339
|
| `main-nav-label` | `string \| undefined` | | Accessible name of the main navigation (default "Main"). |
|
|
280
340
|
| `main-nav-src` | `string \| undefined` | | URL of JSON main navigation items (`MainNavItem[]`, needs CORS), passed to `<site-main-nav items-src>`. |
|
|
@@ -288,7 +348,7 @@ UVA Library site header: logo, utility navigation, and a popover menu on narrow
|
|
|
288
348
|
| Slot | Description |
|
|
289
349
|
|---|---|
|
|
290
350
|
| `skip-link` | Shadow mode only: optional skip link, rendered first inside `<header>` (`<site-page>` uses it). |
|
|
291
|
-
| `alerts` | Optional alert banner (`<site-page>` passes its `<
|
|
351
|
+
| `alerts` | Optional alert banner (`<site-page>` passes its `<site-alerts show="header">`), shown as a full-bleed row at the very top of `<header>` (flush with its top and both edges, outside its padding), after the skip link and before the logo row. In light mode the children are moved to the start of `<header>`. The header never loads alerts itself. |
|
|
292
352
|
| `main-nav` | Optional `<nav>` whose `<ul>` replaces the main navigation's links in both layouts: `<li><a href>` for a direct link, `<li><span>Group</span><ul><li><a href>…</a></li></ul></li>` for a group. Invalid entries are skipped with one console warning. Never shown itself; in light mode it is moved into a hidden holder. Ignored with `no-main-nav` and by the `vendor` variant. |
|
|
293
353
|
| `site-links` | Optional `<a href>` elements with text that replace the library utility links in the inline nav and the Menu popover (ignored by the `vendor` variant). In light mode they are moved into a hidden holder. |
|
|
294
354
|
|
|
@@ -303,7 +363,7 @@ UVA Library site header: logo, utility navigation, and a popover menu on narrow
|
|
|
303
363
|
| Event | Description |
|
|
304
364
|
|---|---|
|
|
305
365
|
| `site-main-nav-error` | `main-nav-src` could not be loaded; the bundled main navigation is shown. `detail` is `{ src, message }`. Fired once, from the bar's `<site-main-nav>`; bubbles and is composed. |
|
|
306
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: the visitor picked a colour scheme, `['site-header', 'color-scheme', 'light' \| 'dark' \| 'system']` (not the initial value), and the main navigation's menu opens (see `<site-main-nav>`). Bubbles and is composed. |
|
|
366
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: the visitor picked a colour scheme, `['site-header', 'color-scheme', 'light' \| 'dark' \| 'system']` (not the initial value); `['site-header', 'link-click', <label>]` for a utility or site link, `['site-header', 'logo-click']`, `['site-header', 'site-name-click']` (the `site-name` link), `['site-header', 'skip-link']` (a slotted skip link) and `['site-header', 'menu-open']` when the Menu popover opens; and the main navigation's menu opens and link clicks (see `<site-main-nav>`). Never a URL. Bubbles and is composed. |
|
|
307
367
|
|
|
308
368
|
### CSS custom properties
|
|
309
369
|
|
|
@@ -343,6 +403,7 @@ Today's hours for the UVA libraries, as on the library.virginia.edu home page: t
|
|
|
343
403
|
|---|---|
|
|
344
404
|
| `got-library-hours` | The hours were loaded. `detail` is `{ message }`. Bubbles and is composed. |
|
|
345
405
|
| `got-libraries` | The libraries were loaded (fired after `got-library-hours`). `detail` is `{ message }`. Bubbles and is composed. |
|
|
406
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['site-hours-section', 'link-click', 'See all hours']` for a "See all hours" link, and `['site-hours-section', 'error', 'hours-load']` once when the libraries or their hours cannot be loaded. Bubbles and is composed. |
|
|
346
407
|
|
|
347
408
|
### CSS custom properties
|
|
348
409
|
|
|
@@ -381,7 +442,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
|
|
|
381
442
|
| Event | Description |
|
|
382
443
|
|---|---|
|
|
383
444
|
| `site-main-nav-error` | `items-src` could not be loaded: both attempts failed (network error, a 10 s timeout per attempt, or no valid entries), after about 21 s at worst; the nav shows the bundled snapshot. `detail` is `{ src, message }`. Bubbles and is composed. |
|
|
384
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: a group was opened, `['site-main-nav', 'menu-open', <the group's label>]` (not on close). Bubbles and is composed. |
|
|
445
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a group was opened, `['site-main-nav', 'menu-open', <the group's label>]` (not on close), and a link was clicked, `['site-main-nav', 'link-click', '<Group> > <Link>']` (a top-level link: its label alone; never the URL). Bubbles and is composed. |
|
|
385
446
|
|
|
386
447
|
### CSS custom properties
|
|
387
448
|
|
|
@@ -403,7 +464,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
|
|
|
403
464
|
|
|
404
465
|
## `<site-page>`
|
|
405
466
|
|
|
406
|
-
Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles. Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`. The header shows the UVA Library main navigation by default (`no-main-nav` turns it off; `header-variant="vendor"` never shows it). Shows live UVA Library alerts by default, placed as Virgo places them: a full-bleed `<
|
|
467
|
+
Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles. Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`. The header shows the UVA Library main navigation by default (`no-main-nav` turns it off; `header-variant="vendor"` never shows it). Shows live UVA Library alerts by default with `<site-alerts>` (its code loads only then), placed as Virgo places them: a full-bleed `<site-alerts show="header">` banner at the top of the header landmark (after the skip link), a full-bleed band between the header and `<main>` holding `<site-alerts show="list">` (a `<section aria-label="Library alerts">` region, hidden while the list has nothing to show), and `<site-alerts show="regional">` as the first child of `<main>`, inside its padding. Their data comes from one headless `<uvalib-alerts>`, loaded once per document, with a module script, from the alerts CDN (`alerts-env`, or `alerts-src`); if it fails to load, one console warning is logged and the page works as before. `no-alerts` renders no alert elements and loads nothing. A `slot="breadcrumbs"` child (a `<uvalib-breadcrumbs>`) is placed where library.virginia.edu puts the trail: after the header and the alert list band, before `<main>` and outside it (so the skip link lands past it), with the same gutters as `<main>`.
|
|
407
468
|
|
|
408
469
|
### Attributes
|
|
409
470
|
|
|
@@ -414,6 +475,8 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
|
|
|
414
475
|
| `no-global-styles` | `boolean` | `false` | |
|
|
415
476
|
| `no-footer` | `boolean` | `false` | Hide the footer (and any pre-footer band), for tools and app-like pages where the site footer does not belong. The footer is kept hidden rather than removed, so toggling the attribute keeps pre-footer content. |
|
|
416
477
|
| `site-links-label` | `string \| undefined` | | Accessible name of the header navigation when site links are given (default "Site"). |
|
|
478
|
+
| `site-name` | `string \| undefined` | | The sub-site's name, forwarded to `<site-header site-name>`: shown after the logo as a link to the site's home. |
|
|
479
|
+
| `site-name-href` | `string \| undefined` | | Where the site name links, forwarded to `<site-header site-name-href>` (default `/`). |
|
|
417
480
|
| `no-main-nav` | `boolean` | `false` | Hide the UVA Library main navigation in the header. |
|
|
418
481
|
| `main-nav-label` | `string \| undefined` | | Accessible name of the header's main navigation (default "Main"). |
|
|
419
482
|
| `main-nav-src` | `string \| undefined` | | URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. |
|
|
@@ -432,6 +495,7 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
|
|
|
432
495
|
| Slot | Description |
|
|
433
496
|
|---|---|
|
|
434
497
|
| (default) | Main page content, rendered inside the single `<main>`. |
|
|
498
|
+
| `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>`. |
|
|
435
499
|
| `pre-footer` | Optional content shown in a band above the footer. |
|
|
436
500
|
| `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"`. |
|
|
437
501
|
| `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"`. |
|
|
@@ -498,7 +562,7 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
|
|
|
498
562
|
|---|---|---|---|
|
|
499
563
|
| `matomourl` | `string` | `'https://analytics.lib.virginia.edu/'` | The Matomo server, ending in `/` (attribute `matomourl`). |
|
|
500
564
|
| `matomoid` | `number \| undefined` | | The Matomo site id (attribute `matomoid`). Default: the site whose URL the page is under. |
|
|
501
|
-
| `spa` | `boolean` | `false` | A single-page app records its own page views (`uvalib-analytics-pageview`)
|
|
565
|
+
| `spa` | `boolean \| 'auto'` | `false` | A single-page app. `spa` (no value): it records its own page views (`uvalib-analytics-pageview`), none on load. `spa="auto"`: a page view on load and one per same-document route change (hash change, Back and Forward, `history.pushState`), once the title has settled, never twice in a row for the same URL, with the previous URL as the referrer. Either way Matomo's link tracking is off. |
|
|
502
566
|
| `variables` | `Record<string, unknown> \| null` | `null` | Custom dimensions, a JSON object of `{ id: value }`, set before the page view. |
|
|
503
567
|
| `no-shadow-dom` | `boolean` | `false` | |
|
|
504
568
|
| `no-style` | `boolean` | `false` | |
|
|
@@ -510,9 +574,158 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
|
|
|
510
574
|
| `uvalib-analytics-pageview` | Listened for on `document` (not fired): records a page view; `detail` is `{ customTitle?, referrer? }` (default: the document's title and referrer; a referrer without `http` is taken as a path on this origin). |
|
|
511
575
|
| `uvalib-analytics-search` | Listened for on `document` (not fired): a Matomo site search; `detail` is `{ searchQuery, searchCategory?, resultCount? }`. |
|
|
512
576
|
| `uvalib-analytics-event` | Listened for on `document` (not fired): a Matomo event; `detail` is `{ event: [category, action, name?, value?] }` (`track` is the old name of `event`). |
|
|
577
|
+
| `uvalib-analytics-content` | Listened for on `document` (not fired): a Matomo content impression; `detail` is `{ name, piece, target?, interaction? }` (with `interaction`, a content interaction instead). |
|
|
513
578
|
| `site-analytics-pageview` | Listened for on `document` too: the same as `uvalib-analytics-pageview`. |
|
|
514
579
|
| `site-analytics-search` | Listened for on `document` too: the same as `uvalib-analytics-search`. |
|
|
515
580
|
| `site-analytics-event` | Listened for on `document` too: the same as `uvalib-analytics-event`. |
|
|
581
|
+
| `site-analytics-content` | Listened for on `document` too: the same as `uvalib-analytics-content`. |
|
|
582
|
+
|
|
583
|
+
## `<uvalib-breadcrumbs>`
|
|
584
|
+
|
|
585
|
+
A breadcrumb trail, as on library.virginia.edu: links separated by slashes, ending with the current page, at body size. A `<nav aria-label="Breadcrumb">` holding an `<ol>`; the separators are hidden from assistive technology and the last item has `aria-current="page"` (a `<span>`, or a link when it has an href). Give the trail as children: `<a href>` elements, ending with the current page as a text-only element (`<span>Hours</span>`) or a link (`<a href aria-current="page">`). The last child is always the current page. An earlier child without an href is shown as plain text. Children with no text are skipped with one console warning. Hrefs are used as written, and the trail follows changes to the children (attributes and text too). Apps that build the trail in JavaScript set the `items` property instead (it then wins over any children); assigning a new array re-renders. Inside `<site-page>`, give it `slot="breadcrumbs"`: it is placed between the header (and alerts band) and `<main>`, with the page's gutters. It works anywhere else too. Single-page apps: the trail is drawn from copies of the children, so a router's own click handlers on them do not run. Listen for `uvalib-breadcrumbs-navigate` and cancel it to route in place; hash links need nothing.
|
|
586
|
+
|
|
587
|
+
### Attributes
|
|
588
|
+
|
|
589
|
+
| Attribute | Type | Default | Description |
|
|
590
|
+
|---|---|---|---|
|
|
591
|
+
| `label` | `string` | `'Breadcrumb'` | Accessible name of the navigation landmark. |
|
|
592
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
593
|
+
| `no-style` | `boolean` | `false` | |
|
|
594
|
+
|
|
595
|
+
### Events
|
|
596
|
+
|
|
597
|
+
| Event | Description |
|
|
598
|
+
|---|---|
|
|
599
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a click on a trail link, `['uvalib-breadcrumbs', 'link-click', 'level <N>', <N>]` (N from 1, the first step); never the label or URL. Bubbles and is composed. |
|
|
600
|
+
| `uvalib-breadcrumbs-navigate` | A plain click on a trail link: `detail` is `{ href, index }` (href as written). Cancel it (`preventDefault()`) to navigate in the app; the click's default is then prevented. Bubbles and is composed. |
|
|
601
|
+
|
|
602
|
+
### CSS custom properties
|
|
603
|
+
|
|
604
|
+
| Property | Default | Description |
|
|
605
|
+
|---|---|---|
|
|
606
|
+
| `--uva-blue-alt-dark` | `#005679` | Link colour. |
|
|
607
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Current page colour. |
|
|
608
|
+
| `--uva-grey-dark` | `#4f4f4f` | Separator colour. |
|
|
609
|
+
| `--uva-color-utility-link` | | Dark-mode role token: link colour, #005679 in light as on library.virginia.edu (else `--uva-blue-alt-dark`). |
|
|
610
|
+
| `--uva-color-text` | | Dark-mode role token: current page colour (else `--uva-grey-darkest`). |
|
|
611
|
+
| `--uva-color-text-muted` | | Dark-mode role token: separator colour (else `--uva-grey-dark`). |
|
|
612
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
613
|
+
|
|
614
|
+
## `<uvalib-card>`
|
|
615
|
+
|
|
616
|
+
One card: a collection (title and “N texts”), a photo (image, count, date, category, title, excerpt) or any other raised summary. With `href`, the heading is the link and a pseudo-element stretches that link over the card, so the whole card is one click. The arrow is only a visual aid. The card is never wrapped in an `<a>`. A clickable card must not contain another link, button or other control: the stretched link covers it. A static card (no `href`, or an empty or unsafe one) has no stretch, so its excerpt may contain links. With `href`, the heading needs an accessible name (text, or an image `alt` or `aria-label`); otherwise the link is hidden. Regions are light-DOM children. Give `slot="media"`, `slot="badge"`, `slot="heading"`, `slot="meta"` or `slot="chip"`; anything else (including text) is the excerpt. An image needs a real alt, or `alt=""` when the heading already names it. A date belongs in `<time>` in the meta slot. One element per chip. The heading level defaults like `<events-section>`: one below the nearest heading before the card, or 3 when there is none. `heading-level` (1–6) wins. An invalid value is ignored.
|
|
617
|
+
|
|
618
|
+
### Attributes
|
|
619
|
+
|
|
620
|
+
| Attribute | Type | Default | Description |
|
|
621
|
+
|---|---|---|---|
|
|
622
|
+
| `href` | `string \| undefined` | | Makes the card one link: the heading stretches over the card. Empty is not a link. |
|
|
623
|
+
| `heading-level` | `number \| undefined` | | Heading level of the title, 1–6. Unset, it is one below the nearest heading before this card, or 3 when there is none. Any other value is ignored. |
|
|
624
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
625
|
+
| `no-style` | `boolean` | `false` | |
|
|
626
|
+
|
|
627
|
+
### Slots
|
|
628
|
+
|
|
629
|
+
| Slot | Description |
|
|
630
|
+
|---|---|
|
|
631
|
+
| `media` | Image or other media. An `<img>` needs a real alt, or `alt=""` when the heading names it. |
|
|
632
|
+
| `badge` | Short label drawn over the media, such as “13 photos”. |
|
|
633
|
+
| `heading` | The card title. With `href`, this heading’s link is the card, so it needs an accessible name. |
|
|
634
|
+
| `meta` | Date (`<time>`) or byline, under the title. |
|
|
635
|
+
| `chip` | Category. One element per chip. |
|
|
636
|
+
| (default) | Excerpt. A static card may put links here; a clickable card must not contain other controls. |
|
|
637
|
+
|
|
638
|
+
### Events
|
|
639
|
+
|
|
640
|
+
| Event | Description |
|
|
641
|
+
|---|---|
|
|
642
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a primary-button click on the card link that was not already canceled, including a modified click, `['uvalib-card', 'card-click', 'single']` or, inside `<uvalib-card-grid>`, `['uvalib-card', 'card-click', '<n>', <n>]` (n from 1, the card’s place in that grid). Never the title or URL. Bubbles and is composed. |
|
|
643
|
+
| `uvalib-card-navigate` | A plain click on the card link: `detail` is `{ href, position }` (`position` is `'single'` or `'1'`, `'2'`, …). Cancel it (`preventDefault()`) to route in the app; the click’s default is then prevented. Bubbles and is composed. |
|
|
644
|
+
|
|
645
|
+
### CSS custom properties
|
|
646
|
+
|
|
647
|
+
| Property | Default | Description |
|
|
648
|
+
|---|---|---|
|
|
649
|
+
| `--uva-brand-blue` | `#232d4b` | Title link when `--uva-color-link` is unset, and the badge background when `--uva-color-accent-bg` is unset. |
|
|
650
|
+
| `--uva-blue-alt-300` | `#BFE7F7` | Chip background. With `--uva-blue-alt-dark` this pair is 6.13:1 (WCAG AA for normal text, short of AAA’s 7:1). |
|
|
651
|
+
| `--uva-blue-alt-dark` | `#005679` | Chip text. |
|
|
652
|
+
| `--uva-grey-100` | `#DADADA` | Hover shadow colour when `--uva-color-shadow` is unset. |
|
|
653
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: card background (else #fff). |
|
|
654
|
+
| `--uva-color-border` | | Dark-mode role token: card border (else `--uva-grey-100`). |
|
|
655
|
+
| `--uva-color-text` | | Dark-mode role token: body text (else `--uva-grey-darkest`). |
|
|
656
|
+
| `--uva-color-text-muted` | | Dark-mode role token: meta line (else #4f4f4f). |
|
|
657
|
+
| `--uva-color-link` | | Dark-mode role token: title link (else `--uva-brand-blue`). |
|
|
658
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring on the card (else `--uva-brand-orange`). |
|
|
659
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: badge background (else `--uva-brand-blue`). |
|
|
660
|
+
| `--uva-color-on-accent` | | Text on the badge (else #fff). |
|
|
661
|
+
| `--uva-color-shadow` | | Dark-mode role token: hover shadow colour (else `--uva-grey-100`). |
|
|
662
|
+
|
|
663
|
+
## `<uvalib-card-grid>`
|
|
664
|
+
|
|
665
|
+
A grid of `<uvalib-card>` elements. It is a list, so a screen reader announces how many cards there are. Safari drops that list when markers are removed, so the list role is set as well as the `<ul>`. Columns follow the theme’s breakpoints on the grid’s own width (a container query, so a sidebar collapses the grid too): four above 992px, two through 767px, then one. Cards in a row match the height of the tallest. Set `min-card-width` (a length: `16rem`, `240px`, …) to use `repeat(auto-fill, minmax(min(100%, <width>), 1fr))` instead. An invalid value is ignored, with one console warning, and the 4/2/1 columns stay. Only `<uvalib-card>` children are listed. Anything else is left in the tree (hidden in light DOM) and warned about once. The grid gives each card a `slot` while it is inside; that attribute is removed when the card leaves, so it is not hidden by another shadow root.
|
|
666
|
+
|
|
667
|
+
### Attributes
|
|
668
|
+
|
|
669
|
+
| Attribute | Type | Default | Description |
|
|
670
|
+
|---|---|---|---|
|
|
671
|
+
| `min-card-width` | `string \| undefined` | | When a length (`16rem`, `240px`, `20ch`, `40%`), the grid fills by that minimum instead of the fixed 4/2/1 columns. Any other value is ignored. |
|
|
672
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
673
|
+
| `no-style` | `boolean` | `false` | |
|
|
674
|
+
|
|
675
|
+
### Slots
|
|
676
|
+
|
|
677
|
+
| Slot | Description |
|
|
678
|
+
|---|---|
|
|
679
|
+
| (default) | `<uvalib-card>` elements, one per cell. |
|
|
680
|
+
|
|
681
|
+
### CSS custom properties
|
|
682
|
+
|
|
683
|
+
| Property | Default | Description |
|
|
684
|
+
|---|---|---|
|
|
685
|
+
| `--uvalib-card-min` | | Set from `min-card-width` when that value is a length. The grid uses it as the `auto-fill` minimum. |
|
|
686
|
+
|
|
687
|
+
## `<uvalib-contents>`
|
|
688
|
+
|
|
689
|
+
Sub-navigation or a table of contents, as library.virginia.edu's sub-navigation: a `<nav>` landmark (named by `label`, "Contents" by default) with the label as a visible headline, and a nested list of links with dividers between the top-level entries and a bar beside each nested level. Give the list as a child: an `<ol>` or `<ul>` of `<li>` elements, each with an `<a href>` (or plain text for a group label) and, for sub-entries, a nested `<ol>`/`<ul>`, to any depth. Other children (a heading) are ignored. The list follows changes to the children. Apps set the `items` property instead (`{ label, href?, children? }`, winning over the children while set). The current entry gets `aria-current`: `page` for the link to this page, `location` for the link to the section of it in the URL's hash. It is found from the page URL (path, and hash for in-page sections), followed through same-document navigations (`hashchange`, `popstate` and the Navigation API), or from the `current` attribute (a URL, resolved like the links). An entry whose href has a query string matches only that query (`?part=2`); one without matches the page whatever its query. Hash-only hrefs are places on that page. With `current` unset, a valid `aria-current` on a source link (`page`, `location` or `true`) is used instead, the first of each kind. `lang` and `dir` on the source links and items, and inline markup in their text (`em`, `cite`, `code`, `abbr`…, copied element by element, never as HTML), are kept. On narrow screens the list collapses into a disclosure: the headline becomes a button with `aria-expanded`, and the list starts closed (as the Electronic Text Collections' Contents does on phones, so the text comes first) until the reader opens it, or while the `open` attribute is set; opening it shows the current entry. Narrow means the viewport (`collapse-below`, 64rem by default), not the element's own width: a contents sidebar is always far narrower than 64rem, so a container query could not tell a phone from a desktop. `sticky` keeps it in view in a sidebar on wide screens; a list longer than the window then scrolls, and the current entry is scrolled into view inside it (never the page). Single-page apps: the list is drawn from copies of the children, so a router's own click handlers on them do not run. Listen for `uvalib-contents-navigate` and cancel it to route in place; hash links need nothing.
|
|
690
|
+
|
|
691
|
+
### Attributes
|
|
692
|
+
|
|
693
|
+
| Attribute | Type | Default | Description |
|
|
694
|
+
|---|---|---|---|
|
|
695
|
+
| `label` | | `DEFAULT_LABEL` | Accessible name of the navigation landmark, and its visible headline. |
|
|
696
|
+
| `heading-level` | | `DEFAULT_LEVEL` | The headline's level (2 to 6), for the page's outline. |
|
|
697
|
+
| `current` | `string \| undefined` | | The URL of the current entry (resolved like the links), for apps whose route is not the page URL. Unset: the page URL, followed through same-document navigations. |
|
|
698
|
+
| `collapse-below` | | `DEFAULT_COLLAPSE` | The viewport width at and below which the list collapses into a disclosure: a CSS length (`64rem`, `800px`). `0` or `none` never collapses. |
|
|
699
|
+
| `open` | `boolean` | `false` | Whether the collapsed disclosure is open (no effect on wide screens). Toggled by its button. |
|
|
700
|
+
| `sticky` | `boolean` | `false` | Keep it in view while the page scrolls (a sidebar), on wide screens. |
|
|
701
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
702
|
+
| `no-style` | `boolean` | `false` | |
|
|
703
|
+
|
|
704
|
+
### Events
|
|
705
|
+
|
|
706
|
+
| Event | Description |
|
|
707
|
+
|---|---|
|
|
708
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a click on an entry, `['uvalib-contents', 'link-click', 'level <N>', <N>]` (N from 1, the top level), and opening or closing the disclosure, `['uvalib-contents', 'toggle', 'open' \| 'close']`; never the label or URL. Bubbles and is composed. |
|
|
709
|
+
| `uvalib-contents-navigate` | A plain click on an entry: `detail` is `{ href, level }` (href as written). Cancel it (`preventDefault()`) to navigate in the app; the click's default is then prevented. Bubbles and is composed. |
|
|
710
|
+
|
|
711
|
+
### CSS custom properties
|
|
712
|
+
|
|
713
|
+
| Property | Default | Description |
|
|
714
|
+
|---|---|---|
|
|
715
|
+
| `--uvalib-contents-sticky-top` | `1rem` | With `sticky`: the gap kept above it. |
|
|
716
|
+
| `--uvalib-contents-max-height` | `none` | The list's maximum height on wide screens (it scrolls beyond it); with `sticky`, the window's height less twice the sticky gap. |
|
|
717
|
+
| `--uva-blue-alt-dark` | `#005679` | Link colour. |
|
|
718
|
+
| `--uva-brand-blue` | `#232d4b` | The current entry's bar. |
|
|
719
|
+
| `--uva-brand-orange` | `#e57200` | The nested levels' bar. |
|
|
720
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Text and current entry colour. |
|
|
721
|
+
| `--uva-color-utility-link` | | Dark-mode role token: link colour (else `--uva-blue-alt-dark`). |
|
|
722
|
+
| `--uva-color-text` | | Dark-mode role token: text and current entry (else `--uva-grey-darkest`). |
|
|
723
|
+
| `--uva-color-link` | | Dark-mode role token: the current entry's bar and the button's text (else `--uva-brand-blue`). |
|
|
724
|
+
| `--uva-color-current` | | Dark-mode role token: the nested levels' bar (else `--uva-brand-orange`). |
|
|
725
|
+
| `--uva-color-border` | | Dark-mode role token: dividers (else #dadada). |
|
|
726
|
+
| `--uva-color-control-border` | | Dark-mode role token: the button's border (else #808080). |
|
|
727
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: the button's background (else #fff). |
|
|
728
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
516
729
|
|
|
517
730
|
## `<uvalib-date-range>`
|
|
518
731
|
|
|
@@ -534,6 +747,7 @@ A date-range picker: a two-thumb year slider plus "From" and "To" date inputs. `
|
|
|
534
747
|
| Event | Description |
|
|
535
748
|
|---|---|
|
|
536
749
|
| `date-range-change` | The range changed from a slider or a date input. `detail` is `{ value: [start, end] }` (ISO dates). Bubbles and is composed. |
|
|
750
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-date-range', 'range-change', '<from year>–<to year>']`, 1 s after the visitor's last change (not when the range ends where it started). Bubbles and is composed. |
|
|
537
751
|
|
|
538
752
|
### CSS custom properties
|
|
539
753
|
|
|
@@ -581,6 +795,7 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
|
|
|
581
795
|
|---|---|
|
|
582
796
|
| `filter-change` | A checkbox was toggled. `detail` is `{ name, value }`: the facet name and the new array of selected keys. Does not bubble. |
|
|
583
797
|
| `scope-change` | A scope chip was toggled. `detail` is `{ value }`: the new array of pressed scope values. Does not bubble. |
|
|
798
|
+
| `uvalib-analytics-event` | For `<site-analytics>`, on the visitor's changes only: `['uvalib-filter', 'facet-change', '<title>: <value>', 1 \| 0]` (checked or unchecked), `['uvalib-filter', 'scope-change', <scope label>, 1 \| 0]` (pressed or not), and `['uvalib-filter', 'see-more' \| 'see-less', <title>]`. Bubbles and is composed. |
|
|
584
799
|
|
|
585
800
|
### CSS custom properties
|
|
586
801
|
|
|
@@ -596,6 +811,193 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
|
|
|
596
811
|
| `--uva-color-on-accent` | | Dark-mode role token: pressed chip text (else #fff). |
|
|
597
812
|
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
598
813
|
|
|
814
|
+
## `<uvalib-lightbox>`
|
|
815
|
+
|
|
816
|
+
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 when the viewer moves on or closes.
|
|
817
|
+
|
|
818
|
+
### Attributes
|
|
819
|
+
|
|
820
|
+
| Attribute | Type | Default | Description |
|
|
821
|
+
|---|---|---|---|
|
|
822
|
+
| `selector` | `string` | `''` | CSS selector for image links elsewhere in this root (the page, or the shadow root the component sits in). Combined with any links inside the component. Example: `a.pb-image`. |
|
|
823
|
+
| `url-param` | `string` | `''` | Query parameter kept in sync with the open image, for example `photo` → `?photo=<id>`. The id is the link's `data-id`, else its `id`, else the IIIF identifier, else its position from 1. On a hash route the parameter is written inside the hash. Empty: no deep link. |
|
|
824
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
825
|
+
| `no-style` | `boolean` | `false` | |
|
|
826
|
+
|
|
827
|
+
### Slots
|
|
828
|
+
|
|
829
|
+
| Slot | Description |
|
|
830
|
+
|---|---|
|
|
831
|
+
| (default) | The image links. A plain click opens the viewer; without JavaScript they open the image. |
|
|
832
|
+
| `details` | Details for the open image. `data-for` selects one item by its id or position (from 1); without it the details show for every image. |
|
|
833
|
+
|
|
834
|
+
### CSS parts
|
|
835
|
+
|
|
836
|
+
| Part | Description |
|
|
837
|
+
|---|---|
|
|
838
|
+
| `dialog` | The modal dialog. |
|
|
839
|
+
| `panel` | The surface inside the dialog. |
|
|
840
|
+
| `caption` | The caption that names the dialog. |
|
|
841
|
+
| `image` | The image. |
|
|
842
|
+
| `controls` | Previous, Next, the counter and Full size. |
|
|
843
|
+
| `details` | The details panel. |
|
|
844
|
+
|
|
845
|
+
### Events
|
|
846
|
+
|
|
847
|
+
| Event | Description |
|
|
848
|
+
|---|---|
|
|
849
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-lightbox', 'open'\|'next'\|'previous'\|'full-size', 'image N', N]` (N from 1, the image's place in the set). Never the URL or the caption. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed. |
|
|
850
|
+
|
|
851
|
+
### CSS custom properties
|
|
852
|
+
|
|
853
|
+
| Property | Default | Description |
|
|
854
|
+
|---|---|---|
|
|
855
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: dialog surface (else `--uva-color-surface`, else #fff). |
|
|
856
|
+
| `--uva-color-surface` | | Dark-mode role token: the figure behind the image (else #fff). |
|
|
857
|
+
| `--uva-color-text` | | Dark-mode role token: text (else `--uva-grey-darkest`). |
|
|
858
|
+
| `--uva-color-shadow` | | Dark-mode role token: the backdrop scrim (else rgba(16, 23, 43, 0.72)). |
|
|
859
|
+
| `--uva-color-border` | | Dark-mode role token: dialog border (else `--uva-grey-100`). |
|
|
860
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
861
|
+
| `--uva-color-link` | | Dark-mode role token: Full size text when it is not the filled control (else `--uva-brand-blue`). |
|
|
862
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: Close and Full size background (else `--uva-brand-blue`). |
|
|
863
|
+
| `--uva-color-on-accent` | | Text on those controls (else #fff). |
|
|
864
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring when `--uva-color-focus` is unset. |
|
|
865
|
+
| `--uva-brand-blue` | `#232d4b` | Control background when `--uva-color-accent-bg` is unset. |
|
|
866
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Text when `--uva-color-text` is unset. |
|
|
867
|
+
| `--uva-grey-100` | `#dadada` | Border when `--uva-color-border` is unset. |
|
|
868
|
+
|
|
869
|
+
## `<uvalib-metadata>`
|
|
870
|
+
|
|
871
|
+
A record's details as a description list, as on the library's digital collections: label and value side by side on wide screens (the element's own width, 36rem and up), stacked on narrow ones. Values may be text, links or lists (subjects). Give the rows as a `<dl>` child (so the page reads the same before the script loads): `<dt>` labels and `<dd>` values, optionally wrapped in a `<div>` per row; several `<dd>` after one `<dt>` are several values. The values are copied as written (links, lists, `download` attributes kept); a link with `data-size="184 KB"` is shown as a download, "EPUB · 184 KB". The list follows changes to the children. Apps set the `items` property instead (`{ label, value }`, winning over the children while set). Built-in rows for credit and rights (as Special Collections asks): `creator` and `organization` come first; `rights` (a rightsstatements.org or Creative Commons URL, shown as its short name linked to it, or plain text) and `citation` ("How to cite", with a Copy citation button that announces "Copied" politely) come last. `citation-title` builds the Special Collections citation, "<title>, Albert and Shirley Small Special Collections Library, University of Virginia".
|
|
872
|
+
|
|
873
|
+
### Attributes
|
|
874
|
+
|
|
875
|
+
| Attribute | Type | Default | Description |
|
|
876
|
+
|---|---|---|---|
|
|
877
|
+
| `creator` | `string \| undefined` | | The creator (author, photographer…), shown first. |
|
|
878
|
+
| `organization` | `string \| undefined` | | The organization holding or crediting the item, shown after the creator. |
|
|
879
|
+
| `rights` | `string \| undefined` | | The rights statement: a rightsstatements.org or Creative Commons URL (shown as its short name, linked), another http(s) URL (shown as `rights-label`, or "Rights statement"), or plain text. |
|
|
880
|
+
| `rights-label` | `string \| undefined` | | The link text for a `rights` URL, instead of its short name. |
|
|
881
|
+
| `rights-info` | `string \| undefined` | | A "More about rights and permissions" link under the statement, such as `https://www.library.virginia.edu/policies/use-of-materials`. |
|
|
882
|
+
| `citation` | `string \| undefined` | | "How to cite": the citation, as written. Wins over `citation-title`. |
|
|
883
|
+
| `citation-title` | `string \| undefined` | | A title or collection name for the Special Collections citation: "<title>, Albert and Shirley Small Special Collections Library, University of Virginia". |
|
|
884
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
885
|
+
| `no-style` | `boolean` | `false` | |
|
|
886
|
+
|
|
887
|
+
### Events
|
|
888
|
+
|
|
889
|
+
| Event | Description |
|
|
890
|
+
|---|---|
|
|
891
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: the Copy citation button, `['uvalib-metadata', 'copy-citation']`. Downloads are left to Matomo's own download tracking. Bubbles and is composed. |
|
|
892
|
+
|
|
893
|
+
### CSS custom properties
|
|
894
|
+
|
|
895
|
+
| Property | Default | Description |
|
|
896
|
+
|---|---|---|
|
|
897
|
+
| `--uva-blue-alt-dark` | `#005679` | Link colour. |
|
|
898
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Value colour. |
|
|
899
|
+
| `--uva-color-utility-link` | | Dark-mode role token: link colour (else `--uva-blue-alt-dark`). |
|
|
900
|
+
| `--uva-color-text` | | Dark-mode role token: value colour (else `--uva-grey-darkest`). |
|
|
901
|
+
| `--uva-color-text-muted` | | Dark-mode role token: label and status colour (else #4b5563). |
|
|
902
|
+
| `--uva-color-border` | | Dark-mode role token: row dividers (else #dadada). |
|
|
903
|
+
| `--uva-color-link` | | Dark-mode role token: the button's text and border (else `--uva-brand-blue`). |
|
|
904
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: the button's background (else #fff). |
|
|
905
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
906
|
+
|
|
907
|
+
## `<uvalib-pagefind-search>`
|
|
908
|
+
|
|
909
|
+
Pagefind's default search UI (`PagefindUI`, from the site's own Pagefind bundle) with the library's defaults and the accessibility fixes that need script. Use it with pagefind.css, in place of Pagefind's pagefind-ui.css. It renders in light DOM, so the page's styles reach Pagefind's markup. It loads `<bundle-path>pagefind-ui.js` unless `window.PagefindUI` already exists. What it adds to the stock UI: a visible `<label>` for the field (the stock field is named only by its title); a polite status region that announces the result count ("12 results for virginia") once results settle (the stock message is not a live region); focus kept in the field after Clear or Escape (the stock UI blurs it, dropping focus to the page) and moved to the first new result after "Load more results"; the loading placeholders' dots hidden from screen readers; `?q=` read at start (and on Back and Forward) and the settled query written back with `history.replaceState`, so a search can be shared; and reports to `<site-analytics>`. The `ui` property is the `PagefindUI` instance (for `triggerFilters`), and `ready` resolves with it. Attributes are read once, when the element is first connected.
|
|
910
|
+
|
|
911
|
+
### Attributes
|
|
912
|
+
|
|
913
|
+
| Attribute | Type | Default | Description |
|
|
914
|
+
|---|---|---|---|
|
|
915
|
+
| `bundle-path` | `string` | `/pagefind/` | The Pagefind bundle's URL path, ending in `/`. |
|
|
916
|
+
| `merge-index` | `string` | | JSON array of more indexes to search together: `[{"bundlePath": "/pagefind/s1/"}]`. |
|
|
917
|
+
| `page-size` | `number` | `10` | Results shown before "Load more results". |
|
|
918
|
+
| `excerpt-length` | `number` | | Words per excerpt (Pagefind's default: 30, or 12 with sub-results). |
|
|
919
|
+
| `show-sub-results` | `boolean` | | Also list the matching sections of each page. |
|
|
920
|
+
| `show-images` | `boolean` | | Show each result's `image` metadata (off by default). |
|
|
921
|
+
| `placeholder` | `string` | `Search` | The field's placeholder. |
|
|
922
|
+
| `label` | `string` | | The field's visible label. Empty (the default) uses the placeholder. |
|
|
923
|
+
| `label-hidden` | `boolean` | | Keep the label for screen readers only. |
|
|
924
|
+
| `translations` | `string` | | JSON of Pagefind UI strings to override (`{"zero_results": "…"}`). |
|
|
925
|
+
| `options` | `string` | | JSON of any other `PagefindUI` options (`{"openFilters": ["author"]}`), applied last. |
|
|
926
|
+
| `query-param` | `string` | `q` | The URL parameter that holds the query; empty turns it off. |
|
|
927
|
+
|
|
928
|
+
### Events
|
|
929
|
+
|
|
930
|
+
| Event | Description |
|
|
931
|
+
|---|---|
|
|
932
|
+
| `search-results` | Results settled: `detail` is `{ query, count }`; `{ query: '', count: 0 }` when the field is emptied after a search. Does not bubble. |
|
|
933
|
+
| `uvalib-analytics-search` | For `<site-analytics>`: the settled query, category `Pagefind` and its result count, once per query and filter set. Bubbles and is composed. |
|
|
934
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-pagefind-search', 'filter-change', '<filter>: <value>', 1 \| 0]` (checked or unchecked), and `['uvalib-pagefind-search', 'error', 'load']` if Pagefind cannot be loaded. Bubbles and is composed. |
|
|
935
|
+
|
|
936
|
+
## `<uvalib-pager>`
|
|
937
|
+
|
|
938
|
+
Previous/next section links, as on a reading page, or a numbered page list. Previous/next: set `prev-href` and `next-href` (either may be omitted). Each link shows a “Previous” or “Next” kicker and, when `prev-label` or `next-label` is set, that title. A visually hidden “: ” sits between them, so the accessible name is punctuated even when CSS is off. A long title truncates visually; the full text stays in the accessible name. The links use `rel="prev"` and `rel="next"`. With neither href, nothing is rendered. Numbered pages: set `pages` (a positive count). `page` is the current page, clamped to `1…pages`. Each link’s href comes from `href-template`, which must contain `{page}` (the default is `?page={page}`). The current page is text with `aria-current="page"`, not a link. Long ranges collapse to the first page, a window around the current page, the last page, and an ellipsis where numbers are skipped. `pages` wins when previous/next attributes are also set, with one console warning. The landmark’s accessible name is `label`, or “Sections” for previous/next and “Pagination” for numbered pages. An empty `label` uses that default. Two pagers on one page need different labels: a repeated landmark name fails the accessibility check.
|
|
939
|
+
|
|
940
|
+
### Attributes
|
|
941
|
+
|
|
942
|
+
| Attribute | Type | Default | Description |
|
|
943
|
+
|---|---|---|---|
|
|
944
|
+
| `prev-href` | `string \| undefined` | | Href of the previous section. Omitted, that side is not shown. |
|
|
945
|
+
| `prev-label` | `string \| undefined` | | Title of the previous section, under the “Previous” kicker. |
|
|
946
|
+
| `next-href` | `string \| undefined` | | Href of the next section. Omitted, that side is not shown. |
|
|
947
|
+
| `next-label` | `string \| undefined` | | Title of the next section, under the “Next” kicker. |
|
|
948
|
+
| `page` | `number \| undefined` | | Current page, from 1. Clamped to `pages`. Used when `pages` is set. |
|
|
949
|
+
| `pages` | `number \| undefined` | | How many pages. A positive number selects numbered pages and ignores previous/next. Zero, negative or non-numeric does not. |
|
|
950
|
+
| `href-template` | `string \| undefined` | | Href of each numbered page, with `{page}` where the number goes. Default `?page={page}` when omitted. Without `{page}`, numbered links are not made. |
|
|
951
|
+
| `label` | `string \| undefined` | | Accessible name of the navigation landmark. Default “Pagination” for numbered pages and “Sections” for previous/next. Empty uses that default. A second pager on the page needs its own name. |
|
|
952
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
953
|
+
| `no-style` | `boolean` | `false` | |
|
|
954
|
+
|
|
955
|
+
### Events
|
|
956
|
+
|
|
957
|
+
| Event | Description |
|
|
958
|
+
|---|---|
|
|
959
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: a primary-button click that was not already canceled, including a modified click, on a page link `['uvalib-pager', 'page-change', 'number', <n>]`, or on a section link `['uvalib-pager', 'page-change', 'next'\|'previous']` (no page number: that mode has none). Never the label or URL. Bubbles and is composed. |
|
|
960
|
+
| `uvalib-pager-navigate` | A plain click on a pager link: `detail` is `{ href, kind, page? }` (`kind` is `'next'`, `'previous'` or `'number'`; `page` is set for `'number'`). Cancel it (`preventDefault()`) to route in the app; the click’s default is then prevented. Bubbles and is composed. |
|
|
961
|
+
|
|
962
|
+
### CSS custom properties
|
|
963
|
+
|
|
964
|
+
| Property | Default | Description |
|
|
965
|
+
|---|---|---|
|
|
966
|
+
| `--uva-color-link` | | Dark-mode role token: link colour (else `--uva-brand-blue`). |
|
|
967
|
+
| `--uva-color-text` | | Dark-mode role token: current page (else `--uva-grey-darkest`). |
|
|
968
|
+
| `--uva-color-text-muted` | | Dark-mode role token: the Previous/Next kicker (else #4f4f4f). |
|
|
969
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
970
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: current page background (else `--uva-brand-blue`). |
|
|
971
|
+
| `--uva-color-on-accent` | | Text on the current page background (else #fff). |
|
|
972
|
+
|
|
973
|
+
## `<uvalib-photo-grid>`
|
|
974
|
+
|
|
975
|
+
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.
|
|
976
|
+
|
|
977
|
+
### Attributes
|
|
978
|
+
|
|
979
|
+
| Attribute | Type | Default | Description |
|
|
980
|
+
|---|---|---|---|
|
|
981
|
+
| `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. |
|
|
982
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
983
|
+
| `no-style` | `boolean` | `false` | |
|
|
984
|
+
|
|
985
|
+
### Slots
|
|
986
|
+
|
|
987
|
+
| Slot | Description |
|
|
988
|
+
|---|---|
|
|
989
|
+
| (default) | The thumbnails: one `<a href>` or `<button>` per photo, each with an `<img>`. |
|
|
990
|
+
|
|
991
|
+
### CSS custom properties
|
|
992
|
+
|
|
993
|
+
| Property | Default | Description |
|
|
994
|
+
|---|---|---|
|
|
995
|
+
| `--uva-color-text` | | Dark-mode role token: caption colour (else `--uva-grey-darkest`). |
|
|
996
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
997
|
+
| `--uva-color-surface` | | Dark-mode role token: the box behind an image that has not loaded (else #fff). |
|
|
998
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Caption colour when `--uva-color-text` is unset. |
|
|
999
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring when `--uva-color-focus` is unset. |
|
|
1000
|
+
|
|
599
1001
|
## `<website-section>`
|
|
600
1002
|
|
|
601
1003
|
The library website's first pages (pages, people, libraries, news) matching `query`, from Drupal's search index, with its excerpt (the matched words marked). The index sends no CORS headers, so this section works on library.virginia.edu (or wherever `BentoBox.endpoints.website` points to a same-origin copy) only.
|
|
@@ -617,7 +1019,7 @@ The library website's first pages (pages, people, libraries, news) matching `que
|
|
|
617
1019
|
|---|---|
|
|
618
1020
|
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
619
1021
|
| `uvalib-analytics-search` | For `<site-analytics>`: once per settled search (results or none, not an error): the query, the section's `analyticsName` as category and its total when known. Bubbles and is composed. |
|
|
620
|
-
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; never titles or URLs. Bubbles and is composed. |
|
|
1022
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['bento-box', 'result-click', <section>, <1-based position>]` or `['bento-box', 'see-all-click', <section>]`; `['bento-box', 'retry', <section>]` for its Retry button; `['bento-box', 'error', 'section-load: <section>']` once when its results cannot be loaded; never titles or URLs. Bubbles and is composed. |
|
|
621
1023
|
|
|
622
1024
|
### CSS custom properties
|
|
623
1025
|
|