@uvalib/web-components 0.0.0-stage → 1.0.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 +172 -0
- package/README.md +1164 -2
- package/bin/install-skill.mjs +139 -0
- package/dist/base/UvalibElement.d.ts +21 -0
- package/dist/base/UvalibElement.js +68 -0
- package/dist/base/UvalibElement.js.map +1 -0
- package/dist/base/analytics.d.ts +44 -0
- package/dist/base/analytics.js +59 -0
- package/dist/base/analytics.js.map +1 -0
- package/dist/base/color-scheme.d.ts +93 -0
- package/dist/base/color-scheme.js +267 -0
- package/dist/base/color-scheme.js.map +1 -0
- package/dist/base/define.d.ts +2 -0
- package/dist/base/define.js +6 -0
- package/dist/base/define.js.map +1 -0
- package/dist/base/heading-level.d.ts +12 -0
- package/dist/base/heading-level.js +52 -0
- package/dist/base/heading-level.js.map +1 -0
- package/dist/base/light-dom-styles.d.ts +18 -0
- package/dist/base/light-dom-styles.js +134 -0
- package/dist/base/light-dom-styles.js.map +1 -0
- package/dist/base.css +30 -0
- package/dist/base.d.ts +5 -0
- package/dist/base.js +5 -0
- package/dist/base.js.map +1 -0
- package/dist/components/bento-box/ArticlesSection.d.ts +19 -0
- package/dist/components/bento-box/ArticlesSection.js +22 -0
- package/dist/components/bento-box/ArticlesSection.js.map +1 -0
- package/dist/components/bento-box/BentoBox.d.ts +85 -0
- package/dist/components/bento-box/BentoBox.js +366 -0
- package/dist/components/bento-box/BentoBox.js.map +1 -0
- package/dist/components/bento-box/BentoSection.d.ts +115 -0
- package/dist/components/bento-box/BentoSection.js +486 -0
- package/dist/components/bento-box/BentoSection.js.map +1 -0
- package/dist/components/bento-box/CatalogSection.d.ts +18 -0
- package/dist/components/bento-box/CatalogSection.js +19 -0
- package/dist/components/bento-box/CatalogSection.js.map +1 -0
- package/dist/components/bento-box/LibGuidesSection.d.ts +24 -0
- package/dist/components/bento-box/LibGuidesSection.js +73 -0
- package/dist/components/bento-box/LibGuidesSection.js.map +1 -0
- package/dist/components/bento-box/VirgoSection.d.ts +19 -0
- package/dist/components/bento-box/VirgoSection.js +58 -0
- package/dist/components/bento-box/VirgoSection.js.map +1 -0
- package/dist/components/bento-box/WebsiteSection.d.ts +25 -0
- package/dist/components/bento-box/WebsiteSection.js +40 -0
- package/dist/components/bento-box/WebsiteSection.js.map +1 -0
- package/dist/components/bento-box/bento-box.d.ts +1 -0
- package/dist/components/bento-box/bento-box.js +13 -0
- package/dist/components/bento-box/bento-box.js.map +1 -0
- package/dist/components/bento-box/bento-data.d.ts +147 -0
- package/dist/components/bento-box/bento-data.js +422 -0
- package/dist/components/bento-box/bento-data.js.map +1 -0
- package/dist/components/events-section/EventsSection.d.ts +91 -0
- package/dist/components/events-section/EventsSection.js +435 -0
- package/dist/components/events-section/EventsSection.js.map +1 -0
- package/dist/components/events-section/events-data.d.ts +90 -0
- package/dist/components/events-section/events-data.js +174 -0
- package/dist/components/events-section/events-data.js.map +1 -0
- package/dist/components/events-section/events-section.d.ts +1 -0
- package/dist/components/events-section/events-section.js +4 -0
- package/dist/components/events-section/events-section.js.map +1 -0
- package/dist/components/library-hours/hours-data.d.ts +104 -0
- package/dist/components/library-hours/hours-data.js +267 -0
- package/dist/components/library-hours/hours-data.js.map +1 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.d.ts +21 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.js +59 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.js.map +1 -0
- package/dist/components/library-hours-setup/library-hours-setup.d.ts +1 -0
- package/dist/components/library-hours-setup/library-hours-setup.js +5 -0
- package/dist/components/library-hours-setup/library-hours-setup.js.map +1 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.d.ts +107 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js +502 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js.map +1 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.d.ts +1 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.js +4 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.js.map +1 -0
- package/dist/components/link.d.ts +2 -0
- package/dist/components/link.js +7 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/site-analytics/SiteAnalytics.d.ts +44 -0
- package/dist/components/site-analytics/SiteAnalytics.js +161 -0
- package/dist/components/site-analytics/SiteAnalytics.js.map +1 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.d.ts +8 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.js +22 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.js.map +1 -0
- package/dist/components/site-analytics/site-analytics.d.ts +1 -0
- package/dist/components/site-analytics/site-analytics.js +4 -0
- package/dist/components/site-analytics/site-analytics.js.map +1 -0
- package/dist/components/site-footer/SiteFooter.d.ts +34 -0
- package/dist/components/site-footer/SiteFooter.js +275 -0
- package/dist/components/site-footer/SiteFooter.js.map +1 -0
- package/dist/components/site-footer/icons.d.ts +4 -0
- package/dist/components/site-footer/icons.js +7 -0
- package/dist/components/site-footer/icons.js.map +1 -0
- package/dist/components/site-footer/site-footer.d.ts +1 -0
- package/dist/components/site-footer/site-footer.js +4 -0
- package/dist/components/site-footer/site-footer.js.map +1 -0
- package/dist/components/site-header/SiteHeader.d.ts +154 -0
- package/dist/components/site-header/SiteHeader.js +845 -0
- package/dist/components/site-header/SiteHeader.js.map +1 -0
- package/dist/components/site-header/site-header.d.ts +1 -0
- package/dist/components/site-header/site-header.js +12 -0
- package/dist/components/site-header/site-header.js.map +1 -0
- package/dist/components/site-hours-section/SiteHoursSection.d.ts +63 -0
- package/dist/components/site-hours-section/SiteHoursSection.js +243 -0
- package/dist/components/site-hours-section/SiteHoursSection.js.map +1 -0
- package/dist/components/site-hours-section/site-hours-section.d.ts +1 -0
- package/dist/components/site-hours-section/site-hours-section.js +4 -0
- package/dist/components/site-hours-section/site-hours-section.js.map +1 -0
- package/dist/components/site-main-nav/SiteMainNav.d.ts +136 -0
- package/dist/components/site-main-nav/SiteMainNav.js +678 -0
- package/dist/components/site-main-nav/SiteMainNav.js.map +1 -0
- package/dist/components/site-main-nav/main-nav-data.d.ts +5 -0
- package/dist/components/site-main-nav/main-nav-data.js +90 -0
- package/dist/components/site-main-nav/main-nav-data.js.map +1 -0
- package/dist/components/site-main-nav/main-nav-items.d.ts +49 -0
- package/dist/components/site-main-nav/main-nav-items.js +138 -0
- package/dist/components/site-main-nav/main-nav-items.js.map +1 -0
- package/dist/components/site-main-nav/site-main-nav.d.ts +1 -0
- package/dist/components/site-main-nav/site-main-nav.js +4 -0
- package/dist/components/site-main-nav/site-main-nav.js.map +1 -0
- package/dist/components/site-page/SitePage.d.ts +145 -0
- package/dist/components/site-page/SitePage.js +480 -0
- package/dist/components/site-page/SitePage.js.map +1 -0
- package/dist/components/site-page/alerts.d.ts +24 -0
- package/dist/components/site-page/alerts.js +78 -0
- package/dist/components/site-page/alerts.js.map +1 -0
- package/dist/components/site-page/site-page.d.ts +1 -0
- package/dist/components/site-page/site-page.js +7 -0
- package/dist/components/site-page/site-page.js.map +1 -0
- package/dist/components/site-style/SiteStyle.d.ts +37 -0
- package/dist/components/site-style/SiteStyle.js +76 -0
- package/dist/components/site-style/SiteStyle.js.map +1 -0
- package/dist/components/site-style/site-style.d.ts +1 -0
- package/dist/components/site-style/site-style.js +4 -0
- package/dist/components/site-style/site-style.js.map +1 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.d.ts +10 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.js +11 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.js.map +1 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.d.ts +13 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.js +25 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.js.map +1 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.d.ts +1 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.js +4 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.js.map +1 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +46 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js +339 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.d.ts +1 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.js +4 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.js.map +1 -0
- package/dist/components/uvalib-filter/UvalibFilter.d.ts +73 -0
- package/dist/components/uvalib-filter/UvalibFilter.js +279 -0
- package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -0
- package/dist/components/uvalib-filter/uvalib-filter.d.ts +1 -0
- package/dist/components/uvalib-filter/uvalib-filter.js +4 -0
- package/dist/components/uvalib-filter/uvalib-filter.js.map +1 -0
- package/dist/custom-elements.json +15178 -0
- package/dist/data/fetch-json.d.ts +28 -0
- package/dist/data/fetch-json.js +43 -0
- package/dist/data/fetch-json.js.map +1 -0
- package/dist/data/new-york.d.ts +5 -0
- package/dist/data/new-york.js +23 -0
- package/dist/data/new-york.js.map +1 -0
- package/dist/data/sites.d.ts +12 -0
- package/dist/data/sites.js +89 -0
- package/dist/data/sites.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/accessible.d.ts +1 -0
- package/dist/styles/accessible.js +37 -0
- package/dist/styles/accessible.js.map +1 -0
- package/dist/styles/base.d.ts +2 -0
- package/dist/styles/base.js +41 -0
- package/dist/styles/base.js.map +1 -0
- package/dist/styles/color-scheme.d.ts +1 -0
- package/dist/styles/color-scheme.js +81 -0
- package/dist/styles/color-scheme.js.map +1 -0
- package/dist/styles/tokens.d.ts +1 -0
- package/dist/styles/tokens.js +85 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/styles/w3-subset.d.ts +1 -0
- package/dist/styles/w3-subset.js +33 -0
- package/dist/styles/w3-subset.js.map +1 -0
- package/dist/tokens.css +152 -0
- package/dist-cdn/base.css +30 -0
- package/dist-cdn/bento-box.js +1035 -0
- package/dist-cdn/bento-box.js.map +1 -0
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js +174 -0
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js.map +1 -0
- package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js +695 -0
- package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js.map +1 -0
- package/dist-cdn/chunks/accessible-GqhVn5_H.js +40 -0
- package/dist-cdn/chunks/accessible-GqhVn5_H.js.map +1 -0
- package/dist-cdn/chunks/analytics-C8D8n_wt.js +55 -0
- package/dist-cdn/chunks/analytics-C8D8n_wt.js.map +1 -0
- package/dist-cdn/chunks/base-DCGd2Oii.js +117 -0
- package/dist-cdn/chunks/base-DCGd2Oii.js.map +1 -0
- package/dist-cdn/chunks/fetch-json-Cyqv-gLU.js +25 -0
- package/dist-cdn/chunks/fetch-json-Cyqv-gLU.js.map +1 -0
- package/dist-cdn/chunks/heading-level-DIuNS44-.js +31 -0
- package/dist-cdn/chunks/heading-level-DIuNS44-.js.map +1 -0
- package/dist-cdn/chunks/hours-data-Bw6vkIw7.js +181 -0
- package/dist-cdn/chunks/hours-data-Bw6vkIw7.js.map +1 -0
- package/dist-cdn/chunks/library-weekly-hours-ByQ8ugxh.js +346 -0
- package/dist-cdn/chunks/library-weekly-hours-ByQ8ugxh.js.map +1 -0
- package/dist-cdn/chunks/link-DbJSwj16.js +7 -0
- package/dist-cdn/chunks/link-DbJSwj16.js.map +1 -0
- package/dist-cdn/chunks/new-york-DkcnqvJ4.js +18 -0
- package/dist-cdn/chunks/new-york-DkcnqvJ4.js.map +1 -0
- package/dist-cdn/chunks/repeat-CIFUYkyh.js +101 -0
- package/dist-cdn/chunks/repeat-CIFUYkyh.js.map +1 -0
- package/dist-cdn/chunks/site-header-BwDkZ2LL.js +802 -0
- package/dist-cdn/chunks/site-header-BwDkZ2LL.js.map +1 -0
- package/dist-cdn/chunks/site-main-nav-BLAAunnr.js +605 -0
- package/dist-cdn/chunks/site-main-nav-BLAAunnr.js.map +1 -0
- package/dist-cdn/chunks/static-html-1mTAG6nS.js +22 -0
- package/dist-cdn/chunks/static-html-1mTAG6nS.js.map +1 -0
- package/dist-cdn/custom-elements.json +15178 -0
- package/dist-cdn/events-section.js +401 -0
- package/dist-cdn/events-section.js.map +1 -0
- package/dist-cdn/library-hours-setup.js +28 -0
- package/dist-cdn/library-hours-setup.js.map +1 -0
- package/dist-cdn/library-weekly-hours.js +1 -0
- package/dist-cdn/manifest.json +23 -0
- package/dist-cdn/site-analytics.js +6 -0
- package/dist-cdn/site-analytics.js.map +1 -0
- package/dist-cdn/site-footer.js +267 -0
- package/dist-cdn/site-footer.js.map +1 -0
- package/dist-cdn/site-header.js +1 -0
- package/dist-cdn/site-hours-section.js +145 -0
- package/dist-cdn/site-hours-section.js.map +1 -0
- package/dist-cdn/site-main-nav.js +1 -0
- package/dist-cdn/site-page.js +317 -0
- package/dist-cdn/site-page.js.map +1 -0
- package/dist-cdn/site-style.js +42 -0
- package/dist-cdn/site-style.js.map +1 -0
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +276 -0
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +631 -0
- package/dist-cdn/skills/uvalib-web-components/reference/migration.md +74 -0
- package/dist-cdn/skills/uvalib-web-components/reference/snippets.md +147 -0
- package/dist-cdn/tokens.css +152 -0
- package/dist-cdn/uvalib-analytics.js +6 -0
- package/dist-cdn/uvalib-analytics.js.map +1 -0
- package/dist-cdn/uvalib-date-range.js +262 -0
- package/dist-cdn/uvalib-date-range.js.map +1 -0
- package/dist-cdn/uvalib-filter.js +184 -0
- package/dist-cdn/uvalib-filter.js.map +1 -0
- package/package.json +152 -4
- package/skills/uvalib-web-components/SKILL.md +276 -0
- package/skills/uvalib-web-components/reference/components.md +631 -0
- package/skills/uvalib-web-components/reference/migration.md +74 -0
- package/skills/uvalib-web-components/reference/snippets.md +147 -0
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
# Component reference
|
|
2
|
+
|
|
3
|
+
<!-- Generated from dist/custom-elements.json by scripts/gen-reference.mjs. Do not edit by hand. -->
|
|
4
|
+
|
|
5
|
+
## `<articles-section>`
|
|
6
|
+
|
|
7
|
+
Virgo's first article results for `query`. Articles Virgo hides from guests keep their link, under a neutral title ("Article details available after signing in to Virgo").
|
|
8
|
+
|
|
9
|
+
### Attributes
|
|
10
|
+
|
|
11
|
+
| Attribute | Type | Default | Description |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| `query` | `string` | `''` | The search text. Empty: nothing is fetched and the section is `empty`. |
|
|
14
|
+
| `limit` | `number` | `5` | How many results to show (at most). |
|
|
15
|
+
| `no-result-describe` | `string` | `'No results found.'` | The message shown when nothing is found. |
|
|
16
|
+
| `heading-level` | `number \| undefined` | | The level of the section's heading, 1 to 6. Unset (the default), it is one below the nearest heading before the element in the page, or 3 when there is none. `<bento-box>` sets it one below its own heading. |
|
|
17
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
18
|
+
| `no-style` | `boolean` | `false` | |
|
|
19
|
+
|
|
20
|
+
### Events
|
|
21
|
+
|
|
22
|
+
| Event | Description |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
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. |
|
|
27
|
+
|
|
28
|
+
### CSS custom properties
|
|
29
|
+
|
|
30
|
+
| Property | Default | Description |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `--uva-color-text` | | Dark-mode role token: text (else #2b2b2b). |
|
|
33
|
+
| `--uva-color-link` | | Dark-mode role token: titles, links and buttons (else `--uva-brand-blue`). |
|
|
34
|
+
| `--uva-color-border` | | Dark-mode role token: the block's border and entry rules (else #dadada). |
|
|
35
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: background (else #fff). |
|
|
36
|
+
| `--uva-color-surface-hover` | | Dark-mode role token: the header band (else #dadada). |
|
|
37
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
38
|
+
|
|
39
|
+
## `<bento-box>`
|
|
40
|
+
|
|
41
|
+
The library's search results page (library.virginia.edu/search): a search bar and, for the query, a grid of result sections from Virgo's catalog and articles, the subject guides and the library website. The query comes from the page URL (`?q=`, or the old `?query=`), else the `query` attribute; searching pushes `?q=` to the history, and Back and Forward restore the query. With no query only the search bar shows and nothing is fetched. Light DOM output keeps the classes the Drupal theme styles under `.uvalib-bento-search`. Registers `catalog-section`, `articles-section`, `libguides-section` and `website-section`.
|
|
42
|
+
|
|
43
|
+
### Attributes
|
|
44
|
+
|
|
45
|
+
| Attribute | Type | Default | Description |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| `query` | `string` | `''` | The search text when the page URL has none (`?q=` or `?query=` win). |
|
|
48
|
+
| `limit` | `number` | `5` | How many results each section shows (at most). |
|
|
49
|
+
| `search-describe` | `string` | `'This page searches Virgo, Virgo articles, subject guides, and the Library website.'` | The line under the search bar. |
|
|
50
|
+
| `no-result-describe` | `string` | `'No results found.'` | What a section says when it finds nothing. |
|
|
51
|
+
| `placeholder` | `string` | `'Search anything...'` | The search input's placeholder. |
|
|
52
|
+
| `boxes` | `BentoBoxName[]` | `['catalog', 'articles', 'libguides', 'website']` | The sections, in order: `catalog`, `articles`, `libguides`, `website`, as a comma list (`boxes="catalog,articles"`) or a JSON array. Default: all four. |
|
|
53
|
+
| `heading-level` | `number \| undefined` | | The level of the "You searched for" heading, 1 to 6; the sections' headings are one below. Unset (the default), it is one below the nearest heading before the element in the page (the page's `<h1>` gives `<h2>`, then `<h3>` sections), or 2 when there is none. |
|
|
54
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
55
|
+
| `no-style` | `boolean` | `false` | |
|
|
56
|
+
|
|
57
|
+
### CSS custom properties
|
|
58
|
+
|
|
59
|
+
| Property | Default | Description |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `--uva-color-text` | | Dark-mode role token: text (else #2b2b2b). |
|
|
62
|
+
| `--uva-color-control-border` | | Dark-mode role token: the search input's border (else #808080). |
|
|
63
|
+
| `--uva-color-input-text` | | Dark-mode role token: the search input's text (else #1f2937). |
|
|
64
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: the search input's background (else #fff). |
|
|
65
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: the search button (else `--uva-brand-blue`). |
|
|
66
|
+
| `--uva-color-on-accent` | | Dark-mode role token: the search button's icon (else #fff). |
|
|
67
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
68
|
+
|
|
69
|
+
## `<catalog-section>`
|
|
70
|
+
|
|
71
|
+
The Virgo catalog's first results for `query` (books, journals, archives, maps, music, theses, videos…). A work with several editions shows once, noting how many.
|
|
72
|
+
|
|
73
|
+
### Attributes
|
|
74
|
+
|
|
75
|
+
| Attribute | Type | Default | Description |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| `query` | `string` | `''` | The search text. Empty: nothing is fetched and the section is `empty`. |
|
|
78
|
+
| `limit` | `number` | `5` | How many results to show (at most). |
|
|
79
|
+
| `no-result-describe` | `string` | `'No results found.'` | The message shown when nothing is found. |
|
|
80
|
+
| `heading-level` | `number \| undefined` | | The level of the section's heading, 1 to 6. Unset (the default), it is one below the nearest heading before the element in the page, or 3 when there is none. `<bento-box>` sets it one below its own heading. |
|
|
81
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
82
|
+
| `no-style` | `boolean` | `false` | |
|
|
83
|
+
|
|
84
|
+
### Events
|
|
85
|
+
|
|
86
|
+
| Event | Description |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
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. |
|
|
91
|
+
|
|
92
|
+
### CSS custom properties
|
|
93
|
+
|
|
94
|
+
| Property | Default | Description |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `--uva-color-text` | | Dark-mode role token: text (else #2b2b2b). |
|
|
97
|
+
| `--uva-color-link` | | Dark-mode role token: titles, links and buttons (else `--uva-brand-blue`). |
|
|
98
|
+
| `--uva-color-border` | | Dark-mode role token: the block's border and entry rules (else #dadada). |
|
|
99
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: background (else #fff). |
|
|
100
|
+
| `--uva-color-surface-hover` | | Dark-mode role token: the header band (else #dadada). |
|
|
101
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
102
|
+
|
|
103
|
+
## `<events-section>`
|
|
104
|
+
|
|
105
|
+
Upcoming UVA Library events from LibCal, as on the library.virginia.edu home page: a grid of cards, each one link with the event's title, a date column (month, day, weekday) and its time, in America/New_York. Events that have ended are left out. Light DOM output keeps the classes the Drupal theme styles (`event-container`, `event`, `event-url`, `event-title`, `event-date`, `event--month`, `event--day`, `event--wkday`, `event-time`).
|
|
106
|
+
|
|
107
|
+
### Attributes
|
|
108
|
+
|
|
109
|
+
| Attribute | Type | Default | Description |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `limit` | `number` | `8` | How many events to show (at most; fewer when fewer are coming up). |
|
|
112
|
+
| `category` | `string \| undefined` | | Only events in this LibCal category (its id, for example `38740`; several comma-separated). |
|
|
113
|
+
| `query` | `string \| undefined` | | Only events matching this search text (LibCal's event search). |
|
|
114
|
+
| `max-title-length` | `number \| undefined` | | Cut titles longer than this many characters, with "…", for sighted users; assistive technology still gets the whole title. Titles are clamped to three lines anyway, so this is only kept for old pages. |
|
|
115
|
+
| `heading-level` | `number \| undefined` | | The level of each event's title heading, 1 to 6. Unset (the default), it is one below the nearest heading before the element in the page (an `<h2>` above gives `<h3>` titles), or 3 when there is none. |
|
|
116
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
117
|
+
| `no-style` | `boolean` | `false` | |
|
|
118
|
+
|
|
119
|
+
### CSS custom properties
|
|
120
|
+
|
|
121
|
+
| Property | Default | Description |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `--events-section-min-height` | `0` | Height the element keeps during its first load (while it has the `loading` attribute). Its placeholder cards already hold the final height; this only matters for a page that wants more. Applies with `no-style` too. Pages can reserve height before the element upgrades with `events-section:not(:defined) { display: block; min-height: … }`. |
|
|
124
|
+
| `--uva-brand-orange-dark` | `#b35900` | Background of the date column (white text on it is 4.8:1). |
|
|
125
|
+
| `--uva-brand-blue` | `#232d4b` | Event title colour. |
|
|
126
|
+
| `--uva-color-link` | | Dark-mode role token: event title colour (else `--uva-brand-blue`). |
|
|
127
|
+
| `--uva-color-text` | | Dark-mode role token: time and status text (else #2b2b2b). |
|
|
128
|
+
| `--uva-color-border` | | Dark-mode role token: card border (else #dadada). |
|
|
129
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: card and button background (else #fff). |
|
|
130
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
131
|
+
|
|
132
|
+
## `<libguides-section>`
|
|
133
|
+
|
|
134
|
+
The first subject guide pages (LibGuides) matching `query`: the page and its guide, then its author and subjects and the matching text. Only text and links are taken from Springshare's HTML.
|
|
135
|
+
|
|
136
|
+
### Attributes
|
|
137
|
+
|
|
138
|
+
| Attribute | Type | Default | Description |
|
|
139
|
+
|---|---|---|---|
|
|
140
|
+
| `query` | `string` | `''` | The search text. Empty: nothing is fetched and the section is `empty`. |
|
|
141
|
+
| `limit` | `number` | `5` | How many results to show (at most). |
|
|
142
|
+
| `no-result-describe` | `string` | `'No results found.'` | The message shown when nothing is found. |
|
|
143
|
+
| `heading-level` | `number \| undefined` | | The level of the section's heading, 1 to 6. Unset (the default), it is one below the nearest heading before the element in the page, or 3 when there is none. `<bento-box>` sets it one below its own heading. |
|
|
144
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
145
|
+
| `no-style` | `boolean` | `false` | |
|
|
146
|
+
|
|
147
|
+
### Events
|
|
148
|
+
|
|
149
|
+
| Event | Description |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
152
|
+
| `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. |
|
|
154
|
+
|
|
155
|
+
### CSS custom properties
|
|
156
|
+
|
|
157
|
+
| Property | Default | Description |
|
|
158
|
+
|---|---|---|
|
|
159
|
+
| `--uva-color-text` | | Dark-mode role token: text (else #2b2b2b). |
|
|
160
|
+
| `--uva-color-link` | | Dark-mode role token: titles, links and buttons (else `--uva-brand-blue`). |
|
|
161
|
+
| `--uva-color-border` | | Dark-mode role token: the block's border and entry rules (else #dadada). |
|
|
162
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: background (else #fff). |
|
|
163
|
+
| `--uva-color-surface-hover` | | Dark-mode role token: the header band (else #dadada). |
|
|
164
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
165
|
+
|
|
166
|
+
## `<library-hours-setup>`
|
|
167
|
+
|
|
168
|
+
Upgrades Drupal's hours placeholders. On library.virginia.edu/hours Drupal renders `<div type="library-weekly-hours" library-slug="…" no-shadow-dom no-style>` for each library; this element replaces each one, in its own root node (the document or a shadow root), with a `<library-weekly-hours>` that has the same attributes (except `type`) and children. `library-slug="harrison"` also gets `hide-building-hours`. Placeholders added later are upgraded too, while this element is connected. It renders nothing.
|
|
169
|
+
|
|
170
|
+
## `<library-weekly-hours>`
|
|
171
|
+
|
|
172
|
+
One library's opening hours for a week (Sunday to Saturday, in America/New_York): a header with "Previous week" / "Next week" buttons and the date range, then a table with a "Building hours" row and a row per space in the library. Data comes from the library website's JSON:API (same origin) and LibCal, shared between all hours elements on a page. Used on library.virginia.edu/hours through `<library-hours-setup>`.
|
|
173
|
+
|
|
174
|
+
### Attributes
|
|
175
|
+
|
|
176
|
+
| Attribute | Type | Default | Description |
|
|
177
|
+
|---|---|---|---|
|
|
178
|
+
| `library-slug` | `string \| undefined` | | The library's `field_slug` in Drupal (for example `clemons`). |
|
|
179
|
+
| `week-count` | `number` | `0` | Which week to show: 0 is this week, 1 next week, -1 last week. Changed by the buttons. |
|
|
180
|
+
| `refresh-every` | `number` | `600000` | How often (ms) the current week's hours are fetched again. 0 turns it off. |
|
|
181
|
+
| `hide-building-hours` | `boolean` | `false` | Hide the "Building hours" row (for a library whose building calendar is one of its spaces). |
|
|
182
|
+
| `heading-level` | `number \| undefined` | | `aria-level` (1–6) of the week heading, also its `heading-h<n>` class. Unset (the default), the level is one below the nearest heading before the element in the page (`aria-level` 3 under a library's `<h2>` on /hours), or 2 when there is none, and the class stays `heading-h2`, the one the library website's CSS styles. |
|
|
183
|
+
| `headinglevelstart` | `number \| undefined` | | Old name of `heading-level`, still accepted; `heading-level` wins. |
|
|
184
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
185
|
+
| `no-style` | `boolean` | `false` | |
|
|
186
|
+
|
|
187
|
+
### CSS parts
|
|
188
|
+
|
|
189
|
+
| Part | Description |
|
|
190
|
+
|---|---|
|
|
191
|
+
| `building-hours` | The "Building hours" table row (shadow mode). |
|
|
192
|
+
|
|
193
|
+
### CSS custom properties
|
|
194
|
+
|
|
195
|
+
| Property | Default | Description |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| `--library-weekly-hours-min-height` | `0` | Height the element keeps during its first load (while it has the `loading` attribute, before any rows show), so content below does not jump when the hours arrive. Applies with `no-style` too. Pages can reserve the same height before the element upgrades with `library-weekly-hours:not(:defined) { display: block; min-height: … }`. |
|
|
198
|
+
| `--uva-brand-orange` | `#e57200` | Border of today's column; focus ring colour. |
|
|
199
|
+
| `--uva-brand-blue` | `#232d4b` | Header and button colour. |
|
|
200
|
+
| `--uva-color-border` | | Dark-mode role token: table cell borders (else #dadada). |
|
|
201
|
+
| `--uva-color-current` | | Dark-mode role token: today's column border (else `--uva-brand-orange`). |
|
|
202
|
+
| `--uva-color-link` | | Dark-mode role token: heading, button text and border (else `--uva-brand-blue`). |
|
|
203
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: button background (else #fff). |
|
|
204
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
205
|
+
|
|
206
|
+
## `<site-analytics>`
|
|
207
|
+
|
|
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`.
|
|
209
|
+
|
|
210
|
+
### Attributes
|
|
211
|
+
|
|
212
|
+
| Attribute | Type | Default | Description |
|
|
213
|
+
|---|---|---|---|
|
|
214
|
+
| `matomourl` | `string` | `'https://analytics.lib.virginia.edu/'` | The Matomo server, ending in `/` (attribute `matomourl`). |
|
|
215
|
+
| `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`): none on load. |
|
|
217
|
+
| `variables` | `Record<string, unknown> \| null` | `null` | Custom dimensions, a JSON object of `{ id: value }`, set before the page view. |
|
|
218
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
219
|
+
| `no-style` | `boolean` | `false` | |
|
|
220
|
+
|
|
221
|
+
### Listens for (on document)
|
|
222
|
+
|
|
223
|
+
| Event | Description |
|
|
224
|
+
|---|---|
|
|
225
|
+
| `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
|
+
| `uvalib-analytics-search` | Listened for on `document` (not fired): a Matomo site search; `detail` is `{ searchQuery, searchCategory?, resultCount? }`. |
|
|
227
|
+
| `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`). |
|
|
228
|
+
| `site-analytics-pageview` | Listened for on `document` too: the same as `uvalib-analytics-pageview`. |
|
|
229
|
+
| `site-analytics-search` | Listened for on `document` too: the same as `uvalib-analytics-search`. |
|
|
230
|
+
| `site-analytics-event` | Listened for on `document` too: the same as `uvalib-analytics-event`. |
|
|
231
|
+
|
|
232
|
+
## `<site-footer>`
|
|
233
|
+
|
|
234
|
+
UVA Library site footer: link columns, contact details and copyright.
|
|
235
|
+
|
|
236
|
+
### Attributes
|
|
237
|
+
|
|
238
|
+
| Attribute | Type | Default | Description |
|
|
239
|
+
|---|---|---|---|
|
|
240
|
+
| `root-link-domain` | `string` | `'https://www.library.virginia.edu'` | |
|
|
241
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
242
|
+
| `no-style` | `boolean` | `false` | |
|
|
243
|
+
|
|
244
|
+
### Slots
|
|
245
|
+
|
|
246
|
+
| Slot | Description |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `pre-footer` | Optional content shown in a band above the footer links. |
|
|
249
|
+
|
|
250
|
+
### CSS parts
|
|
251
|
+
|
|
252
|
+
| Part | Description |
|
|
253
|
+
|---|---|
|
|
254
|
+
| `footer` | The `<footer>` element. |
|
|
255
|
+
|
|
256
|
+
### CSS custom properties
|
|
257
|
+
|
|
258
|
+
| Property | Default | Description |
|
|
259
|
+
|---|---|---|
|
|
260
|
+
| `--uva-brand-blue` | `#232d4b` | Main footer background (also the skip-link background in the shared accessibility sheet, which the footer does not render). |
|
|
261
|
+
| `--uva-blue-alt-300` | `#bfe7f7` | Pre-footer band background. |
|
|
262
|
+
| `--uva-blue-alt-darkest` | `#141e3c` | Copyright bar background. |
|
|
263
|
+
| `--uva-brand-orange` | `#e57200` | Social icon hover colour and focus-visible outline. Footer link and text colours are fixed white. |
|
|
264
|
+
| `--uva-color-pre-footer-bg` | | Dark-mode role token: pre-footer band background (else `--uva-blue-alt-300`). |
|
|
265
|
+
| `--uva-color-pre-footer-text` | | Dark-mode role token: pre-footer band text (else inherited). The footer itself is the same in both schemes. |
|
|
266
|
+
|
|
267
|
+
## `<site-header>`
|
|
268
|
+
|
|
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.
|
|
270
|
+
|
|
271
|
+
### Attributes
|
|
272
|
+
|
|
273
|
+
| Attribute | Type | Default | Description |
|
|
274
|
+
|---|---|---|---|
|
|
275
|
+
| `root-link-domain` | `string` | `'https://www.library.virginia.edu'` | |
|
|
276
|
+
| `variant` | `'full' \| 'vendor'` | `'full'` | |
|
|
277
|
+
| `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"). |
|
|
278
|
+
| `no-main-nav` | `boolean` | `false` | Hide the UVA Library main navigation (the row under the logo and the popover accordion). |
|
|
279
|
+
| `main-nav-label` | `string \| undefined` | | Accessible name of the main navigation (default "Main"). |
|
|
280
|
+
| `main-nav-src` | `string \| undefined` | | URL of JSON main navigation items (`MainNavItem[]`, needs CORS), passed to `<site-main-nav items-src>`. |
|
|
281
|
+
| `main-nav-current` | `string \| undefined` | | The URL whose main-navigation link is marked current, passed to `<site-main-nav current>`. Default: the page location, followed through same-document navigations. |
|
|
282
|
+
| `color-scheme-switch` | `boolean` | `false` | Opt in to dark mode: the page follows the OS light or dark preference ("System"), and a Light / Dark / System control (at the end of the utility-links row on wide screens, at the bottom of the Menu popover on narrow ones) lets the visitor override it, remembered per site in localStorage (`uvalib-color-scheme`). Sets `data-uva-color-scheme` on the root element, and swaps in the reversed logo while dark. Ignored (the page stays light and no control is shown) in browsers without CSS `light-dark()`. |
|
|
283
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
284
|
+
| `no-style` | `boolean` | `false` | |
|
|
285
|
+
|
|
286
|
+
### Slots
|
|
287
|
+
|
|
288
|
+
| Slot | Description |
|
|
289
|
+
|---|---|
|
|
290
|
+
| `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 `<uvalib-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
|
+
| `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
|
+
| `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
|
+
|
|
295
|
+
### CSS parts
|
|
296
|
+
|
|
297
|
+
| Part | Description |
|
|
298
|
+
|---|---|
|
|
299
|
+
| `header` | The `<header>` element. |
|
|
300
|
+
|
|
301
|
+
### Events
|
|
302
|
+
|
|
303
|
+
| Event | Description |
|
|
304
|
+
|---|---|
|
|
305
|
+
| `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. |
|
|
307
|
+
|
|
308
|
+
### CSS custom properties
|
|
309
|
+
|
|
310
|
+
| Property | Default | Description |
|
|
311
|
+
|---|---|---|
|
|
312
|
+
| `--uva-blue-alt-dark` | `#005679` | Utility link colour. |
|
|
313
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Menu button colour. |
|
|
314
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline), and the underline colour of an `aria-current` link (also bold, with a 3px underline). |
|
|
315
|
+
| `--uva-brand-blue` | `#232d4b` | Skip-link background for a skip link slotted into `skip-link` (shadow mode, shared accessibility sheet). |
|
|
316
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: header, Menu popover and theme control background (else #ffffff). |
|
|
317
|
+
| `--uva-color-utility-link` | | Dark-mode role token: utility and site link colour (else `--uva-blue-alt-dark`). |
|
|
318
|
+
| `--uva-color-text` | | Dark-mode role token: Menu button and theme control text (else `--uva-grey-darkest`). |
|
|
319
|
+
| `--uva-color-border` | | Dark-mode role token: popover border and rules (else #ccc). |
|
|
320
|
+
| `--uva-color-control-border` | | Dark-mode role token: theme control border (else `--uva-grey`, #808080). |
|
|
321
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: selected theme option and skip-link background (else `--uva-brand-blue`). |
|
|
322
|
+
| `--uva-color-on-accent` | | Dark-mode role token: selected theme option and skip-link text (else #fff). |
|
|
323
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
324
|
+
| `--uva-color-current` | | Dark-mode role token: current-page underline (else `--uva-brand-orange`). |
|
|
325
|
+
|
|
326
|
+
## `<site-hours-section>`
|
|
327
|
+
|
|
328
|
+
Today's hours for the UVA libraries, as on the library.virginia.edu home page: the date (in America/New_York), a "Today's hours" heading, a list of library and hours pairs and a link to /hours. Data comes from the library website's JSON:API (same origin) and LibCal, shared between all hours elements on a page. The date and hours update when the date changes in New York.
|
|
329
|
+
|
|
330
|
+
### Attributes
|
|
331
|
+
|
|
332
|
+
| Attribute | Type | Default | Description |
|
|
333
|
+
|---|---|---|---|
|
|
334
|
+
| `limited` | `boolean` | `false` | Only libraries with a priority placement (the home page's short list). |
|
|
335
|
+
| `heading-level` | `number` | `3` | The level of the "Today's hours" heading, 2 to 6. The default, 3, fits the home page, where the section sits under an h2; use 2 when it sits directly under the page's h1. |
|
|
336
|
+
| `place-type` | `string \| null` | `null` | Only libraries of this type (`Library`, `space` or `other-professional`). |
|
|
337
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
338
|
+
| `no-style` | `boolean` | `false` | |
|
|
339
|
+
|
|
340
|
+
### Events
|
|
341
|
+
|
|
342
|
+
| Event | Description |
|
|
343
|
+
|---|---|
|
|
344
|
+
| `got-library-hours` | The hours were loaded. `detail` is `{ message }`. Bubbles and is composed. |
|
|
345
|
+
| `got-libraries` | The libraries were loaded (fired after `got-library-hours`). `detail` is `{ message }`. Bubbles and is composed. |
|
|
346
|
+
|
|
347
|
+
### CSS custom properties
|
|
348
|
+
|
|
349
|
+
| Property | Default | Description |
|
|
350
|
+
|---|---|---|
|
|
351
|
+
| `--uva-brand-blue` | `#232d4b` | Heading and link colour. |
|
|
352
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour. |
|
|
353
|
+
| `--site-hours-list-min-height` | `0` | Height the list keeps while the hours load, so the link and content below do not jump when they arrive (seven `limited` libraries take about 12.75rem). |
|
|
354
|
+
| `--uva-color-link` | | Dark-mode role token: heading and link colour (else `--uva-brand-blue`). |
|
|
355
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
356
|
+
|
|
357
|
+
## `<site-main-nav>`
|
|
358
|
+
|
|
359
|
+
The UVA Library main navigation (About, Using the Library, Research & teaching support, Get help), as on library.virginia.edu, following the WAI-ARIA disclosure navigation pattern: one `<nav>` landmark; each group is a `<button aria-expanded aria-controls>` followed by its list of links, and an entry with no group is a plain link. Click, Enter or Space toggles a group and only one is open at a time; Escape closes it and returns focus to its button; arrow keys, Home and End move between the buttons and between a panel's links, and ArrowDown on an open button moves into its panel. In the `bar` layout a panel also closes when focus leaves the nav or on a pointer press outside it. There is no hover-to-open. The items come from, in order of precedence: a `<nav slot="main-nav">` child holding `<ul><li><a href>…</a></li></ul>` (a direct link) or `<li><span>Group</span><ul><li><a href>…` (a group), kept hidden and watched for changes; the `items` property; JSON at `items-src`; and the snapshot of the live menu bundled with the component (see `pnpm sync:main-nav`). Invalid entries are skipped and levels deeper than two are flattened, each with one console warning. Relative hrefs are joined to `root-link-domain`; absolute ones are kept, and fragment-only ones (`#…`, a hash route) stay on this page. A plain click on a link closes the open group. The link for the current page (`current`, default the page location, followed through same-document navigations; host and path, ignoring the query, the hash, a trailing slash and a leading `www.`) gets `aria-current="page"`, and its group button `aria-current="true"`, shown bold with a thick underline. Of links that differ only by hash, the one with the page's hash is marked, else the one without a hash; if every one has a hash, the first is marked while the page has none, and none for a hash none has. `<site-header>` renders it: as a row under the logo on wide screens and as an accordion in the Menu popover on narrow ones.
|
|
360
|
+
|
|
361
|
+
### Attributes
|
|
362
|
+
|
|
363
|
+
| Attribute | Type | Default | Description |
|
|
364
|
+
|---|---|---|---|
|
|
365
|
+
| `label` | `string` | `'Main'` | Accessible name of the navigation landmark. |
|
|
366
|
+
| `root-link-domain` | `string` | `'https://www.library.virginia.edu'` | |
|
|
367
|
+
| `items-src` | `string \| undefined` | | URL of JSON in the `MainNavItem[]` shape (needs CORS); the snapshot is shown until it loads, and if it fails. |
|
|
368
|
+
| `layout` | `'bar' \| 'accordion'` | `'bar'` | `bar` (a row of buttons with floating panels) or `accordion` (stacked, panels in flow). |
|
|
369
|
+
| `current` | `string \| undefined` | | The URL whose link is marked current. Default: the page location, followed through same-document navigations (`popstate`, `hashchange`, and the Navigation API's `currententrychange` where supported). |
|
|
370
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
371
|
+
| `no-style` | `boolean` | `false` | |
|
|
372
|
+
|
|
373
|
+
### Slots
|
|
374
|
+
|
|
375
|
+
| Slot | Description |
|
|
376
|
+
|---|---|
|
|
377
|
+
| `main-nav` | Optional `<nav>` (or `<ul>`) whose list replaces the menu: `<li><a href>` for a direct link, `<li><span>Group</span><ul><li><a href>…</a></li></ul></li>` for a group. It is never shown itself; in light mode it is moved into a hidden holder. |
|
|
378
|
+
|
|
379
|
+
### Events
|
|
380
|
+
|
|
381
|
+
| Event | Description |
|
|
382
|
+
|---|---|
|
|
383
|
+
| `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. |
|
|
385
|
+
|
|
386
|
+
### CSS custom properties
|
|
387
|
+
|
|
388
|
+
| Property | Default | Description |
|
|
389
|
+
|---|---|---|
|
|
390
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Top-level button colour. |
|
|
391
|
+
| `--uva-brand-blue` | `#232d4b` | Bar bottom border, chevrons, panel links, and the hover and expanded button text. |
|
|
392
|
+
| `--uva-grey-100` | `#dadada` | Hover and expanded button background, and panel link hover background. |
|
|
393
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline). |
|
|
394
|
+
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
395
|
+
| `--uva-color-text` | | Dark-mode role token: top-level button text (else `--uva-grey-darkest`). |
|
|
396
|
+
| `--uva-color-link` | | Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`). |
|
|
397
|
+
| `--uva-color-surface-hover` | | Dark-mode role token: hover and open-group background (else `--uva-grey-100`). |
|
|
398
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: bar and panel background (else #ffffff). |
|
|
399
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: bar bottom rule (else `--uva-brand-blue`). |
|
|
400
|
+
| `--uva-color-shadow` | | Dark-mode role token: panel shadow colour (else rgba(0, 0, 0, 0.2)). |
|
|
401
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
402
|
+
| `--uva-color-current` | | Dark-mode role token: current-page underline (else `--uva-brand-orange`). |
|
|
403
|
+
|
|
404
|
+
## `<site-page>`
|
|
405
|
+
|
|
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 `<uvalib-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 `<uvalib-alerts show="list">` (a `<section aria-label="Library alerts">` region, hidden while the list has nothing to show), and `<uvalib-alerts show="regional">` as the first child of `<main>`, inside its padding. The alerts component is 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.
|
|
407
|
+
|
|
408
|
+
### Attributes
|
|
409
|
+
|
|
410
|
+
| Attribute | Type | Default | Description |
|
|
411
|
+
|---|---|---|---|
|
|
412
|
+
| `root-link-domain` | `string` | `'https://www.library.virginia.edu'` | |
|
|
413
|
+
| `header-variant` | `'full' \| 'vendor'` | `'full'` | |
|
|
414
|
+
| `no-global-styles` | `boolean` | `false` | |
|
|
415
|
+
| `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
|
+
| `site-links-label` | `string \| undefined` | | Accessible name of the header navigation when site links are given (default "Site"). |
|
|
417
|
+
| `no-main-nav` | `boolean` | `false` | Hide the UVA Library main navigation in the header. |
|
|
418
|
+
| `main-nav-label` | `string \| undefined` | | Accessible name of the header's main navigation (default "Main"). |
|
|
419
|
+
| `main-nav-src` | `string \| undefined` | | URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. |
|
|
420
|
+
| `main-nav-current` | `string \| undefined` | | The URL whose main-navigation link is marked current, forwarded to `<site-header main-nav-current>`. Default: the page location, followed through same-document navigations; set it when a single-page app's route is not its URL. |
|
|
421
|
+
| `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. |
|
|
422
|
+
| `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. |
|
|
423
|
+
| `no-alerts` | `boolean` | `false` | Render no alert elements and load no alerts script. |
|
|
424
|
+
| `color-scheme-switch` | `boolean` | `false` | Opt in to dark mode, forwarded to `<site-header color-scheme-switch>`: the page follows the OS preference, and a Light / Dark / System control in the header lets the visitor override it (remembered per site). Off by default: the page is always light. The page's own content must support it (see the README's "Dark mode"). |
|
|
425
|
+
| `matomo-id` | `number \| undefined` | | Opt in to Matomo analytics: the site's Matomo id. The page then adds one `<site-analytics>` for it (loading its code only then), which records the page view and what the library's components report (see the README's "Analytics"). Off by default. With an analytics element or a Matomo snippet already on the page nothing is counted twice. |
|
|
426
|
+
| `matomo-url` | `string \| undefined` | | The Matomo server for `matomo-id`, ending in `/` (default: the library's). |
|
|
427
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
428
|
+
| `no-style` | `boolean` | `false` | |
|
|
429
|
+
|
|
430
|
+
### Slots
|
|
431
|
+
|
|
432
|
+
| Slot | Description |
|
|
433
|
+
|---|---|
|
|
434
|
+
| (default) | Main page content, rendered inside the single `<main>`. |
|
|
435
|
+
| `pre-footer` | Optional content shown in a band above the footer. |
|
|
436
|
+
| `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
|
+
| `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"`. |
|
|
438
|
+
|
|
439
|
+
### CSS parts
|
|
440
|
+
|
|
441
|
+
| Part | Description |
|
|
442
|
+
|---|---|
|
|
443
|
+
| `main` | The `<main>` landmark. |
|
|
444
|
+
| `header` | The `<header>` element inside `<site-header>` (shadow mode; exported through `exportparts`). |
|
|
445
|
+
| `footer` | The `<footer>` element inside `<site-footer>` (shadow mode; exported through `exportparts`). |
|
|
446
|
+
|
|
447
|
+
### CSS custom properties
|
|
448
|
+
|
|
449
|
+
| Property | Default | Description |
|
|
450
|
+
|---|---|---|
|
|
451
|
+
| `--uva-brand-blue` | `#232d4b` | Skip link background. |
|
|
452
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
453
|
+
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Page font family (global styles). |
|
|
454
|
+
| `--uva-font-size-base` | `17px` | Page base font size (global styles). |
|
|
455
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Page text colour (global styles). |
|
|
456
|
+
| `--uva-color-surface` | | Dark-mode role token: page background (global styles; else none). |
|
|
457
|
+
| `--uva-color-text` | | Dark-mode role token: page text (global styles; else `--uva-grey-darkest`). |
|
|
458
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: skip-link background (else `--uva-brand-blue`). |
|
|
459
|
+
| `--uva-color-on-accent` | | Dark-mode role token: skip-link text (else #fff). |
|
|
460
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
461
|
+
|
|
462
|
+
## `<site-style>`
|
|
463
|
+
|
|
464
|
+
Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base page styles on the document. Shadow mode only styles inside its own shadow root, so the `:root` and `html, body` rules of those sheets match nothing there and the slotted content is not restyled; it inherits whatever inherited tokens and fonts the page already provides.
|
|
465
|
+
|
|
466
|
+
### Attributes
|
|
467
|
+
|
|
468
|
+
| Attribute | Type | Default | Description |
|
|
469
|
+
|---|---|---|---|
|
|
470
|
+
| `imports` | `{ [key: string]: string }` | `{}` | Map of tag name to a module URL whose default export is a stylesheet; ported as is. |
|
|
471
|
+
| `importedstyles` | `string` | `''` | Accumulated text of the stylesheets loaded through `imports`. Carried over from the old component for compatibility; it is not rendered anywhere. |
|
|
472
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
473
|
+
| `no-style` | `boolean` | `false` | |
|
|
474
|
+
|
|
475
|
+
### Slots
|
|
476
|
+
|
|
477
|
+
| Slot | Description |
|
|
478
|
+
|---|---|
|
|
479
|
+
| (default) | 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. |
|
|
480
|
+
|
|
481
|
+
### CSS custom properties
|
|
482
|
+
|
|
483
|
+
| Property | Default | Description |
|
|
484
|
+
|---|---|---|
|
|
485
|
+
| `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
|
|
486
|
+
| `--uva-font-size-base` | `17px` | Base font size. |
|
|
487
|
+
| `--uva-grey-darkest` | `#2b2b2b` | Text colour. |
|
|
488
|
+
| `--uva-color-text` | | Dark-mode role token: text colour (else `--uva-grey-darkest`). |
|
|
489
|
+
| `--uva-color-surface` | | Dark-mode role token: page background (else none). |
|
|
490
|
+
|
|
491
|
+
## `<uvalib-analytics>`
|
|
492
|
+
|
|
493
|
+
`<site-analytics>` under its original name, for markup such as Drupal's `<uvalib-analytics matomoid="10">`: the same element, attributes and events. A constructor can be registered only once, hence the subclass.
|
|
494
|
+
|
|
495
|
+
### Attributes
|
|
496
|
+
|
|
497
|
+
| Attribute | Type | Default | Description |
|
|
498
|
+
|---|---|---|---|
|
|
499
|
+
| `matomourl` | `string` | `'https://analytics.lib.virginia.edu/'` | The Matomo server, ending in `/` (attribute `matomourl`). |
|
|
500
|
+
| `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`): none on load. |
|
|
502
|
+
| `variables` | `Record<string, unknown> \| null` | `null` | Custom dimensions, a JSON object of `{ id: value }`, set before the page view. |
|
|
503
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
504
|
+
| `no-style` | `boolean` | `false` | |
|
|
505
|
+
|
|
506
|
+
### Listens for (on document)
|
|
507
|
+
|
|
508
|
+
| Event | Description |
|
|
509
|
+
|---|---|
|
|
510
|
+
| `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
|
+
| `uvalib-analytics-search` | Listened for on `document` (not fired): a Matomo site search; `detail` is `{ searchQuery, searchCategory?, resultCount? }`. |
|
|
512
|
+
| `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`). |
|
|
513
|
+
| `site-analytics-pageview` | Listened for on `document` too: the same as `uvalib-analytics-pageview`. |
|
|
514
|
+
| `site-analytics-search` | Listened for on `document` too: the same as `uvalib-analytics-search`. |
|
|
515
|
+
| `site-analytics-event` | Listened for on `document` too: the same as `uvalib-analytics-event`. |
|
|
516
|
+
|
|
517
|
+
## `<uvalib-date-range>`
|
|
518
|
+
|
|
519
|
+
A date-range picker: a two-thumb year slider plus "From" and "To" date inputs. `min` and `max` (ISO dates, `YYYY-MM-DD`) are required; without valid ones the element renders nothing and logs a console warning once. The start can never pass the end, and both stay within `min`..`max`.
|
|
520
|
+
|
|
521
|
+
### Attributes
|
|
522
|
+
|
|
523
|
+
| Attribute | Type | Default | Description |
|
|
524
|
+
|---|---|---|---|
|
|
525
|
+
| `min` | `string` | `''` | Earliest selectable date, `YYYY-MM-DD`. Required. |
|
|
526
|
+
| `max` | `string` | `''` | Latest selectable date, `YYYY-MM-DD`. Required. |
|
|
527
|
+
| `value` | `string[]` | `[]` | Selected `[start, end]` ISO dates. Missing, invalid or out-of-range entries fall back to `min` / `max`. |
|
|
528
|
+
| `label` | `string` | `'Date range'` | Legend text; the two sliders are named from it ("<label>: start year"). |
|
|
529
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
530
|
+
| `no-style` | `boolean` | `false` | |
|
|
531
|
+
|
|
532
|
+
### Events
|
|
533
|
+
|
|
534
|
+
| Event | Description |
|
|
535
|
+
|---|---|
|
|
536
|
+
| `date-range-change` | The range changed from a slider or a date input. `detail` is `{ value: [start, end] }` (ISO dates). Bubbles and is composed. |
|
|
537
|
+
|
|
538
|
+
### CSS custom properties
|
|
539
|
+
|
|
540
|
+
| Property | Default | Description |
|
|
541
|
+
|---|---|---|
|
|
542
|
+
| `--uva-brand-blue` | `#232d4b` | Selected slider range, thumbs, legend and focused date input border. |
|
|
543
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
544
|
+
| `--uva-font-family` | `inherit` | Font family. |
|
|
545
|
+
| `--uva-color-link` | | Dark-mode role token: legend and focused date input border (else `--uva-brand-blue`). |
|
|
546
|
+
| `--uva-color-track` | | Dark-mode role token: slider track (else #e5e7eb). |
|
|
547
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: selected range and thumbs (else `--uva-brand-blue`). |
|
|
548
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: date input background and thumb ring (else #ffffff). |
|
|
549
|
+
| `--uva-color-input-text` | | Dark-mode role token: date input text (else #1f2937). |
|
|
550
|
+
| `--uva-color-text-muted` | | Dark-mode role token: From / To labels (else #4b5563). |
|
|
551
|
+
| `--uva-color-control-border` | | Dark-mode role token: date input border (else `--uva-grey`, #808080). |
|
|
552
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
553
|
+
|
|
554
|
+
## `<uvalib-filter>`
|
|
555
|
+
|
|
556
|
+
A faceted-search filter: a fieldset of checkboxes (value plus result count), optional toggle chips ("scopes") above them, and "See more" / "See less" buttons when `limit` is set. It is controlled: set `filter`, `value` and `scopeValue` from your search state and listen for the change events.
|
|
557
|
+
|
|
558
|
+
### Attributes
|
|
559
|
+
|
|
560
|
+
| Attribute | Type | Default | Description |
|
|
561
|
+
|---|---|---|---|
|
|
562
|
+
| `filter` | `FilterFacet` | `{ name: '', title: '', position: 0, buckets: [] }` | The facet to show: `{ name, title, position, buckets: [{ key, doc_count, selected }] }`. |
|
|
563
|
+
| `value` | `string[]` | `[]` | Selected bucket keys (matched case-insensitively). |
|
|
564
|
+
| `scopes` | `FilterScopeOption[]` | `[]` | Optional toggle chips shown under the legend (for example attendee types): `[{ value, label }]`. |
|
|
565
|
+
| `scopevalue` | `string[]` | `[]` | Pressed scope values (matched case-insensitively). |
|
|
566
|
+
| `scopes-label` | `string` | `''` | Accessible name of the scope chip group. Empty (the default) means `Filter <title> by type`. |
|
|
567
|
+
| `limit` | `number` | `0` | Maximum buckets to show at first; 0 shows all. "See more" doubles it, "See less" halves it back. |
|
|
568
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
569
|
+
| `no-style` | `boolean` | `false` | |
|
|
570
|
+
|
|
571
|
+
### CSS parts
|
|
572
|
+
|
|
573
|
+
| Part | Description |
|
|
574
|
+
|---|---|
|
|
575
|
+
| `see-more` | The "See more" button (shadow mode). |
|
|
576
|
+
| `see-less` | The "See less" button (shadow mode). |
|
|
577
|
+
|
|
578
|
+
### Events
|
|
579
|
+
|
|
580
|
+
| Event | Description |
|
|
581
|
+
|---|---|
|
|
582
|
+
| `filter-change` | A checkbox was toggled. `detail` is `{ name, value }`: the facet name and the new array of selected keys. Does not bubble. |
|
|
583
|
+
| `scope-change` | A scope chip was toggled. `detail` is `{ value }`: the new array of pressed scope values. Does not bubble. |
|
|
584
|
+
|
|
585
|
+
### CSS custom properties
|
|
586
|
+
|
|
587
|
+
| Property | Default | Description |
|
|
588
|
+
|---|---|---|
|
|
589
|
+
| `--uva-brand-blue` | `#232d4b` | Scope chip text, hover border and pressed background. |
|
|
590
|
+
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
591
|
+
| `--uva-color-border` | | Dark-mode role token: divider under the scope chips (else #e5e7eb). |
|
|
592
|
+
| `--uva-color-control-border` | | Dark-mode role token: scope chip border (else `--uva-grey`, #808080). |
|
|
593
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: scope chip background (else #fff). |
|
|
594
|
+
| `--uva-color-link` | | Dark-mode role token: scope chip text and hover border (else `--uva-brand-blue`). |
|
|
595
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: pressed chip background and border (else `--uva-brand-blue`). |
|
|
596
|
+
| `--uva-color-on-accent` | | Dark-mode role token: pressed chip text (else #fff). |
|
|
597
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
598
|
+
|
|
599
|
+
## `<website-section>`
|
|
600
|
+
|
|
601
|
+
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.
|
|
602
|
+
|
|
603
|
+
### Attributes
|
|
604
|
+
|
|
605
|
+
| Attribute | Type | Default | Description |
|
|
606
|
+
|---|---|---|---|
|
|
607
|
+
| `query` | `string` | `''` | The search text. Empty: nothing is fetched and the section is `empty`. |
|
|
608
|
+
| `limit` | `number` | `5` | How many results to show (at most). |
|
|
609
|
+
| `no-result-describe` | `string` | `'No results found.'` | The message shown when nothing is found. |
|
|
610
|
+
| `heading-level` | `number \| undefined` | | The level of the section's heading, 1 to 6. Unset (the default), it is one below the nearest heading before the element in the page, or 3 when there is none. `<bento-box>` sets it one below its own heading. |
|
|
611
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
612
|
+
| `no-style` | `boolean` | `false` | |
|
|
613
|
+
|
|
614
|
+
### Events
|
|
615
|
+
|
|
616
|
+
| Event | Description |
|
|
617
|
+
|---|---|
|
|
618
|
+
| `bento-state` | Whenever `state` changes (bubbles, composed); `<bento-box>` listens to announce "Results updated" once every section has settled. |
|
|
619
|
+
| `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. |
|
|
621
|
+
|
|
622
|
+
### CSS custom properties
|
|
623
|
+
|
|
624
|
+
| Property | Default | Description |
|
|
625
|
+
|---|---|---|
|
|
626
|
+
| `--uva-color-text` | | Dark-mode role token: text (else #2b2b2b). |
|
|
627
|
+
| `--uva-color-link` | | Dark-mode role token: titles, links and buttons (else `--uva-brand-blue`). |
|
|
628
|
+
| `--uva-color-border` | | Dark-mode role token: the block's border and entry rules (else #dadada). |
|
|
629
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: background (else #fff). |
|
|
630
|
+
| `--uva-color-surface-hover` | | Dark-mode role token: the header band (else #dadada). |
|
|
631
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|