@uvalib/web-components 1.8.5 → 1.9.0
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 +22 -0
- package/README.md +485 -59
- package/dist/base/clipboard.d.ts +9 -0
- package/dist/base/clipboard.js +30 -0
- package/dist/base/clipboard.js.map +1 -0
- package/dist/base.css +188 -3
- package/dist/components/uvalib-citation/UvalibCitation.d.ts +124 -0
- package/dist/components/uvalib-citation/UvalibCitation.js +545 -0
- package/dist/components/uvalib-citation/UvalibCitation.js.map +1 -0
- package/dist/components/uvalib-citation/uvalib-citation.d.ts +1 -0
- package/dist/components/uvalib-citation/uvalib-citation.js +4 -0
- package/dist/components/uvalib-citation/uvalib-citation.js.map +1 -0
- package/dist/components/uvalib-dialog/UvalibDialog.d.ts +167 -0
- package/dist/components/uvalib-dialog/UvalibDialog.js +688 -0
- package/dist/components/uvalib-dialog/UvalibDialog.js.map +1 -0
- package/dist/components/uvalib-dialog/uvalib-dialog.d.ts +1 -0
- package/dist/components/uvalib-dialog/uvalib-dialog.js +4 -0
- package/dist/components/uvalib-dialog/uvalib-dialog.js.map +1 -0
- package/dist/components/uvalib-filter/UvalibFilter.d.ts +92 -9
- package/dist/components/uvalib-filter/UvalibFilter.js +748 -60
- package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -1
- package/dist/components/uvalib-metadata/UvalibMetadata.js +3 -4
- package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
- package/dist/custom-elements.json +4402 -2139
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/base.js +41 -1
- package/dist/styles/base.js.map +1 -1
- package/dist/styles/color-scheme.js +4 -0
- package/dist/styles/color-scheme.js.map +1 -1
- package/dist/styles/controls.js +4 -0
- package/dist/styles/controls.js.map +1 -1
- package/dist/styles/field-text.d.ts +1 -0
- package/dist/styles/field-text.js +21 -0
- package/dist/styles/field-text.js.map +1 -0
- package/dist/styles/hidden.js +13 -1
- package/dist/styles/hidden.js.map +1 -1
- package/dist/styles/table.d.ts +1 -0
- package/dist/styles/table.js +164 -0
- package/dist/styles/table.js.map +1 -0
- package/dist/tokens.css +4 -0
- package/dist-cdn/base.css +188 -3
- package/dist-cdn/chunks/{base-B3tNX103.js → base-CHMHBPeI.js} +42 -2
- package/dist-cdn/chunks/{base-B3tNX103.js.map → base-CHMHBPeI.js.map} +1 -1
- package/dist-cdn/chunks/clipboard-CNG7Y_5X.js +18 -0
- package/dist-cdn/chunks/clipboard-CNG7Y_5X.js.map +1 -0
- package/dist-cdn/chunks/if-defined-COiQb-gl.js +6 -0
- package/dist-cdn/chunks/if-defined-COiQb-gl.js.map +1 -0
- package/dist-cdn/chunks/{site-header-CEmNtmk5.js → site-header-B78a_ldi.js} +27 -22
- package/dist-cdn/chunks/site-header-B78a_ldi.js.map +1 -0
- package/dist-cdn/chunks/{site-main-nav-CAwKq_x5.js → site-main-nav-CmMq2t8t.js} +52 -51
- package/dist-cdn/chunks/site-main-nav-CmMq2t8t.js.map +1 -0
- package/dist-cdn/custom-elements.json +4402 -2139
- package/dist-cdn/manifest.json +4 -2
- package/dist-cdn/site-header.js +1 -1
- package/dist-cdn/site-main-nav.js +1 -1
- package/dist-cdn/site-page.js +3 -3
- package/dist-cdn/site-style.js +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +8 -5
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +135 -8
- package/dist-cdn/tokens.css +4 -0
- package/dist-cdn/uvalib-citation.js +382 -0
- package/dist-cdn/uvalib-citation.js.map +1 -0
- package/dist-cdn/uvalib-dialog.js +419 -0
- package/dist-cdn/uvalib-dialog.js.map +1 -0
- package/dist-cdn/uvalib-filter.js +603 -69
- package/dist-cdn/uvalib-filter.js.map +1 -1
- package/dist-cdn/uvalib-metadata.js +49 -49
- package/dist-cdn/uvalib-metadata.js.map +1 -1
- package/package.json +9 -1
- package/skills/uvalib-web-components/SKILL.md +8 -5
- package/skills/uvalib-web-components/reference/components.md +135 -8
- package/dist-cdn/chunks/site-header-CEmNtmk5.js.map +0 -1
- package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,10 +9,10 @@ Reusable web components for UVA Library sites, built with Lit and TypeScript:
|
|
|
9
9
|
- **Cards:** `<uvalib-card>`, `<uvalib-card-grid>` and `<uvalib-pager>`.
|
|
10
10
|
- **Tabs:** `<uvalib-tabs>`.
|
|
11
11
|
- **Long pages:** `<uvalib-back-to-top>` (a “Back to top” button that appears once the top has scrolled away).
|
|
12
|
-
- **Records:** `<uvalib-metadata>` (a record's details, credit, rights and how to cite).
|
|
12
|
+
- **Records:** `<uvalib-metadata>` (a record's details, credit, rights and how to cite) and `<uvalib-citation>` (a citation in several formats, with Copy citation).
|
|
13
13
|
- **Images:** `<uvalib-lightbox>` (an image viewer over plain links), `<uvalib-photo-grid>` (justified rows of thumbnails) and `<uvalib-image-regions>` (numbered region outlines on an image, with their list).
|
|
14
14
|
- **Maps:** `<uvalib-map>` (places on the page's own Leaflet map, sized by a count, with a linked list).
|
|
15
|
-
- **Search:** `<uvalib-filter>`, `<uvalib-date-range>`, `<uvalib-date-histogram>`, `<uvalib-combobox>` (a text field that suggests values as you type), `<uvalib-filter-drawer>` (the filters as a sidebar, or a modal panel on phones) and `<uvalib-pagefind-search>` (with `pagefind.css`, the library theme for Pagefind static-site search).
|
|
15
|
+
- **Search:** `<uvalib-filter>`, `<uvalib-date-range>`, `<uvalib-date-histogram>`, `<uvalib-combobox>` (a text field that suggests values as you type), `<uvalib-filter-drawer>` (the filters as a sidebar, or a modal panel on phones), `<uvalib-dialog>` (a modal dialog for search tips, Cite or a short form) and `<uvalib-pagefind-search>` (with `pagefind.css`, the library theme for Pagefind static-site search).
|
|
16
16
|
- **Library hours:** `<site-hours-section>`, `<library-weekly-hours>` and `<library-hours-setup>`.
|
|
17
17
|
- **Library events:** `<events-section>`.
|
|
18
18
|
- **Search results:** `<bento-box>` (library.virginia.edu/search), with its `<catalog-section>`, `<articles-section>`, `<libguides-section>` and `<website-section>`.
|
|
@@ -558,6 +558,47 @@ Two components for Library sites with records and long texts, such as the Electr
|
|
|
558
558
|
|
|
559
559
|
Both follow dark mode through the role tokens and reflow at 320px; `no-style` keeps only the structure, and light DOM styles are scoped to the tag in `@layer uvalib`.
|
|
560
560
|
|
|
561
|
+
## Citations
|
|
562
|
+
|
|
563
|
+
`<uvalib-citation>` shows one record's citation in several formats, as Virgo's Cite dialog does (MLA, APA, Chicago, Bluebook), with a Copy citation button and an optional Download RIS link. Entry: `uvalib-citation.js` on the CDN, `@uvalib/web-components/uvalib-citation.js` on npm. See the [Citation](https://uvalib.github.io/reusable-web-library/#citation) example. For a single citation in a record's details, `<uvalib-metadata citation="…">` (How to cite, with its own Copy citation button) is still the simpler choice.
|
|
564
|
+
|
|
565
|
+
```html
|
|
566
|
+
<script
|
|
567
|
+
type="module"
|
|
568
|
+
src="https://unpkg.internal.lib.virginia.edu/web-components/v1/uvalib-citation.js"
|
|
569
|
+
></script>
|
|
570
|
+
|
|
571
|
+
<uvalib-citation ris-href="/sources/uva_library/items/u2297137.ris">
|
|
572
|
+
<blockquote data-format="MLA">
|
|
573
|
+
Jefferson, Thomas. <i>Notes on the State of Virginia</i>. Edited by William Peden, U of North
|
|
574
|
+
Carolina P, 1955.
|
|
575
|
+
</blockquote>
|
|
576
|
+
<blockquote data-format="APA">
|
|
577
|
+
Jefferson, T. (1955). <i>Notes on the state of Virginia</i> (W. Peden, Ed.). University of North
|
|
578
|
+
Carolina Press. (Original work published 1785)
|
|
579
|
+
</blockquote>
|
|
580
|
+
<blockquote data-format="Chicago">
|
|
581
|
+
Jefferson, Thomas. <i>Notes on the State of Virginia</i>. Edited by William Peden. Chapel Hill:
|
|
582
|
+
University of North Carolina Press, 1955.
|
|
583
|
+
</blockquote>
|
|
584
|
+
<blockquote data-format="Bluebook">
|
|
585
|
+
Thomas Jefferson, <i>Notes on the State of Virginia</i> (William Peden ed., Univ. of N.C. Press
|
|
586
|
+
1955).
|
|
587
|
+
</blockquote>
|
|
588
|
+
</uvalib-citation>
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
- **Formats as children.** Any element with `data-format` (a `<blockquote>` reads well without the script). Inline markup is kept (`<i>`/`<em>` for a title, `<b>`, `<span lang>`…, copied element by element with only `lang` and `dir`); anything else (links, images, scripts) is reduced to its text, and nothing is parsed as HTML. A second citation with the same name is ignored with a console warning. It follows changes to the children. Apps set the `citations` property instead, `[{ format, text, html? }]`, winning over the children while set: `text` is shown as text, `html` is parsed in an inert template and only its inline elements are kept, as above. Do not fetch citations into the element from a URL template: give it what your page or app already has.
|
|
592
|
+
- **Choosing a format.** A segmented radio group, "Citation format" (native radios: one tab stop, the arrow keys move and select, Space selects), inside a group named by `label` (default "Cite this item", shown in bold above it; `hide-label` keeps it for screen readers only, for a dialog whose heading already says it). The selected format is filled and ticked, never told by colour alone, and in forced colors it is `Highlight`. `format` names the selected one (case-insensitive; default the first) and reflects the visitor's choice; the element fires `uvalib-citation-format` (`detail: { format }`) when the visitor changes it. Why radios and not tabs: choosing a format is a single choice that changes one value (like the header's Light / Dark / System), not a set of panels to browse, so a radio group is the right pattern; tabs would also add a second tab stop and panel semantics for one region of text.
|
|
593
|
+
- **Remembering.** `remember` keeps the visitor's last format in `localStorage` (`uvalib-citation-format`; storage is per origin, so per site) and uses it on the next record that has that format, over `format`. Off by default, so a page shows what its author chose; where storage is blocked it simply is not remembered.
|
|
594
|
+
- **The citation.** Selectable text in a bordered box, a region named "MLA citation" (the selected format's name).
|
|
595
|
+
- **Copy citation.** A 44px `.uvalib-button`. It copies the citation as `text/plain` and, when it has inline markup, also as `text/html` (one `ClipboardItem`), so the italic title stays italic when pasted into a word processor; where HTML is not supported or refused it copies plain text. It then says "MLA citation copied" in a polite `role="status"` next to the button, in the text colour (AAA in light and dark), for five seconds: not a floating toast. If the clipboard is unavailable (permission denied, an insecure page), it selects the citation and says "Could not copy: the MLA citation is selected, copy it with your keyboard".
|
|
596
|
+
- **Exports.** `ris-href` adds a "Download RIS" link (`ris-label` changes its text) with a `download` attribute, styled like the button. Other export links go in the `actions` slot after it: `<a slot="actions" class="uvalib-button" href="…/u2297137.enw" download>EndNote</a>` (give them `.uvalib-button` and keep them 44px tall).
|
|
597
|
+
- **In a dialog.** It assumes nothing about where it sits: put it inline on a record page, or inside a dialog (with `hide-label` when the dialog's heading is "Cite this item").
|
|
598
|
+
- **No jump on upgrade.** With `base.css`, only the first citation shows before the script runs, boxed as it will be, and the label, the format bar and the Copy citation row are held, so nothing moves when it upgrades. The `citations` property cannot be held that way.
|
|
599
|
+
- **Colours and modes.** Dark mode follows the role tokens; it reflows at 320px (the format bar scrolls sideways if the names do not fit); `no-style` keeps only the structure (the 44px radios, the hidden label); light DOM styles are scoped to the tag in `@layer uvalib`.
|
|
600
|
+
- **Analytics.** `['uvalib-citation', 'format', '<format>']` once the visitor settles on a format (a second after the last change, nothing when they end where they started), `['uvalib-citation', 'copy', '<format>']` and `['uvalib-citation', 'download', 'ris']`. Never the citation.
|
|
601
|
+
|
|
561
602
|
## Images
|
|
562
603
|
|
|
563
604
|
`<uvalib-lightbox>` opens a set of plain image links in a dialog. `<uvalib-photo-grid>` lays the thumbnails out in justified rows. Entries: `uvalib-lightbox.js` and `uvalib-photo-grid.js` on the CDN, `@uvalib/web-components/uvalib-lightbox.js` and `…/uvalib-photo-grid.js` on npm. Without JavaScript the links still open the image.
|
|
@@ -971,6 +1012,133 @@ An inline message for the page's own content: a search error, a notice that resu
|
|
|
971
1012
|
- **Live regions:** use `role="alert"` only for an error that appears in response to what the visitor did (it interrupts); use `role="status"` for a notice or confirmation (polite). For a status to be announced reliably, put the empty `role="status"` container in the page first and fill it later, rather than inserting the whole element. A message that is there when the page loads needs no role. Do not put an alert role on a message that is always shown.
|
|
972
1013
|
- **Forced colors:** every message keeps a system-colour border, thicker at the start. In the flow of the page it is a block with the content's own width, its first and last child without outer margins.
|
|
973
1014
|
|
|
1015
|
+
## Tables
|
|
1016
|
+
|
|
1017
|
+
Data tables in the page's own content (holdings, schedules, statistics) in the library look: library.virginia.edu's W3.CSS tables (left-aligned cells padded 8px, the first column 16px from the edge, top-aligned, a light rule between rows), the same rules `<library-weekly-hours>` draws. The classes are in `base.css`. See the [Tables](https://uvalib.github.io/reusable-web-library/#tables) example.
|
|
1018
|
+
|
|
1019
|
+
```html
|
|
1020
|
+
<!-- Holdings grouped by library: a heading per library, then its table. -->
|
|
1021
|
+
<h3>Clemons Library</h3>
|
|
1022
|
+
<table class="uvalib-table">
|
|
1023
|
+
<caption>
|
|
1024
|
+
Clemons Library holdings
|
|
1025
|
+
</caption>
|
|
1026
|
+
<thead>
|
|
1027
|
+
<tr>
|
|
1028
|
+
<th scope="col">Location</th>
|
|
1029
|
+
<th scope="col">Call number</th>
|
|
1030
|
+
<th scope="col">Barcode</th>
|
|
1031
|
+
</tr>
|
|
1032
|
+
</thead>
|
|
1033
|
+
<tbody>
|
|
1034
|
+
<tr>
|
|
1035
|
+
<td>Stacks</td>
|
|
1036
|
+
<td>PS3545 .O337 Z5 2004</td>
|
|
1037
|
+
<td>X004812345</td>
|
|
1038
|
+
</tr>
|
|
1039
|
+
</tbody>
|
|
1040
|
+
</table>
|
|
1041
|
+
<h3>Law Library</h3>
|
|
1042
|
+
<table class="uvalib-table">
|
|
1043
|
+
<caption>
|
|
1044
|
+
Law Library holdings
|
|
1045
|
+
</caption>
|
|
1046
|
+
<thead>
|
|
1047
|
+
<tr>
|
|
1048
|
+
<th scope="col">Location</th>
|
|
1049
|
+
<th scope="col">Call number</th>
|
|
1050
|
+
<th scope="col">Barcode</th>
|
|
1051
|
+
</tr>
|
|
1052
|
+
</thead>
|
|
1053
|
+
<tbody>
|
|
1054
|
+
<tr>
|
|
1055
|
+
<td>Law Library Stacks, Lower Level</td>
|
|
1056
|
+
<td>KF4550 .A2 1787a vol. 1–4 suppl.</td>
|
|
1057
|
+
<td>35000101234567890123456789</td>
|
|
1058
|
+
</tr>
|
|
1059
|
+
</tbody>
|
|
1060
|
+
</table>
|
|
1061
|
+
|
|
1062
|
+
<!-- A striped, compact schedule with a number column. -->
|
|
1063
|
+
<table class="uvalib-table uvalib-table--striped uvalib-table--compact">
|
|
1064
|
+
<caption>
|
|
1065
|
+
Study rooms this week
|
|
1066
|
+
</caption>
|
|
1067
|
+
<thead>
|
|
1068
|
+
<tr>
|
|
1069
|
+
<th scope="col">Day</th>
|
|
1070
|
+
<th scope="col">Hours</th>
|
|
1071
|
+
<th scope="col" class="uvalib-table__num">Rooms free</th>
|
|
1072
|
+
</tr>
|
|
1073
|
+
</thead>
|
|
1074
|
+
<tbody>
|
|
1075
|
+
<tr>
|
|
1076
|
+
<th scope="row">Monday</th>
|
|
1077
|
+
<td>8 a.m. – midnight</td>
|
|
1078
|
+
<td class="uvalib-table__num">12</td>
|
|
1079
|
+
</tr>
|
|
1080
|
+
<tr>
|
|
1081
|
+
<th scope="row">Tuesday</th>
|
|
1082
|
+
<td>8 a.m. – midnight</td>
|
|
1083
|
+
<td class="uvalib-table__num">7</td>
|
|
1084
|
+
</tr>
|
|
1085
|
+
</tbody>
|
|
1086
|
+
</table>
|
|
1087
|
+
|
|
1088
|
+
<!-- A wide table scrolls inside its own region, named by the caption. -->
|
|
1089
|
+
<div class="uvalib-table-scroll" role="region" tabindex="0" aria-labelledby="circ-caption">
|
|
1090
|
+
<table class="uvalib-table">
|
|
1091
|
+
<caption id="circ-caption">
|
|
1092
|
+
Items borrowed per month, 2025
|
|
1093
|
+
</caption>
|
|
1094
|
+
<thead>
|
|
1095
|
+
<tr>
|
|
1096
|
+
<th scope="col">Library</th>
|
|
1097
|
+
<th scope="col" class="uvalib-table__num">Jan</th>
|
|
1098
|
+
<th scope="col" class="uvalib-table__num">Feb</th>
|
|
1099
|
+
<!-- … -->
|
|
1100
|
+
</tr>
|
|
1101
|
+
</thead>
|
|
1102
|
+
<tbody>
|
|
1103
|
+
<tr>
|
|
1104
|
+
<th scope="row">Clemons Library</th>
|
|
1105
|
+
<td class="uvalib-table__num">4,210</td>
|
|
1106
|
+
<td class="uvalib-table__num">3,987</td>
|
|
1107
|
+
</tr>
|
|
1108
|
+
</tbody>
|
|
1109
|
+
</table>
|
|
1110
|
+
</div>
|
|
1111
|
+
|
|
1112
|
+
<!-- Opt-in: rows stack below 30em of the wrapper's width. Explicit roles are required. -->
|
|
1113
|
+
<div class="uvalib-table-stack">
|
|
1114
|
+
<table class="uvalib-table uvalib-table--stack" role="table">
|
|
1115
|
+
<caption>
|
|
1116
|
+
Clemons Library holdings
|
|
1117
|
+
</caption>
|
|
1118
|
+
<thead role="rowgroup">
|
|
1119
|
+
<tr role="row">
|
|
1120
|
+
<th scope="col" role="columnheader">Location</th>
|
|
1121
|
+
<th scope="col" role="columnheader">Call number</th>
|
|
1122
|
+
</tr>
|
|
1123
|
+
</thead>
|
|
1124
|
+
<tbody role="rowgroup">
|
|
1125
|
+
<tr role="row">
|
|
1126
|
+
<td role="cell" data-label="Location">Stacks</td>
|
|
1127
|
+
<td role="cell" data-label="Call number">PS3545 .O337 Z5 2004</td>
|
|
1128
|
+
</tr>
|
|
1129
|
+
</tbody>
|
|
1130
|
+
</table>
|
|
1131
|
+
</div>
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
- **`.uvalib-table`** on a `<table>`: full width, collapsed borders, bold left-aligned header cells, a 2px rule under the header row and a 1px rule between rows (`--uva-color-table-border`). Cells wrap long values anywhere, so a long barcode, call number or URL never pushes the table past a phone's width.
|
|
1135
|
+
- **Every table needs an accessible name:** a `<caption>` (drawn as a bold line above the table; keep it visible) or `aria-labelledby` pointing at a visible heading. Header cells are `<th>` with `scope="col"` or `scope="row"` (a row's first cell is often its header: a day, a library); use `<td>` for data. Do not use a table for layout, and do not leave empty header cells: give them visually hidden text.
|
|
1136
|
+
- **Modifiers:** `--striped` (every even body row on `--uva-color-table-stripe`; body text is 12.5:1 on it in light and 12.6:1 in dark, AAA), `--compact` (4px by 8px cells), and **`.uvalib-table__num`** on a `<th>` or `<td>` for numbers: right-aligned with tabular digits, so columns line up. Put it on the column's header too.
|
|
1137
|
+
- **Wide tables:** wrap the table in `<div class="uvalib-table-scroll" role="region" tabindex="0" aria-labelledby="CAPTION-ID">` (give the caption that id). The wrapper scrolls sideways inside itself, never the page; `tabindex="0"` lets keyboard users focus and scroll it (it shows the library focus ring), and the region is named by the caption. Inside it, cells break only words that cannot fit. This is the default for any table wider than a phone.
|
|
1138
|
+
- **Stacked rows (opt-in):** in a `.uvalib-table-stack` wrapper (a size container), `.uvalib-table--stack` turns each row into a block when the wrapper is 30em wide or narrower (480px at 16px; in a sidebar too), each cell headed by its `data-label` (drawn by CSS and hidden from screen readers, which hear the column header). Changing a table's display removes its table semantics in some browsers (Safari/WebKit), so **a stacked table must carry explicit roles**: `role="table"` on the table, `rowgroup` on `<thead>`/`<tbody>`, `row`, `columnheader` (and `rowheader` for a `<th scope="row">`) and `cell`. Prefer the scroll wrapper; stack only short tables whose rows read well as cards.
|
|
1139
|
+
- **Grouped tables** (holdings by library, items by location): a heading per group followed by its table, each table with its own caption. The heading level follows the page's outline (Virgo's record design uses `<h5>` for locations because of where they sit; on your page it may be `<h2>` or `<h3>`), never a fixed level.
|
|
1140
|
+
- **Forced colors** draws the rules in the system text colour and drops the stripes; **print** draws the rules black, drops the stripes, and lets a scroll-wrapped table print in full. `hidden` hides a table, the wrappers and a stacked row.
|
|
1141
|
+
|
|
974
1142
|
## Back to top
|
|
975
1143
|
|
|
976
1144
|
`<uvalib-back-to-top>` is a “Back to top” button for long pages: minutes, finding aids, transcriptions, long result lists. Entry: `uvalib-back-to-top.js` on the CDN, `@uvalib/web-components/uvalib-back-to-top.js` on npm. See the [Back to top](https://uvalib.github.io/reusable-web-library/#back-to-top) example.
|
|
@@ -1135,6 +1303,59 @@ The filter and the date range are controlled: set `value` (and `scopeValue`) fro
|
|
|
1135
1303
|
</script>
|
|
1136
1304
|
```
|
|
1137
1305
|
|
|
1306
|
+
### Filter groups
|
|
1307
|
+
|
|
1308
|
+
A search page's facets (Availability, Subject, Format, Date, Author…) can each be a filter group: `<uvalib-filter>` has six opt-in attributes for that, and without them it is exactly as before (same markup, order and events).
|
|
1309
|
+
|
|
1310
|
+
- `collapsible` turns the legend into a disclosure button (`aria-expanded`, `aria-controls`) with the library's caret, as in `<uvalib-contents>` and the main navigation (it flips at once, with no motion). Enter and Space toggle it. `collapsed` starts it closed and is reflected as the visitor toggles; nothing is remembered, so the page decides each time. While closed, the button shows how many values are selected ("Subject, 2 selected"), so a closed group never hides an active filter. Each toggle fires `toggle` with `{ open }`. `heading-level="2"` to `"6"` puts the legend's text (or button) in that heading for the page outline; by default there is none, as before. base.css holds a `collapsible collapsed` group at its 44px button until the script loads, so the page does not move.
|
|
1311
|
+
- `searchable` adds a search field above the values (labelled "Search Subject", or `search-label`) that narrows them as the visitor types: case- and accent-insensitive ("eco" finds "Écologie"), the matched text bold and underlined in a `<mark>`. A line under it says "12 of 340 subjects" (`unit="subjects"`; the default is "values"), also said politely once typing pauses. Checked values always stay in the list, pinned at the top, so a selection never disappears while filtering. While searching, every match is shown (no See more), up to 100 ("type more to narrow them"); clearing the search brings `limit` and See more back. Escape clears the search (and, while there is text, does not close a surrounding filter drawer). The field has no `name`, so it is never submitted with a form.
|
|
1312
|
+
- `sortable` adds "Sort by: Count | Name (A–Z)": two native radios drawn as a segmented control (one tab stop, arrow keys choose), the current sort filled and ticked on every group, so it is never left to colour or to an icon on some groups only. `sort="count"` (the default) is most results first, ties in the data's order; `sort="name"` is A–Z. Without `sortable` the data's own order is kept, unless you set `sort="name"`. The visitor's choice updates `sort` and fires `sort` with `{ sort }`.
|
|
1313
|
+
- `clearable` adds a 44px "Clear" button (named "Clear Subject filters"), shown only while something in the group is selected. It fires one `filter-change` with `{ name, value: [] }` and moves focus to the group's first checkbox.
|
|
1314
|
+
- `apply-button` stages checkbox changes until the visitor presses Apply, for searches that are slow to run (one search per Apply instead of one per checkbox). Changed rows say "not applied" in words, a polite status says "3 changes not applied yet", and the button reads "Apply 3 changes". Apply fires `filter-change` once with the new value; Reset goes back to the applied `value`. Setting a different `value` from the page drops staged changes (the same value, re-set after another group's search, keeps them). Clear acts at once.
|
|
1315
|
+
- `match="any"` or `match="all"` says under the legend how the group's values combine ("Matches any selected value" / "Matches all selected values"), and describes the group to assistive technology. It changes only the text; your search decides the logic. No text by default.
|
|
1316
|
+
|
|
1317
|
+
Analytics: `toggle` (1 open, 0 closed), `sort` (`Subject: name`), `clear` and `apply` with the number of values, and `search` with the number of matches once a search pauses, never the typed text; with `apply-button`, each value's `facet-change` is sent when Apply is pressed.
|
|
1318
|
+
|
|
1319
|
+
```html
|
|
1320
|
+
<uvalib-filter
|
|
1321
|
+
id="subjects"
|
|
1322
|
+
collapsible
|
|
1323
|
+
heading-level="2"
|
|
1324
|
+
searchable
|
|
1325
|
+
sortable
|
|
1326
|
+
clearable
|
|
1327
|
+
match="any"
|
|
1328
|
+
unit="subjects"
|
|
1329
|
+
limit="5"
|
|
1330
|
+
></uvalib-filter>
|
|
1331
|
+
<uvalib-filter id="formats" collapsible collapsed heading-level="2" apply-button></uvalib-filter>
|
|
1332
|
+
<script type="module">
|
|
1333
|
+
await customElements.whenDefined('uvalib-filter');
|
|
1334
|
+
const facet = (name, title, keys) => ({
|
|
1335
|
+
name,
|
|
1336
|
+
title,
|
|
1337
|
+
position: 0,
|
|
1338
|
+
buckets: keys.map(([key, doc_count]) => ({ key, doc_count, selected: false })),
|
|
1339
|
+
});
|
|
1340
|
+
const groups = {
|
|
1341
|
+
subjects: facet('subject', 'Subject', [
|
|
1342
|
+
['History', 40],
|
|
1343
|
+
['Écologie', 12],
|
|
1344
|
+
]),
|
|
1345
|
+
formats: facet('format', 'Format', [
|
|
1346
|
+
['Book', 120],
|
|
1347
|
+
['Map', 18],
|
|
1348
|
+
]),
|
|
1349
|
+
};
|
|
1350
|
+
for (const [id, filter] of Object.entries(groups)) {
|
|
1351
|
+
const el = document.getElementById(id);
|
|
1352
|
+
el.filter = filter;
|
|
1353
|
+
// Controlled: run the search, then set value from your search state.
|
|
1354
|
+
el.addEventListener('filter-change', (e) => (el.value = e.detail.value));
|
|
1355
|
+
}
|
|
1356
|
+
</script>
|
|
1357
|
+
```
|
|
1358
|
+
|
|
1138
1359
|
## Combobox
|
|
1139
1360
|
|
|
1140
1361
|
`<uvalib-combobox>` is a text field that suggests values as you type, from a local list or a URL: a person, place or subject picker. It follows the WAI-ARIA APG [editable combobox with list autocomplete](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/) and looks like `.uvalib-input`. Entry: `uvalib-combobox.js` on the CDN, `@uvalib/web-components/uvalib-combobox.js` on npm.
|
|
@@ -1251,6 +1472,82 @@ The filter and the date range are controlled: set `value` (and `scopeValue`) fro
|
|
|
1251
1472
|
|
|
1252
1473
|
- **Analytics.** `open` and `close` with the drawer's `label`, only when the visitor does it (not a resize or a script).
|
|
1253
1474
|
|
|
1475
|
+
## Dialog
|
|
1476
|
+
|
|
1477
|
+
`<uvalib-dialog>` is a modal dialog for content and short forms: search tips, Cite, a sign-in prompt, a request form. It looks and behaves like the library's other dialogs (`<uvalib-lightbox>`, `<uvalib-filter-drawer>`): a native `<dialog>` opened with `showModal()`, a visible heading that names it, a 44px Close button, the same tokens, backdrop, dark mode and forced colors. Use it instead of a hand-built modal, a `role="dialog"` div or a framework's dialog (such as PrimeVue's). Entry: `uvalib-dialog.js` on the CDN, `@uvalib/web-components/uvalib-dialog.js` on npm. See the [Dialog](https://uvalib.github.io/reusable-web-library/#dialog) example.
|
|
1478
|
+
|
|
1479
|
+
```html
|
|
1480
|
+
<script
|
|
1481
|
+
type="module"
|
|
1482
|
+
src="https://unpkg.internal.lib.virginia.edu/web-components/v1/uvalib-dialog.js"
|
|
1483
|
+
></script>
|
|
1484
|
+
|
|
1485
|
+
<!-- A content dialog opened by a button anywhere in the page. -->
|
|
1486
|
+
<button type="button" class="uvalib-button" data-uvalib-dialog="search-tips">Search tips</button>
|
|
1487
|
+
|
|
1488
|
+
<uvalib-dialog id="search-tips" label="Search tips">
|
|
1489
|
+
<ul>
|
|
1490
|
+
<li>Put a phrase in quotes: <code>"board of visitors"</code>.</li>
|
|
1491
|
+
<li>Use <code>OR</code> for either word: <code>Jefferson OR Madison</code>.</li>
|
|
1492
|
+
</ul>
|
|
1493
|
+
<p>
|
|
1494
|
+
<a href="https://guides.lib.virginia.edu/" target="_blank" rel="noopener"
|
|
1495
|
+
>Research guides (opens in a new tab)</a
|
|
1496
|
+
>
|
|
1497
|
+
</p>
|
|
1498
|
+
</uvalib-dialog>
|
|
1499
|
+
|
|
1500
|
+
<!-- A form dialog: method="dialog" closes it with the button's value. -->
|
|
1501
|
+
<button type="button" class="uvalib-button" data-uvalib-dialog="email-cite">Email citation</button>
|
|
1502
|
+
|
|
1503
|
+
<uvalib-dialog id="email-cite" label="Email this citation" size="small">
|
|
1504
|
+
<form method="dialog">
|
|
1505
|
+
<div class="uvalib-message uvalib-message--error" role="alert" id="cite-errors" hidden></div>
|
|
1506
|
+
<label for="cite-email">Email <span class="uvalib-required">(required)</span></label>
|
|
1507
|
+
<input
|
|
1508
|
+
class="uvalib-input"
|
|
1509
|
+
id="cite-email"
|
|
1510
|
+
name="email"
|
|
1511
|
+
type="email"
|
|
1512
|
+
required
|
|
1513
|
+
autofocus
|
|
1514
|
+
aria-describedby="cite-email-help"
|
|
1515
|
+
/>
|
|
1516
|
+
<span class="uvalib-help" id="cite-email-help">We send the citation to this address only.</span>
|
|
1517
|
+
<button class="uvalib-button" value="send">Send</button>
|
|
1518
|
+
<button class="uvalib-button uvalib-button--secondary" value="cancel" formnovalidate>
|
|
1519
|
+
Cancel
|
|
1520
|
+
</button>
|
|
1521
|
+
</form>
|
|
1522
|
+
</uvalib-dialog>
|
|
1523
|
+
|
|
1524
|
+
<script type="module">
|
|
1525
|
+
const dialog = document.querySelector('#email-cite');
|
|
1526
|
+
dialog.addEventListener('uvalib-dialog-close', (e) => {
|
|
1527
|
+
if (e.detail.returnValue === 'send') {
|
|
1528
|
+
/* send it */
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
// From script (after a sign-in check, say): focus returns to what had focus.
|
|
1532
|
+
// dialog.show(); dialog.close('cancel');
|
|
1533
|
+
</script>
|
|
1534
|
+
```
|
|
1535
|
+
|
|
1536
|
+
- **Opening.** A `<button type="button" data-uvalib-dialog="<id>">` anywhere in the document opens the dialog with that id: one delegated listener, so buttons a framework renders later work too (also inside another component's shadow root). Where the browser has invoker commands, `<button commandfor="<id>" command="--show-modal">` works too; the built-in `show-modal` command only applies to a real `<dialog>`, so a custom element needs the `--show-modal` custom command (`--close` closes it). Keep `data-uvalib-dialog` for browsers without invokers; no polyfill is needed. From script: `show()`, `close(returnValue?)`, or set `open` (it reflects, so `<uvalib-dialog open>` and a framework's `:open` binding work).
|
|
1537
|
+
- **Focus.** On open, focus moves to the content's `[autofocus]` element if there is one (a form dialog: put `autofocus` on the first field), else to the heading (`tabindex="-1"`), so a screen reader starts at the top and long content opens at its start (the APG's advice for content dialogs). On every close, whichever way (Close, Escape, the backdrop, Cancel, a form submit, `close()`, the element being removed), focus returns to the element that opened it; if that element is gone, to `return-focus` (a selector, or an element set as the property). Virgo's dialogs sent focus to the top of the page instead.
|
|
1538
|
+
- **Modal.** `showModal()` makes the rest of the page inert, `<site-page>`'s shadow header, skip link and alerts included: Tab and a screen reader's virtual cursor stay in the dialog with no trap script, and nothing else needs `inert` or `aria-hidden`.
|
|
1539
|
+
- **Dismissal.** Escape always closes it (if a control inside uses Escape itself, such as a combobox, it must stop the key while it handles it). A click on the backdrop closes it (`closedby="any"`; in Safari, which lacks `closedby`, the same check in script), but a press that starts inside and ends on the backdrop (selecting text, a drag) does not. `persistent` keeps the backdrop from closing it, for a form that would lose typed text; Escape and Close still work.
|
|
1540
|
+
- **Forms.** A `<form method="dialog">` (or a submitter with `formmethod="dialog"`) closes it on submit with the submitter's `value` as `returnValue`, after the browser's own validation; give Cancel `formnovalidate`. A `<button data-uvalib-dialog-close="cancel">` closes it without submitting. Other forms submit as usual (call `close()` yourself when done). `uvalib-dialog-close` has `detail.returnValue` and `detail.reason` (`close-button`, `button`, `escape`, `backdrop`, `form`, `api` or `removed`); `uvalib-dialog-open` has `detail.reason` (`button` or `api`).
|
|
1541
|
+
- **Required and help text.** Say "required" in words (`<span class="uvalib-required">(required)</span>` in the label, plus `required` on the field), never with colour or an asterisk alone. Help text is `.uvalib-help`, tied to its field with `aria-describedby`. Both are in `base.css` in the muted text colour, 7:1 or more in light and dark (WCAG AAA): Virgo's grey failed contrast.
|
|
1542
|
+
- **Errors.** Never only red outlines. On a failed submit, fill an error summary at the top of the form, `<div class="uvalib-message uvalib-message--error" role="alert">`, that starts with “Error:” and lists each problem as a link to its field; set `aria-invalid="true"` on each bad field and put its own message next to it, tied with `aria-describedby`. Then move focus to the first bad field. Clear it all when the field is fixed.
|
|
1543
|
+
- **Status messages.** A "Copied" or "Sent" confirmation inside the dialog is a `<div class="uvalib-message uvalib-message--success" role="status">` that is in the dialog from the start and filled when it happens (text 7:1 or more in light and dark), not a toast: Virgo's copy toast failed contrast and disappeared before it could be read. Keep focus where it was.
|
|
1544
|
+
- **Links.** A link that opens a new tab or window says so in its text (“(opens in a new tab)”); better, open it in the same tab.
|
|
1545
|
+
- **Sizes.** `size="small"` (30rem), `medium` (the default, 40rem) or `large` (60rem) at most; `--uvalib-dialog-width` sets another width. On phones it is the viewport less 16px on each side, never taller than the viewport less 32px; the content scrolls inside it and the heading and Close stay in view (320px reflow).
|
|
1546
|
+
- **Content stays yours.** In shadow DOM the children are slotted, never moved: ids, `getElementById`, the page's CSS and listeners, and framework-rendered content keep working (use the default shadow mode with Vue, React and the like). With `no-shadow-dom` they are moved into the dialog element, in the same document. `description` (or a `slot="description"` child) is shown under the heading and set as `aria-describedby`; use it only for a short sentence.
|
|
1547
|
+
- **Look.** It fades in (no motion with reduced motion); in forced colors it keeps a 2px system-colour edge. Style it with `::part(dialog)`, `header`, `heading`, `close`, `description` and `body`, and `:state(open)`.
|
|
1548
|
+
- **Before the script loads.** `base.css` hides `uvalib-dialog:not(:defined)`, so the content never shows in the page; once defined, a closed dialog renders nothing.
|
|
1549
|
+
- **Analytics.** `['uvalib-dialog', 'open', '<label>']` when a visitor's button opens it and `['uvalib-dialog', 'close', '<label>']` when the visitor closes it; nothing for `show()`, `close()` or `open` from script, and never the content or what was typed.
|
|
1550
|
+
|
|
1254
1551
|
## Results, badges and tags
|
|
1255
1552
|
|
|
1256
1553
|
For search pages, Virgo-like result lists and digital collections: badges and labels, a toolbar above the results, a results count that screen readers hear, keyword lists, an empty state and loading placeholders. The classes are in `base.css` (no script); `<uvalib-tag-list>` and `<uvalib-results-count>` are elements with their own entries (`uvalib-tag-list.js`, `uvalib-results-count.js`; npm `@uvalib/web-components/uvalib-tag-list.js`, `…/uvalib-results-count.js`). See the [Results toolbar & badges](https://uvalib.github.io/reusable-web-library/#results-toolbar) example.
|
|
@@ -1637,55 +1934,57 @@ Static sites that search with [Pagefind](https://pagefind.app) (such as Electron
|
|
|
1637
1934
|
- **`<site-page matomo-id="N">`** (and optional `matomo-url` and `matomo-downloads`) adds one `<site-analytics>` for that site and loads its code only then. Off by default. While that code loads, what the components report is kept and handed over, so an early bento search is not lost. If the page already has a `<site-analytics>` or `<uvalib-analytics>` (including the old v0.0.12 one), site-page adds none and that element does the recording.
|
|
1638
1935
|
- **What the library's components send.** They only fire `uvalib-analytics-*` events, so nothing happens without an analytics element (the old v0.0.12 element records them too). Every event is `[category, action, name?, value?]`: the category is the component's tag, the action a fixed verb, the name a short label from the library's own chrome or data (never a URL, never typed text), the value a number. Each one follows a visitor's action or a real failure: nothing is sent on render, re-render, the initial state or a restored one (a filter value set by the app, a remembered colour scheme). Errors are sent once per element and kind of failure.
|
|
1639
1936
|
|
|
1640
|
-
| Component | Action
|
|
1641
|
-
| -------------------------------------------- |
|
|
1642
|
-
| `site-header` | `link-click` (a utility or site link)
|
|
1643
|
-
| `site-header` | `menu-open` (the phone Menu popover)
|
|
1644
|
-
| `site-header` | `skip-link`, `logo-click`
|
|
1645
|
-
| `site-header` | `color-scheme`
|
|
1646
|
-
| `site-main-nav` | `menu-open` (a group opens, not closes)
|
|
1647
|
-
| `site-main-nav` | `link-click`
|
|
1648
|
-
| `site-footer` | `link-click` (not the pre-footer's)
|
|
1649
|
-
| `uvalib-breadcrumbs` | `link-click`
|
|
1650
|
-
| `uvalib-card` | `card-click`
|
|
1651
|
-
| `uvalib-pager` | `page-change`
|
|
1652
|
-
| `uvalib-pager` | `load-more`
|
|
1653
|
-
| `uvalib-tabs` | `change`
|
|
1654
|
-
| `uvalib-contents` | `link-click`
|
|
1655
|
-
| `uvalib-contents` | `toggle` (the narrow-screen disclosure)
|
|
1656
|
-
| `uvalib-metadata` | `copy-citation` (downloads are left to Matomo's, or to `downloads="event"`)
|
|
1657
|
-
| `uvalib-metadata` | `show-all`, `show-fewer` (a long list's toggle)
|
|
1658
|
-
| `uvalib-
|
|
1659
|
-
| `uvalib-lightbox`
|
|
1660
|
-
| `uvalib-
|
|
1661
|
-
| `uvalib-
|
|
1662
|
-
| `uvalib-tag-list` | `
|
|
1663
|
-
| `
|
|
1664
|
-
| `site-alerts` |
|
|
1665
|
-
| `site-alerts` | `
|
|
1666
|
-
| `
|
|
1667
|
-
| `events-section` | `
|
|
1668
|
-
| `
|
|
1669
|
-
| `site-hours-section
|
|
1670
|
-
| `library-weekly-hours`
|
|
1671
|
-
| `
|
|
1672
|
-
| `uvalib-chip-group` | `
|
|
1673
|
-
| `uvalib-
|
|
1674
|
-
| `uvalib-combobox` | `
|
|
1675
|
-
| `uvalib-combobox` | `
|
|
1676
|
-
| `uvalib-
|
|
1677
|
-
| `uvalib-
|
|
1678
|
-
| `uvalib-
|
|
1679
|
-
| `uvalib-
|
|
1680
|
-
| `uvalib-map` | `
|
|
1681
|
-
| `uvalib-
|
|
1682
|
-
| `uvalib-
|
|
1683
|
-
| `uvalib-filter` | `
|
|
1684
|
-
| `uvalib-
|
|
1685
|
-
| `uvalib-
|
|
1686
|
-
| `
|
|
1687
|
-
| `
|
|
1688
|
-
| `bento-box` | `
|
|
1937
|
+
| Component | Action | Name | Value |
|
|
1938
|
+
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
1939
|
+
| `site-header` | `link-click` (a utility or site link) | the link's label | |
|
|
1940
|
+
| `site-header` | `menu-open` (the phone Menu popover) | | |
|
|
1941
|
+
| `site-header` | `skip-link`, `logo-click` | | |
|
|
1942
|
+
| `site-header` | `color-scheme` | `light`, `dark` or `system` | |
|
|
1943
|
+
| `site-main-nav` | `menu-open` (a group opens, not closes) | the group's label | |
|
|
1944
|
+
| `site-main-nav` | `link-click` | `Group > Link` (a top-level link: its label) | |
|
|
1945
|
+
| `site-footer` | `link-click` (not the pre-footer's) | `Column: Link`, e.g. `About: Staff directory`; `Contact us: Phone`, `Contact us: Email`; `Social: Facebook`, `Social: Instagram` | |
|
|
1946
|
+
| `uvalib-breadcrumbs` | `link-click` | `level N` (never the label) | N, from 1 |
|
|
1947
|
+
| `uvalib-card` | `card-click` | `single`, or the card's place in its grid (`1`, `2`, …); never the title or URL | that place, from 1, in a grid |
|
|
1948
|
+
| `uvalib-pager` | `page-change` | `next`, `previous` or `number` (never the label or URL) | the page, for `number` only |
|
|
1949
|
+
| `uvalib-pager` | `load-more` | (empty) | the next page |
|
|
1950
|
+
| `uvalib-tabs` | `change` | the tab's label (capped at 100 characters; not a URL) | |
|
|
1951
|
+
| `uvalib-contents` | `link-click` | `level N` (never the label or URL) | N, from 1 (the top level) |
|
|
1952
|
+
| `uvalib-contents` | `toggle` (the narrow-screen disclosure) | `open` or `close` | |
|
|
1953
|
+
| `uvalib-metadata` | `copy-citation` (downloads are left to Matomo's, or to `downloads="event"`) | | |
|
|
1954
|
+
| `uvalib-metadata` | `show-all`, `show-fewer` (a long list's toggle) | `row N` (the row's place in the list; never its label or values) | |
|
|
1955
|
+
| `uvalib-citation` | `format` (once the visitor settles on one), `copy`, `download` (the RIS link) | the format's name (`MLA`, `APA`…), or `ris` for `download`; never the citation | |
|
|
1956
|
+
| `uvalib-lightbox` | `open`, `next`, `previous`, `full-size` | `image N` (never the URL or the caption) | N, from 1 |
|
|
1957
|
+
| `uvalib-lightbox` (versions) | `compare` | `switch`, `wipe` or `fade` (never a version's label or URL) | the version's place, from 1 |
|
|
1958
|
+
| `uvalib-image-regions` | `select` (an outline clicked; nothing on hover or focus) | the list's `label` (never a region's label) | the region's number, from 1 |
|
|
1959
|
+
| `uvalib-tag-list` | `tag-click` | `list N` (the list's place on the page), or with `track-label` the list's own fixed `label`; never the tag's text or URL | the tag's place, from 1 |
|
|
1960
|
+
| `uvalib-tag-list` | `show-all`, `show-fewer` | `list N`, or with `track-label` the `label` | |
|
|
1961
|
+
| `site-alerts` | a content impression, once per alert per page view: `trackContentImpression('Library alert', '<severity>: <title>')` | | |
|
|
1962
|
+
| `site-alerts` | `dismiss`, `link-click` (a link in an alert's text) | `<severity>: <title>` | |
|
|
1963
|
+
| `site-alerts` | `error` (the alerts script failed to load) | `alerts-script` | |
|
|
1964
|
+
| `events-section` | `event-click` | the `category` id, or `all` | the event's position, from 1 |
|
|
1965
|
+
| `events-section` | `error` | `events-load` | |
|
|
1966
|
+
| `site-hours-section` | `link-click` | `See all hours` | |
|
|
1967
|
+
| `site-hours-section`, `library-weekly-hours` | `error` | `hours-load` | |
|
|
1968
|
+
| `library-weekly-hours` | `week-change` | `next` or `previous` | |
|
|
1969
|
+
| `uvalib-chip-group` | `change` (single: 1 s after the last change, and only if it differs from where it started; multi: each toggle) | `<group label>: <chip label>` | the chip's count, when it has one |
|
|
1970
|
+
| `uvalib-chip-group` | `select` (links mode) | the group's label (never the chip or its URL) | |
|
|
1971
|
+
| `uvalib-combobox` | `select` (a suggestion chosen) | the field's label (never the typed text or the suggestion) | the suggestion's position, from 1 |
|
|
1972
|
+
| `uvalib-combobox` | `clear` (the clear button, or Escape on a closed list) | the field's label | |
|
|
1973
|
+
| `uvalib-combobox` | `error` (`src` failed to load) | `load` | |
|
|
1974
|
+
| `uvalib-filter-drawer` | `open`, `close` (by the visitor: the button, Close, Escape or the backdrop; not a resize or a script) | the drawer's `label` | |
|
|
1975
|
+
| `uvalib-back-to-top` | `click` | | |
|
|
1976
|
+
| `uvalib-dialog` | `open` (a visitor's button), `close` (by the visitor: Close, a close button, Escape, the backdrop or a dialog form; not a script) | the dialog's `label` (never its content) |
|
|
1977
|
+
| `uvalib-map` | `select` (a marker chosen: click, Enter or Space) | the map's label (never the place's name, coordinates or URL) | the place's position, from 1 |
|
|
1978
|
+
| `uvalib-map` | `zoom` (1 s after the last zoom-button press) | the map's label | the zoom level |
|
|
1979
|
+
| `uvalib-map` | `expand` (a group of places chosen: it zooms in or opens its ring) | the map's label | the number of places in the group |
|
|
1980
|
+
| `uvalib-filter` | `facet-change` | `<filter title>: <value>` (the facet value as the search service returns it, such as a format, library or subject; cut at 100 characters) | 1 checked, 0 unchecked |
|
|
1981
|
+
| `uvalib-filter` | `scope-change` | the scope's label | 1 pressed, 0 not |
|
|
1982
|
+
| `uvalib-filter` | `see-more`, `see-less` | the filter's title | |
|
|
1983
|
+
| `uvalib-date-range` | `range-change` (1 s after the last change, and only if the years differ) | `<from year>–<to year>` | |
|
|
1984
|
+
| `uvalib-date-histogram` | `select` (not when the selection is cleared, set in script, or restored from a date range) | `<from>–<to>` when both ends are ISO dates, otherwise `other` | |
|
|
1985
|
+
| `bento-box` | `result-click` | the section (`Virgo catalog`, `Virgo articles`, `Subject guides`, `Library website`) | the result's position, from 1 |
|
|
1986
|
+
| `bento-box` | `see-all-click`, `retry` | the section | |
|
|
1987
|
+
| `bento-box` | `error` | `section-load: <section>` | |
|
|
1689
1988
|
|
|
1690
1989
|
`<bento-box>` also sends a Matomo site search per section once its results are in (not on an error, not again on a re-render): the query, the section as category, and the section's total (0 when nothing was found). A new query, also by Back or Forward, is a new search. The `<library-weekly-hours>` elements `<library-hours-setup>` creates report as `library-weekly-hours`. Alert severities are `Critical`, `Warning`, `Information`, `Header` or `Regional warning` / `Regional information`. Names are capped at 100 characters. `<uvalib-photo-grid>` and `<uvalib-results-count>` report nothing.
|
|
1691
1990
|
|
|
@@ -2474,6 +2773,49 @@ A row of chips: a segmented control or single-select filter (`mode="single"`), f
|
|
|
2474
2773
|
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
2475
2774
|
| `--uva-color-surface` | | Dark-mode role token: the page background the scrolling row fades into at an edge with more chips (else #fff). |
|
|
2476
2775
|
|
|
2776
|
+
### `<uvalib-citation>`
|
|
2777
|
+
|
|
2778
|
+
One record's citation in several formats (MLA, APA, Chicago, Bluebook…), a radio group to choose one, and a Copy citation button, as in Virgo's Cite dialog. Inline on a record page or inside a dialog: it assumes nothing about where it sits. Give each format as a child, `<blockquote data-format="MLA">…</blockquote>` (any element with `data-format`), so the page reads the same before the script loads (with `base.css`, only the first shows then, and the chooser's and button's space is held). Inline markup in a citation (`<i>` or `<em>` for a title) is kept; other elements are reduced to their text and nothing is parsed as HTML. Apps set the `citations` property instead (`[{ format, text, html? }]`, winning over the children while set); `html` keeps only inline elements, too. The formats are native radios drawn as one segmented bar (`role="radiogroup"`, "Citation format"): one tab stop, the arrow keys move and select, and the selected one is filled and ticked. `format` names the selected one (default the first). With `remember`, the visitor's last choice is kept in localStorage (per site) and wins over `format` on their next record. The selected citation is shown as selectable text in a region named "<format> citation". Copy citation copies it as plain text and as HTML where the browser allows (so an italic title stays italic when pasted into a word processor) and says "MLA citation copied" in a polite status next to the button, in the text colour (AAA), not in a toast. If the clipboard is unavailable, the citation is selected and the status says to copy it with the keyboard. `ris-href` adds a "Download RIS" link (`ris-label`) with a `download` attribute. Other export links go in the `actions` slot (`<a slot="actions" href="…" download>EndNote</a>`), after it.
|
|
2779
|
+
|
|
2780
|
+
#### Attributes
|
|
2781
|
+
|
|
2782
|
+
| Attribute | Type | Default | Description |
|
|
2783
|
+
|---|---|---|---|
|
|
2784
|
+
| `label` | `string` | `'Cite this item'` | The group's visible label and accessible name. |
|
|
2785
|
+
| `hide-label` | `boolean` | `false` | Hide the label visually (it still names the group), for a dialog whose heading says it. |
|
|
2786
|
+
| `format` | `string` | `''` | The selected format's name (default the first). Reflected when the visitor chooses one. |
|
|
2787
|
+
| `remember` | `boolean` | `false` | Keep the visitor's last format in localStorage (per site), winning over `format`. |
|
|
2788
|
+
| `ris-href` | `string` | `''` | A RIS file for the record: adds a download link. |
|
|
2789
|
+
| `ris-label` | `string` | `'Download RIS'` | The RIS link's text. |
|
|
2790
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
2791
|
+
| `no-style` | `boolean` | `false` | |
|
|
2792
|
+
|
|
2793
|
+
#### Slots
|
|
2794
|
+
|
|
2795
|
+
| Slot | Description |
|
|
2796
|
+
|---|---|
|
|
2797
|
+
| `actions` | More export links or buttons, after Copy citation and Download RIS. |
|
|
2798
|
+
|
|
2799
|
+
#### Events
|
|
2800
|
+
|
|
2801
|
+
| Event | Description |
|
|
2802
|
+
|---|---|
|
|
2803
|
+
| `uvalib-citation-format` | The visitor chose another format: `detail` is `{ format }`. Not fired when the app sets `format`. Bubbles and is composed. |
|
|
2804
|
+
| `uvalib-analytics-event` | For `<site-analytics>`, on the visitor's actions only: `['uvalib-citation', 'format', '<format>']` (once the visitor settles on one, a second after the last change), `['uvalib-citation', 'copy', '<format>']` and `['uvalib-citation', 'download', 'ris']`. Never the citation. Bubbles and is composed. |
|
|
2805
|
+
|
|
2806
|
+
#### CSS custom properties
|
|
2807
|
+
|
|
2808
|
+
| Property | Default | Description |
|
|
2809
|
+
|---|---|---|
|
|
2810
|
+
| `--uva-color-text` | | Dark-mode role token: label, citation and status colour (else `--uva-grey-darkest`). |
|
|
2811
|
+
| `--uva-color-border` | | Dark-mode role token: the citation's border (else #dadada). |
|
|
2812
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: the citation's, segments' and buttons' background (else #fff). |
|
|
2813
|
+
| `--uva-color-control-border` | | Dark-mode role token: segment border (else `--uva-grey`, #808080). |
|
|
2814
|
+
| `--uva-color-link` | | Dark-mode role token: segment and button text, button border (else `--uva-brand-blue`). |
|
|
2815
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: the selected segment (else `--uva-brand-blue`). |
|
|
2816
|
+
| `--uva-color-on-accent` | | Dark-mode role token: the selected segment's text (else #fff). |
|
|
2817
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
2818
|
+
|
|
2477
2819
|
### `<uvalib-combobox>`
|
|
2478
2820
|
|
|
2479
2821
|
An editable text field that suggests values as you type, from a local list or a URL: a person, place or subject picker. It follows the WAI-ARIA APG “Editable Combobox With List Autocomplete”: a real `<input role="combobox">` and a `role="listbox"` popup under it. Suggestions come from the `items` property (`{ value, label?, description?, disabled? }` objects, or strings), from `<option>` children (directly or inside a `<datalist>`; the `label` attribute or text is the label, `data-description` the second line), or from `src`, a URL template with `{q}` (fetched 250 ms after the last keystroke once the text has `min-length` characters, default 1; a newer keystroke aborts the older request; the response is a JSON array of the same shape, or anything `transform(data, query)` turns into one). `items` wins over the children while set. Local suggestions match anywhere in the label, ignoring case and accents, those starting with the text first, then those with a word starting with it; at most `max-results` (default 50, 0 for all) are shown, which keeps a list of 16,000 people fast. The matched text is bold and underlined in a `<mark>`. Keys: Down opens the list on the first suggestion and moves (wrapping), Up opens on the last, Alt+Down opens without moving, Alt+Up closes, Enter chooses the active suggestion (and then does not submit the form; with none active, Enter submits as in any field), Escape closes the list and a second Escape clears the field, Home, End, Left and Right move the caret, and Tab leaves without choosing. A real clear button (“Clear <label>”, 44px, shown only with text) empties the field and returns focus to it. Free text is allowed: `value` is whatever is in the field, and `selected` the chosen suggestion (or null); typing after choosing clears it, and leaving the field with text that is exactly one suggestion's label chooses it. `must-choose` makes any other text invalid (“Choose one of the suggestions.”). The element is form-associated: with `name` it submits the chosen suggestion's value, or else the text, and a form reset restores the `value` attribute. `required` and `disabled` (also from a disabled fieldset) work as on an input. A polite status says “5 suggestions”, “50 of 1,234 suggestions”, “No suggestions”, “Loading suggestions” or “Couldn't load suggestions” half a second after the list settles (never on the first render); the popup shows the same notes visibly. A failed load never throws. Where the browser supports the Popover API and CSS anchor positioning, the popup is a manual popover in the top layer, anchored under the field and as wide as it (above it when there is no room below), so an ancestor with `overflow: hidden` or a scrolling panel never clips it. Elsewhere it is positioned under the field inside the element, as before. Pages can style the runtime state with `:state(open)`, `:state(invalid)` and `:state(loading)` (no attributes are added). Before it upgrades, `base.css` shows the label (from the attribute) and holds the field's height. A fallback `<input list>` child works as a plain field meanwhile; on upgrade its text, `name` and `placeholder` carry over, and it is disabled so it does not submit twice.
|
|
@@ -2683,9 +3025,73 @@ A date-range picker: a two-thumb year slider plus "From" and "To" date inputs. `
|
|
|
2683
3025
|
| `--uva-color-control-border` | | Dark-mode role token: date input border (else `--uva-grey`, #808080). |
|
|
2684
3026
|
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
2685
3027
|
|
|
3028
|
+
### `<uvalib-dialog>`
|
|
3029
|
+
|
|
3030
|
+
A modal dialog for content and short forms: search tips, Cite, a sign-in prompt, a request form. Use it instead of a hand-built modal, a `role="dialog"` div or a framework's dialog. The children are the content. In shadow DOM they are slotted, never moved, so the page's CSS, ids, listeners and framework-rendered nodes keep working; with `no-shadow-dom` they are moved into the dialog (the same nodes, in the same document). It opens as a native `<dialog>` with `showModal()`: everything else on the page, `<site-page>`'s shadow header included, is inert while it is open, so focus stays inside without a trap script. The visible heading (`label`, an `<h2>` unless `heading-level` says otherwise) names it, and a 44px Close button is always shown; `description` (or a `slot="description"` child) is shown under the heading and is the dialog's description. Open it with a button anywhere in the page, `<button type="button" data-uvalib-dialog="<id>">` (one delegated listener, so buttons rendered later work too), with an invoker button (`commandfor="<id>" command="--show-modal"`) where the browser has invoker commands, with `show()`, or by setting `open`. On open, focus goes to the content's `[autofocus]` element when it has one (a form dialog: the first field), else to the heading, so a screen reader reads the dialog from the top and long content starts in view. On every close (Close, Escape, the backdrop, a `data-uvalib-dialog-close` button, a `<form method="dialog">` submitted, `close()`) focus returns to the element that opened it; if that is gone, to `return-focus` (a selector, or an element set as the property). Escape always closes it. A click on the backdrop closes it too (the native `closedby="any"`, or the same check in script where the browser lacks it), except with `persistent`, and never when a press starts inside the dialog and ends on the backdrop (a text selection or a drag). A `<form method="dialog">` in the content closes it on submit with the submitter's `value` as `returnValue`; other forms submit as usual. `size` is `small` (30rem), `medium` (the default, 40rem) or `large` (60rem) at most, and never wider or taller than the viewport less 16px on each side; the content scrolls inside it under a header that stays in view.
|
|
3031
|
+
|
|
3032
|
+
#### Attributes
|
|
3033
|
+
|
|
3034
|
+
| Attribute | Type | Default | Description |
|
|
3035
|
+
|---|---|---|---|
|
|
3036
|
+
| `label` | `string` | `''` | The visible heading and the dialog's accessible name. |
|
|
3037
|
+
| `heading-level` | `number` | `2` | The heading's level, 1 to 6 (default 2). |
|
|
3038
|
+
| `description` | `string` | `''` | A short description under the heading (or a `slot="description"` child), read as the dialog's description. |
|
|
3039
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | The widest the dialog gets: `small` (30rem), `medium` (40rem) or `large` (60rem). |
|
|
3040
|
+
| `open` | `boolean` | `false` | Whether it is open. Reflected; setting it opens or closes the dialog (as `show()` and `close()`). |
|
|
3041
|
+
| `persistent` | `boolean` | `false` | A click on the backdrop does not close it (Escape and Close still do). For forms that would lose typed text. |
|
|
3042
|
+
| `return-focus` | `string \| HTMLElement \| null` | `null` | Where focus goes on close when the opener is gone: a selector (in the dialog's root, then the document) or an element. |
|
|
3043
|
+
| `close-label` | `string` | `'Close'` | The Close button's text. |
|
|
3044
|
+
| `no-shadow-dom` | `boolean` | `false` | |
|
|
3045
|
+
| `no-style` | `boolean` | `false` | |
|
|
3046
|
+
|
|
3047
|
+
#### Slots
|
|
3048
|
+
|
|
3049
|
+
| Slot | Description |
|
|
3050
|
+
|---|---|
|
|
3051
|
+
| (default) | The content: text, links, a form. |
|
|
3052
|
+
| `description` | A short description under the heading, read as the dialog's description (instead of the `description` attribute). |
|
|
3053
|
+
|
|
3054
|
+
#### CSS parts
|
|
3055
|
+
|
|
3056
|
+
| Part | Description |
|
|
3057
|
+
|---|---|
|
|
3058
|
+
| `dialog` | The `<dialog>`. |
|
|
3059
|
+
| `header` | The heading row (the heading and Close). |
|
|
3060
|
+
| `heading` | The heading. |
|
|
3061
|
+
| `close` | The Close button. |
|
|
3062
|
+
| `description` | The description under the heading. |
|
|
3063
|
+
| `body` | The scrolling wrapper of the content. |
|
|
3064
|
+
|
|
3065
|
+
#### CSS states
|
|
3066
|
+
|
|
3067
|
+
| State | Description |
|
|
3068
|
+
|---|---|
|
|
3069
|
+
| `:state(open)` | The dialog is open. |
|
|
3070
|
+
|
|
3071
|
+
#### Events
|
|
3072
|
+
|
|
3073
|
+
| Event | Description |
|
|
3074
|
+
|---|---|
|
|
3075
|
+
| `uvalib-dialog-open` | The dialog opened: `detail` is `{ reason }`, `button` (a visitor's opener) or `api` (`show()` or `open`). Bubbles and is composed. |
|
|
3076
|
+
| `uvalib-dialog-close` | The dialog closed: `detail` is `{ reason, returnValue }`, `reason` one of `close-button`, `button` (a `data-uvalib-dialog-close` or invoker close button), `escape`, `backdrop`, `form` (a `<form method="dialog">`), `api` (`close()` or `open = false`) or `removed` (taken out of the page while open). Bubbles and is composed. |
|
|
3077
|
+
| `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-dialog', 'open', '<label>']` when a visitor's button opens it, and `['uvalib-dialog', 'close', '<label>']` when the visitor closes it (Close, a close button, Escape, the backdrop or a dialog form); never on `show()`, `close()` or `open` from script, and never the content. Bubbles and is composed. |
|
|
3078
|
+
|
|
3079
|
+
#### CSS custom properties
|
|
3080
|
+
|
|
3081
|
+
| Property | Default | Description |
|
|
3082
|
+
|---|---|---|
|
|
3083
|
+
| `--uvalib-dialog-width` | | The dialog's widest inline size, instead of `size`'s (still never wider than the viewport less 16px on each side). |
|
|
3084
|
+
| `--uva-color-surface` | | Dark-mode role token: dialog background (else #fff). |
|
|
3085
|
+
| `--uva-color-text` | | Dark-mode role token: dialog text (else `--uva-grey-darkest`, #2b2b2b). |
|
|
3086
|
+
| `--uva-color-text-muted` | | Dark-mode role token: the description (else #4b5563, 7.5:1 on white). |
|
|
3087
|
+
| `--uva-color-border` | | Dark-mode role token: dialog edge and heading rule (else #dadada). |
|
|
3088
|
+
| `--uva-color-button-bg` | | Dark-mode role token: Close's border and text (else `--uva-blue-alt`, #007bac). |
|
|
3089
|
+
| `--uva-color-button-hover-bg` | | Dark-mode role token: hovered Close (else `--uva-blue-alt-A`, #005679). |
|
|
3090
|
+
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
3091
|
+
|
|
2686
3092
|
### `<uvalib-filter>`
|
|
2687
3093
|
|
|
2688
|
-
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.
|
|
3094
|
+
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. Optional filter-group features, each off by default (without them the markup, events and order are as before): `collapsible` (a caret disclosure button in the legend, with the selected count while collapsed), `searchable` (search within the values), `sortable` (Count \| Name (A–Z)), `clearable` (a Clear button), `apply-button` (stage changes until Apply) and `match` (says how the values combine).
|
|
2689
3095
|
|
|
2690
3096
|
#### Attributes
|
|
2691
3097
|
|
|
@@ -2697,6 +3103,17 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
|
|
|
2697
3103
|
| `scopevalue` | `string[]` | `[]` | Pressed scope values (matched case-insensitively). |
|
|
2698
3104
|
| `scopes-label` | `string` | `''` | Accessible name of the scope chip group. Empty (the default) means `Filter <title> by type`. |
|
|
2699
3105
|
| `limit` | `number` | `0` | Maximum buckets to show at first; 0 shows all. "See more" doubles it, "See less" halves it back. |
|
|
3106
|
+
| `collapsible` | `boolean` | `false` | The legend becomes a disclosure button (with the library's caret) that shows and hides the group. |
|
|
3107
|
+
| `collapsed` | `boolean` | `false` | With `collapsible`: the group is closed (its legend button and selected count only). The visitor's toggle updates it; nothing is remembered. |
|
|
3108
|
+
| `heading-level` | `number` | `0` | Wrap the legend's text (or disclosure button) in a heading of this level, 2 to 6. Unset (the default): no heading, as before. |
|
|
3109
|
+
| `searchable` | `boolean` | `false` | A search field above the values that narrows them as the visitor types. |
|
|
3110
|
+
| `search-label` | `string` | `''` | The search field's visible label. Empty (the default) means `Search <title>`. |
|
|
3111
|
+
| `unit` | `string` | `'values'` | What the values are, plural, for the search status ("12 of 340 subjects"). |
|
|
3112
|
+
| `sortable` | `boolean` | `false` | A "Sort by: Count \| Name (A–Z)" control. |
|
|
3113
|
+
| `sort` | `'count' \| 'name'` | `'count'` | The order: `count` (most results first; without `sortable`, the data's own order) or `name` (A–Z). The visitor's choice updates it. |
|
|
3114
|
+
| `clearable` | `boolean` | `false` | A Clear button, shown while something in the group is selected. |
|
|
3115
|
+
| `apply-button` | `boolean` | `false` | Stage checkbox changes until the visitor presses Apply (with Reset back to the applied state); `filter-change` fires on Apply only. |
|
|
3116
|
+
| `match` | `'any' \| 'all' \| undefined` | | Say how the selected values combine, under the legend: `any` ("Matches any selected value") or `all`. Unset: no text. |
|
|
2700
3117
|
| `no-shadow-dom` | `boolean` | `false` | |
|
|
2701
3118
|
| `no-style` | `boolean` | `false` | |
|
|
2702
3119
|
|
|
@@ -2706,14 +3123,21 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
|
|
|
2706
3123
|
|---|---|
|
|
2707
3124
|
| `see-more` | The "See more" button (shadow mode). |
|
|
2708
3125
|
| `see-less` | The "See less" button (shadow mode). |
|
|
3126
|
+
| `toggle` | The disclosure button in the legend (`collapsible`). |
|
|
3127
|
+
| `search` | The search-within field (`searchable`). |
|
|
3128
|
+
| `clear` | The Clear button (`clearable`). |
|
|
3129
|
+
| `apply` | The Apply button (`apply-button`). |
|
|
3130
|
+
| `reset` | The Reset button (`apply-button`). |
|
|
2709
3131
|
|
|
2710
3132
|
#### Events
|
|
2711
3133
|
|
|
2712
3134
|
| Event | Description |
|
|
2713
3135
|
|---|---|
|
|
2714
|
-
| `filter-change` | A checkbox was toggled. `detail` is `{ name, value }`: the facet name and the new array of selected keys. Does not bubble. |
|
|
3136
|
+
| `filter-change` | A checkbox was toggled, Clear was pressed, or (with `apply-button`) Apply was pressed. `detail` is `{ name, value }`: the facet name and the new array of selected keys (`[]` after Clear). Does not bubble. |
|
|
2715
3137
|
| `scope-change` | A scope chip was toggled. `detail` is `{ value }`: the new array of pressed scope values. Does not bubble. |
|
|
2716
|
-
| `
|
|
3138
|
+
| `toggle` | With `collapsible`: the visitor opened or closed the group. `detail` is `{ open }`. Does not bubble. |
|
|
3139
|
+
| `sort` | With `sortable`: the visitor chose a sort. `detail` is `{ sort }` (`count` or `name`). Does not bubble. |
|
|
3140
|
+
| `uvalib-analytics-event` | For `<site-analytics>`, on the visitor's changes only: `['uvalib-filter', 'facet-change', '<title>: <value>', 1 \| 0]` (checked or unchecked; with `apply-button`, one per value when Apply is pressed), `['uvalib-filter', 'scope-change', <scope label>, 1 \| 0]` (pressed or not), `['uvalib-filter', 'see-more' \| 'see-less', <title>]`, `['uvalib-filter', 'toggle', <title>, 1 \| 0]` (opened or closed), `['uvalib-filter', 'sort', '<title>: count' \| '<title>: name']`, `['uvalib-filter', 'clear', <title>, <number cleared>]`, `['uvalib-filter', 'apply', <title>, <number of changes>]` and `['uvalib-filter', 'search', <title>, <number of matches>]` once a search-within settles (never the typed text). Bubbles and is composed. |
|
|
2717
3141
|
|
|
2718
3142
|
#### CSS custom properties
|
|
2719
3143
|
|
|
@@ -2722,11 +3146,13 @@ A faceted-search filter: a fieldset of checkboxes (value plus result count), opt
|
|
|
2722
3146
|
| `--uva-brand-blue` | `#232d4b` | Scope chip text, hover border and pressed background. |
|
|
2723
3147
|
| `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
|
|
2724
3148
|
| `--uva-color-border` | | Dark-mode role token: divider under the scope chips (else #e5e7eb). |
|
|
2725
|
-
| `--uva-color-control-border` | | Dark-mode role token: scope chip
|
|
2726
|
-
| `--uva-color-surface-raised` | | Dark-mode role token: scope chip background (else #fff). |
|
|
2727
|
-
| `--uva-color-link` | | Dark-mode role token: scope chip text
|
|
2728
|
-
| `--uva-color-accent-bg` | | Dark-mode role token: pressed chip
|
|
2729
|
-
| `--uva-color-on-accent` | | Dark-mode role token: pressed chip text (else #fff). |
|
|
3149
|
+
| `--uva-color-control-border` | | Dark-mode role token: scope chip, search field, sort and button borders (else `--uva-grey`, #808080). |
|
|
3150
|
+
| `--uva-color-surface-raised` | | Dark-mode role token: scope chip, search field, sort and button background (else #fff). |
|
|
3151
|
+
| `--uva-color-link` | | Dark-mode role token: scope chip and button text, the caret, hover border (else `--uva-brand-blue`). |
|
|
3152
|
+
| `--uva-color-accent-bg` | | Dark-mode role token: pressed chip, current sort and Apply background (else `--uva-brand-blue`). |
|
|
3153
|
+
| `--uva-color-on-accent` | | Dark-mode role token: pressed chip, current sort and Apply text (else #fff). |
|
|
3154
|
+
| `--uva-color-text-muted` | | Dark-mode role token: the match text, selected count, search status and staged note (else #4f4f4f). |
|
|
3155
|
+
| `--uva-color-input-text` | | Dark-mode role token: search field text (else #1f2937). |
|
|
2730
3156
|
| `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
|
|
2731
3157
|
|
|
2732
3158
|
### `<uvalib-filter-drawer>`
|