@uvalib/web-components 1.8.4 → 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.
Files changed (85) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +486 -60
  3. package/dist/base/clipboard.d.ts +9 -0
  4. package/dist/base/clipboard.js +30 -0
  5. package/dist/base/clipboard.js.map +1 -0
  6. package/dist/base.css +188 -3
  7. package/dist/components/site-page/SitePage.js +2 -1
  8. package/dist/components/site-page/SitePage.js.map +1 -1
  9. package/dist/components/site-style/SiteStyle.js +2 -1
  10. package/dist/components/site-style/SiteStyle.js.map +1 -1
  11. package/dist/components/uvalib-citation/UvalibCitation.d.ts +124 -0
  12. package/dist/components/uvalib-citation/UvalibCitation.js +545 -0
  13. package/dist/components/uvalib-citation/UvalibCitation.js.map +1 -0
  14. package/dist/components/uvalib-citation/uvalib-citation.d.ts +1 -0
  15. package/dist/components/uvalib-citation/uvalib-citation.js +4 -0
  16. package/dist/components/uvalib-citation/uvalib-citation.js.map +1 -0
  17. package/dist/components/uvalib-dialog/UvalibDialog.d.ts +167 -0
  18. package/dist/components/uvalib-dialog/UvalibDialog.js +688 -0
  19. package/dist/components/uvalib-dialog/UvalibDialog.js.map +1 -0
  20. package/dist/components/uvalib-dialog/uvalib-dialog.d.ts +1 -0
  21. package/dist/components/uvalib-dialog/uvalib-dialog.js +4 -0
  22. package/dist/components/uvalib-dialog/uvalib-dialog.js.map +1 -0
  23. package/dist/components/uvalib-filter/UvalibFilter.d.ts +92 -9
  24. package/dist/components/uvalib-filter/UvalibFilter.js +748 -60
  25. package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -1
  26. package/dist/components/uvalib-metadata/UvalibMetadata.js +3 -4
  27. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  28. package/dist/custom-elements.json +5881 -3592
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/styles/base.js +41 -1
  33. package/dist/styles/base.js.map +1 -1
  34. package/dist/styles/color-scheme.js +4 -0
  35. package/dist/styles/color-scheme.js.map +1 -1
  36. package/dist/styles/controls.js +4 -0
  37. package/dist/styles/controls.js.map +1 -1
  38. package/dist/styles/field-text.d.ts +1 -0
  39. package/dist/styles/field-text.js +21 -0
  40. package/dist/styles/field-text.js.map +1 -0
  41. package/dist/styles/font-fallback.d.ts +7 -0
  42. package/dist/styles/font-fallback.js +15 -0
  43. package/dist/styles/font-fallback.js.map +1 -1
  44. package/dist/styles/hidden.js +13 -1
  45. package/dist/styles/hidden.js.map +1 -1
  46. package/dist/styles/table.d.ts +1 -0
  47. package/dist/styles/table.js +164 -0
  48. package/dist/styles/table.js.map +1 -0
  49. package/dist/tokens.css +4 -0
  50. package/dist-cdn/base.css +188 -3
  51. package/dist-cdn/chunks/{base-DfLI8lpa.js → base-CHMHBPeI.js} +58 -7
  52. package/dist-cdn/chunks/base-CHMHBPeI.js.map +1 -0
  53. package/dist-cdn/chunks/clipboard-CNG7Y_5X.js +18 -0
  54. package/dist-cdn/chunks/clipboard-CNG7Y_5X.js.map +1 -0
  55. package/dist-cdn/chunks/if-defined-COiQb-gl.js +6 -0
  56. package/dist-cdn/chunks/if-defined-COiQb-gl.js.map +1 -0
  57. package/dist-cdn/chunks/{site-header-CEmNtmk5.js → site-header-B78a_ldi.js} +27 -22
  58. package/dist-cdn/chunks/site-header-B78a_ldi.js.map +1 -0
  59. package/dist-cdn/chunks/{site-main-nav-CAwKq_x5.js → site-main-nav-CmMq2t8t.js} +52 -51
  60. package/dist-cdn/chunks/site-main-nav-CmMq2t8t.js.map +1 -0
  61. package/dist-cdn/custom-elements.json +5881 -3592
  62. package/dist-cdn/manifest.json +4 -2
  63. package/dist-cdn/site-header.js +1 -1
  64. package/dist-cdn/site-main-nav.js +1 -1
  65. package/dist-cdn/site-page.js +48 -48
  66. package/dist-cdn/site-page.js.map +1 -1
  67. package/dist-cdn/site-style.js +7 -7
  68. package/dist-cdn/site-style.js.map +1 -1
  69. package/dist-cdn/skills/uvalib-web-components/SKILL.md +8 -5
  70. package/dist-cdn/skills/uvalib-web-components/reference/components.md +135 -8
  71. package/dist-cdn/tokens.css +4 -0
  72. package/dist-cdn/uvalib-citation.js +382 -0
  73. package/dist-cdn/uvalib-citation.js.map +1 -0
  74. package/dist-cdn/uvalib-dialog.js +419 -0
  75. package/dist-cdn/uvalib-dialog.js.map +1 -0
  76. package/dist-cdn/uvalib-filter.js +603 -69
  77. package/dist-cdn/uvalib-filter.js.map +1 -1
  78. package/dist-cdn/uvalib-metadata.js +49 -49
  79. package/dist-cdn/uvalib-metadata.js.map +1 -1
  80. package/package.json +9 -1
  81. package/skills/uvalib-web-components/SKILL.md +8 -5
  82. package/skills/uvalib-web-components/reference/components.md +135 -8
  83. package/dist-cdn/chunks/base-DfLI8lpa.js.map +0 -1
  84. package/dist-cdn/chunks/site-header-CEmNtmk5.js.map +0 -1
  85. package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +0 -1
package/dist-cdn/base.css CHANGED
@@ -130,7 +130,8 @@
130
130
  uvalib-combobox,
131
131
  uvalib-image-regions,
132
132
  uvalib-map,
133
- uvalib-filter-drawer
133
+ uvalib-filter-drawer,
134
+ uvalib-filter
134
135
  ):not(:defined)[hidden],
135
136
  :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {
136
137
  display: none;
@@ -309,6 +310,13 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
309
310
  line-height: 1.5;
310
311
  color: var(--uva-color-text-muted, #4b5563);
311
312
  }
313
+ /* A collapsed filter group (<uvalib-filter collapsible collapsed>) draws only its 44px
314
+ legend button once it upgrades: hold that height. Low specificity, so the [hidden] rule
315
+ above still wins. */
316
+ :where(uvalib-filter[collapsible][collapsed]):not(:defined) {
317
+ display: block;
318
+ min-block-size: 44px;
319
+ }
312
320
  /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px
313
321
  "Search and filters" button shows, so hold that height and keep the form and filters out
314
322
  of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the
@@ -323,6 +331,38 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
323
331
  display: none;
324
332
  }
325
333
  }
334
+ /* A dialog before <uvalib-dialog> upgrades: its children are the dialog's content, never
335
+ shown in the page, so nothing flashes or moves. Once defined, a closed dialog renders
336
+ nothing (its host is display: contents around a closed <dialog>). */
337
+ uvalib-dialog:not(:defined) {
338
+ display: none;
339
+ }
340
+ /* A citation before <uvalib-citation> upgrades: only the first format's citation, boxed
341
+ as it will be, with the label and 44px format bar held above it (none for hide-label)
342
+ and the 44px Copy citation row below, so nothing moves when it upgrades (an app's
343
+ citations property cannot be held). */
344
+ uvalib-citation:not(:defined) {
345
+ display: block;
346
+ font-size: 1rem;
347
+ line-height: 1.5;
348
+ }
349
+ uvalib-citation:not(:defined):has(> [data-format]) {
350
+ padding-block: calc(2rem + 44px + 0.75rem) calc(0.75rem + 44px);
351
+ }
352
+ uvalib-citation[hide-label]:not(:defined):has(> [data-format]) {
353
+ padding-block-start: calc(44px + 0.75rem);
354
+ }
355
+ uvalib-citation:not(:defined) > [data-format] {
356
+ margin: 0;
357
+ padding: 0.75rem 1rem;
358
+ border: 1px solid transparent;
359
+ overflow-wrap: anywhere;
360
+ text-wrap: pretty;
361
+ }
362
+ uvalib-citation:not(:defined) > [data-format] ~ [data-format],
363
+ uvalib-citation:not(:defined) > [slot] {
364
+ display: none;
365
+ }
326
366
  /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme
327
367
  prints light (the role tokens resolve to their light values), and the content's links
328
368
  are black and underlined, so they are told apart without colour. Content is <main> in
@@ -379,6 +419,8 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
379
419
  --uva-color-link: light-dark(var(--uva-brand-blue, #232d4b), #87b9d9);
380
420
  --uva-color-highlight: light-dark(var(--uva-brand-orange-200, #ffc999), #854200);
381
421
  --uva-color-on-highlight: light-dark(var(--uva-grey-darkest, #2b2b2b), #ffffff);
422
+ --uva-color-table-border: light-dark(var(--uva-grey-100, #dadada), #4f5a7a);
423
+ --uva-color-table-stripe: light-dark(var(--uva-grey-200, #f1f1f1), #1a2340);
382
424
  }
383
425
  :root[data-uva-color-scheme='system'] {
384
426
  color-scheme: light dark;
@@ -947,9 +989,152 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
947
989
  }
948
990
 
949
991
 
992
+ .uvalib-table {
993
+ inline-size: 100%;
994
+ margin-block: 0 1rem;
995
+ border-collapse: collapse;
996
+ border-spacing: 0;
997
+ color: inherit;
998
+ }
999
+ .uvalib-table > caption {
1000
+ caption-side: top;
1001
+ padding-block: 0 0.5rem;
1002
+ font-size: 1.125rem;
1003
+ font-weight: 700;
1004
+ line-height: 1.3;
1005
+ text-align: start;
1006
+ }
1007
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1008
+ padding: 0.5rem;
1009
+ border-block-end: 1px solid var(--uva-color-table-border, var(--uva-grey-100, #dadada));
1010
+ text-align: start;
1011
+ vertical-align: top;
1012
+ overflow-wrap: anywhere;
1013
+ }
1014
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
1015
+ padding-inline-start: 1rem;
1016
+ }
1017
+ .uvalib-table th {
1018
+ font-weight: 700;
1019
+ }
1020
+ .uvalib-table > thead > tr > :is(th, td) {
1021
+ border-block-end-width: 2px;
1022
+ vertical-align: bottom;
1023
+ }
1024
+ .uvalib-table--striped > tbody > tr:nth-child(even) {
1025
+ background-color: var(--uva-color-table-stripe, var(--uva-grey-200, #f1f1f1));
1026
+ }
1027
+ .uvalib-table.uvalib-table--compact > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1028
+ padding: 0.25rem 0.5rem;
1029
+ }
1030
+ .uvalib-table.uvalib-table--compact > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
1031
+ padding-inline-start: 0.5rem;
1032
+ }
1033
+ /* Numbers: right-aligned (end), with digits of equal width so columns line up. */
1034
+ .uvalib-table .uvalib-table__num {
1035
+ text-align: end;
1036
+ font-variant-numeric: tabular-nums;
1037
+ }
1038
+
1039
+ /* A wide table scrolls inside its wrapper (role="region", tabindex="0", aria-labelledby the
1040
+ caption's id), never the page. */
1041
+ .uvalib-table-scroll {
1042
+ display: block;
1043
+ max-inline-size: 100%;
1044
+ margin-block: 0 1rem;
1045
+ overflow-x: auto;
1046
+ overscroll-behavior-inline: contain;
1047
+ }
1048
+ .uvalib-table-scroll:focus-visible {
1049
+ outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));
1050
+ outline-offset: 2px;
1051
+ }
1052
+ .uvalib-table-scroll > .uvalib-table {
1053
+ margin-block-end: 0;
1054
+ }
1055
+ .uvalib-table-scroll > .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1056
+ overflow-wrap: break-word;
1057
+ }
1058
+
1059
+ /* Stacked rows on a narrow wrapper (opt-in; add explicit ARIA roles, see above). */
1060
+ .uvalib-table-stack {
1061
+ container: uvalib-table-stack / inline-size;
1062
+ margin-block: 0 1rem;
1063
+ }
1064
+ .uvalib-table-stack > .uvalib-table {
1065
+ margin-block-end: 0;
1066
+ }
1067
+ @container uvalib-table-stack (width <= 30em) {
1068
+ .uvalib-table-stack .uvalib-table--stack,
1069
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot),
1070
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr,
1071
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td),
1072
+ .uvalib-table-stack .uvalib-table--stack > caption {
1073
+ display: block;
1074
+ }
1075
+ /* The column headers stay for assistive technology; each cell shows its own label. */
1076
+ .uvalib-table-stack .uvalib-table--stack > thead {
1077
+ position: absolute;
1078
+ inline-size: 1px;
1079
+ block-size: 1px;
1080
+ overflow: hidden;
1081
+ clip-path: inset(50%);
1082
+ white-space: nowrap;
1083
+ }
1084
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1085
+ padding-block: 0.5rem;
1086
+ border-block-end: 1px solid var(--uva-color-table-border, var(--uva-grey-100, #dadada));
1087
+ }
1088
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td) {
1089
+ padding: 0.25rem 1rem;
1090
+ border: 0;
1091
+ text-align: start;
1092
+ }
1093
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > [data-label]::before {
1094
+ content: attr(data-label);
1095
+ /* The label repeats the column header, so it is not read twice. */
1096
+ content: attr(data-label) / '';
1097
+ display: block;
1098
+ font-weight: 700;
1099
+ }
1100
+ }
1101
+
1102
+ @media (forced-colors: active) {
1103
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td),
1104
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1105
+ border-color: CanvasText;
1106
+ }
1107
+ }
1108
+ @media print {
1109
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td),
1110
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1111
+ border-color: #000000;
1112
+ }
1113
+ .uvalib-table--striped > tbody > tr:nth-child(even) {
1114
+ background-color: transparent;
1115
+ }
1116
+ .uvalib-table-scroll {
1117
+ overflow: visible;
1118
+ }
1119
+ }
1120
+
1121
+
950
1122
  /* hidden hides every base.css class, though each sets display (see hidden.ts). */
951
- :where(.uvalib-button, .uvalib-input, .uvalib-search-form, .uvalib-badge, .uvalib-media, .uvalib-media__badges, .uvalib-toolbar, .uvalib-toolbar__field, .uvalib-toolbar__group, .uvalib-toolbar__summary, .uvalib-empty-state, .uvalib-skeleton, .uvalib-skeleton-text, .uvalib-message, .uvalib-message__icon, .uvalib-result-list, .uvalib-result, .uvalib-result__title, .uvalib-result__meta, .uvalib-result__snippet, .uvalib-result__actions)[hidden],
952
- :where(.uvalib-media > :is(img, video, picture))[hidden] {
1123
+ :where(.uvalib-button, .uvalib-input, .uvalib-search-form, .uvalib-badge, .uvalib-media, .uvalib-media__badges, .uvalib-toolbar, .uvalib-toolbar__field, .uvalib-toolbar__group, .uvalib-toolbar__summary, .uvalib-empty-state, .uvalib-skeleton, .uvalib-skeleton-text, .uvalib-message, .uvalib-message__icon, .uvalib-result-list, .uvalib-result, .uvalib-result__title, .uvalib-result__meta, .uvalib-result__snippet, .uvalib-result__actions, .uvalib-table, .uvalib-table-scroll, .uvalib-table-stack, .uvalib-help)[hidden],
1124
+ :where(.uvalib-media > :is(img, video, picture), .uvalib-table--stack > :is(tbody, tfoot, caption), .uvalib-table--stack > :is(tbody, tfoot) > tr, .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td))[hidden] {
953
1125
  display: none !important;
954
1126
  }
955
1127
 
1128
+
1129
+ .uvalib-help {
1130
+ display: block;
1131
+ margin-block: 0.25rem 0;
1132
+ color: var(--uva-color-text-muted, #4b5563);
1133
+ font-size: 0.9375rem;
1134
+ line-height: 1.4;
1135
+ }
1136
+ .uvalib-required {
1137
+ color: var(--uva-color-text-muted, #4b5563);
1138
+ font-weight: 400;
1139
+ }
1140
+
@@ -45,7 +45,18 @@ var n = e`
45
45
  descent-override: 26.4%;
46
46
  line-gap-override: 0%;
47
47
  }
48
- `, r = e`
48
+ `, r = [
49
+ "400",
50
+ "500",
51
+ "700",
52
+ "italic 400"
53
+ ];
54
+ function i(e) {
55
+ let t = e.fonts;
56
+ if (t?.load) for (let e of r) t.load(`${e} 1em "UVA Franklin Fallback"`).catch(() => {});
57
+ }
58
+ // src/styles/tokens.ts
59
+ var a = e`
49
60
  :root {
50
61
  --uva-brand-blue-lightest: #87B9D9;
51
62
  --uva-brand-blue-lighter: #3395D4;
@@ -126,10 +137,10 @@ var n = e`
126
137
  --uva-font-family: franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif;
127
138
  --uva-font-size-base: 17px;
128
139
  }
129
- `, i = Array.from({ length: 12 }, (e, t) => t + 1), a = t(i.map((e) => {
140
+ `, o = Array.from({ length: 12 }, (e, t) => t + 1), s = t(o.map((e) => {
130
141
  let t = [`uvalib-metadata[list-limit="${e}"]:not(:defined) > dl > dd:not([data-limit]) > :is(ul, ol):not([data-limit])`, `uvalib-metadata:not(:defined) > dl > dd[data-limit="${e}"] > :is(ul, ol)`];
131
142
  return `${t.map((t) => `${t} > li:nth-child(n + ${e + 1})`).join(",\n")} { display: none; }\n${t.map((t) => `${t}:has(> li:nth-child(${e + 1}))::after`).join(",\n")} { content: ''; display: block; block-size: 2.25rem; }`;
132
- }).join("\n")), o = "https://use.typekit.net/oym8nvz.css", s = e`
143
+ }).join("\n")), c = "https://use.typekit.net/oym8nvz.css", l = e`
133
144
  *,
134
145
  *::before,
135
146
  *::after {
@@ -215,7 +226,8 @@ var n = e`
215
226
  uvalib-combobox,
216
227
  uvalib-image-regions,
217
228
  uvalib-map,
218
- uvalib-filter-drawer
229
+ uvalib-filter-drawer,
230
+ uvalib-filter
219
231
  ):not(:defined)[hidden],
220
232
  :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {
221
233
  display: none;
@@ -275,7 +287,7 @@ var n = e`
275
287
  border-block-start: 0;
276
288
  }
277
289
  }
278
- ${a}
290
+ ${s}
279
291
  /* Tabs stay readable before the script runs: a block, one panel, and a gap the
280
292
  size of the tab row (44px) plus its 1rem margin, so the first panel does not
281
293
  jump when the element upgrades. Later data-tab panels stay hidden. */
@@ -347,6 +359,13 @@ var n = e`
347
359
  line-height: 1.5;
348
360
  color: var(--uva-color-text-muted, #4b5563);
349
361
  }
362
+ /* A collapsed filter group (<uvalib-filter collapsible collapsed>) draws only its 44px
363
+ legend button once it upgrades: hold that height. Low specificity, so the [hidden] rule
364
+ above still wins. */
365
+ :where(uvalib-filter[collapsible][collapsed]):not(:defined) {
366
+ display: block;
367
+ min-block-size: 44px;
368
+ }
350
369
  /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px
351
370
  "Search and filters" button shows, so hold that height and keep the form and filters out
352
371
  of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the
@@ -361,6 +380,38 @@ var n = e`
361
380
  display: none;
362
381
  }
363
382
  }
383
+ /* A dialog before <uvalib-dialog> upgrades: its children are the dialog's content, never
384
+ shown in the page, so nothing flashes or moves. Once defined, a closed dialog renders
385
+ nothing (its host is display: contents around a closed <dialog>). */
386
+ uvalib-dialog:not(:defined) {
387
+ display: none;
388
+ }
389
+ /* A citation before <uvalib-citation> upgrades: only the first format's citation, boxed
390
+ as it will be, with the label and 44px format bar held above it (none for hide-label)
391
+ and the 44px Copy citation row below, so nothing moves when it upgrades (an app's
392
+ citations property cannot be held). */
393
+ uvalib-citation:not(:defined) {
394
+ display: block;
395
+ font-size: 1rem;
396
+ line-height: 1.5;
397
+ }
398
+ uvalib-citation:not(:defined):has(> [data-format]) {
399
+ padding-block: calc(2rem + 44px + 0.75rem) calc(0.75rem + 44px);
400
+ }
401
+ uvalib-citation[hide-label]:not(:defined):has(> [data-format]) {
402
+ padding-block-start: calc(44px + 0.75rem);
403
+ }
404
+ uvalib-citation:not(:defined) > [data-format] {
405
+ margin: 0;
406
+ padding: 0.75rem 1rem;
407
+ border: 1px solid transparent;
408
+ overflow-wrap: anywhere;
409
+ text-wrap: pretty;
410
+ }
411
+ uvalib-citation:not(:defined) > [data-format] ~ [data-format],
412
+ uvalib-citation:not(:defined) > [slot] {
413
+ display: none;
414
+ }
364
415
  /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme
365
416
  prints light (the role tokens resolve to their light values), and the content's links
366
417
  are black and underlined, so they are told apart without colour. Content is <main> in
@@ -387,6 +438,6 @@ var n = e`
387
438
  }
388
439
  }
389
440
  `;
390
- export { n as i, s as n, r, o as t };
441
+ export { i as a, n as i, l as n, a as r, c as t };
391
442
 
392
- //# sourceMappingURL=base-DfLI8lpa.js.map
443
+ //# sourceMappingURL=base-CHMHBPeI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-CHMHBPeI.js","names":["unsafeCSS","i","r","fontFallback","FACES","loadFontFallback","fonts","doc","face","tokens","METADATA_LIMITS","metadataLimits","lists","n","l","TYPEKIT_URL","base"],"sources":["../../src/styles/font-fallback.ts","../../src/styles/tokens.ts","../../src/styles/base.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * A metric-matched fallback for Franklin Gothic URW (issue #32). The Adobe Fonts kit uses\n * `font-display: auto`, so on a slow connection text is drawn in the next font of\n * `--uva-font-family` and redrawn when the kit's files arrive. Plain Arial is wider than\n * Franklin Gothic (by 6% regular, 9% bold), so paragraphs rewrapped and the page moved\n * (layout shift). \"UVA Franklin Fallback\" is the system's Arial scaled to Franklin Gothic's\n * average widths, with its ascent and descent, for each face the kit serves (400, 500, 700 and\n * 400 italic; a 600 rule gets the 700 face, as the kit's own matching does). Measured against\n * the kit in Chromium: the fallback wraps a paragraph like Franklin Gothic in about 99% of\n * widths from 260 to 700px at 16 to 20px, against 55 to 82% for plain Arial.\n *\n * `size-adjust` scales Arial's glyphs; the overrides are Franklin Gothic's ascent (0.95 em) and\n * descent (0.25 em) divided by that scale, with no line gap, so a line is as tall in both.\n * Liberation Sans (Linux) has Arial's metrics. Where neither is installed (Android has Roboto),\n * the face is skipped and the next font in the stack is used, as before.\n */\nexport const fontFallback = css`\n @font-face {\n font-family: 'UVA Franklin Fallback';\n src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');\n font-weight: 100 450;\n font-style: normal;\n size-adjust: 94.52%;\n ascent-override: 100.93%;\n descent-override: 26.56%;\n line-gap-override: 0%;\n }\n @font-face {\n font-family: 'UVA Franklin Fallback';\n src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');\n font-weight: 451 599;\n font-style: normal;\n size-adjust: 95.99%;\n ascent-override: 99.18%;\n descent-override: 26.04%;\n line-gap-override: 0%;\n }\n @font-face {\n font-family: 'UVA Franklin Fallback';\n src:\n local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'),\n local('LiberationSans-Bold');\n font-weight: 600 1000;\n font-style: normal;\n size-adjust: 91.32%;\n ascent-override: 104.03%;\n descent-override: 27.38%;\n line-gap-override: 0%;\n }\n @font-face {\n font-family: 'UVA Franklin Fallback';\n src:\n local('Arial Italic'), local('Arial-ItalicMT'), local('Liberation Sans Italic'),\n local('LiberationSans-Italic');\n font-weight: 100 599;\n font-style: italic;\n size-adjust: 95.06%;\n ascent-override: 101.09%;\n descent-override: 26.4%;\n line-gap-override: 0%;\n }\n`;\n\n/** One font per fallback face, so each one is asked for. */\nconst FACES = ['400', '500', '700', 'italic 400'];\n\n/**\n * Load every fallback face now (issue #35). A face from a local() font loads only when text\n * first needs it, so the first italic (or medium) text could be drawn in unscaled Arial and\n * redrawn a moment later. Called once the faces are installed; failures (no Arial or\n * Liberation Sans on the system) are left to the next font in the stack, as before.\n */\nexport function loadFontFallback(doc: Document): void {\n const fonts = doc.fonts;\n if (!fonts?.load) return;\n for (const face of FACES) fonts.load(`${face} 1em \"UVA Franklin Fallback\"`).catch(() => {});\n}\n","// GENERATED by scripts/sync-tokens.mjs from ../monorepo/packages/drupal_library_theme/src/scss/base — do not edit\nimport { css } from 'lit';\n\nexport const tokens = css`\n :root {\n --uva-brand-blue-lightest: #87B9D9;\n --uva-brand-blue-lighter: #3395D4;\n --uva-brand-blue-light: #0370B7;\n --uva-brand-blue-base: #232D4B;\n --uva-brand-blue-300: #87B9D9;\n --uva-brand-blue-200: #3395D4;\n --uva-brand-blue-100: #0370B7;\n --uva-brand-blue: #232D4B;\n --uva-brand-orange-lightest: #FFEAD6;\n --uva-brand-orange-lighter: #FFC999;\n --uva-brand-orange-light: #FFB370;\n --uva-brand-orange-base: #E57200;\n --uva-brand-orange-dark: #B35900;\n --uva-brand-orange-darker: #854200;\n --uva-brand-orange-300: #FFEAD6;\n --uva-brand-orange-200: #FFC999;\n --uva-brand-orange-100: #FFB370;\n --uva-brand-orange: #E57200;\n --uva-brand-orange-A: #B35900;\n --uva-brand-orange-B: #854200;\n --uva-blue-alt-lightest: #BFE7F7;\n --uva-blue-alt-lighter: #91D8F2;\n --uva-blue-alt-light: #55C4EC;\n --uva-blue-alt-base: #007BAC;\n --uva-blue-alt-dark: #005679;\n --uva-blue-alt-darkest: #141E3C;\n --uva-blue-alt-400: #e6f2f7;\n --uva-blue-alt-300: #BFE7F7;\n --uva-blue-alt-200: #91D8F2;\n --uva-blue-alt-100: #55C4EC;\n --uva-blue-alt: #007BAC;\n --uva-blue-alt-A: #005679;\n --uva-blue-alt-B: #141E3C;\n --uva-teal-lightest: #C8F2F4;\n --uva-teal-light: #5BD7DE;\n --uva-teal-base: #25CAD3;\n --uva-teal-dark: #1DA1A8;\n --uva-teal-darker: #16777C;\n --uva-teal-200: #C8F2F4;\n --uva-teal-100: #5BD7DE;\n --uva-teal: #25CAD3;\n --uva-teal-A: #1DA1A8;\n --uva-teal-B: #16777C;\n --uva-green-lightest: #DDEFDC;\n --uva-green-lighter: #89CC74;\n --uva-green-base: #62BB46;\n --uva-green-dark: #4E9737;\n --uva-green-200: #DDEFDC;\n --uva-green-100: #89CC74;\n --uva-green: #62BB46;\n --uva-green-A: #4E9737;\n --uva-red-lightest: #FBCFDA;\n --uva-red-base: #EF3F6B;\n --uva-red-dark: #DF1E43;\n --uva-red-darker: #B30000;\n --uva-red-100: #FBCFDA;\n --uva-red: #EF3F6B;\n --uva-red-A: #DF1E43;\n --uva-red-B: #B30000;\n --uva-yellow-lightest: #FEF6C8;\n --uva-yellow-base: #ECC602;\n --uva-yellow-dark: #B99C02;\n --uva-yellow-100: #FEF6C8;\n --uva-yellow: #ECC602;\n --uva-yellow-A: #B99C02;\n --uva-grey-lightest: #F1F1F1;\n --uva-grey-light: #DADADA;\n --uva-grey-base: #808080;\n --uva-grey-dark: #4F4F4F;\n --uva-grey-darkest: #2B2B2B;\n --uva-grey-200: #F1F1F1;\n --uva-grey-100: #DADADA;\n --uva-grey-50: #ADADAD;\n --uva-grey: #808080;\n --uva-grey-A: #4F4F4F;\n --uva-grey-B: #2B2B2B;\n --uva-font-family: franklin-gothic-urw, \"UVA Franklin Fallback\", Arial, Helvetica, sans-serif;\n --uva-font-size-base: 17px;\n }\n`;\n","import { css, unsafeCSS } from 'lit';\n\n/**\n * `<uvalib-metadata>` long lists before it upgrades (issue #34): a list of more than N values\n * shows its first N and a line for its \"Show all\" button (4px above a 32px button), as the\n * upgraded element does. CSS cannot read N from the attribute into :nth-child(), so the rules\n * are written out for limits 1 to 12; a page with a larger limit adds its own (README). A row's\n * own data-limit on its <dd> wins over list-limit (data-limit=\"0\" shows them all); a data-limit\n * on the list itself works once upgraded but is not held before.\n */\nconst METADATA_LIMITS = Array.from({ length: 12 }, (_, i) => i + 1);\nconst metadataLimits = unsafeCSS(\n METADATA_LIMITS.map((n) => {\n const lists = [\n `uvalib-metadata[list-limit=\"${n}\"]:not(:defined) > dl > dd:not([data-limit]) > :is(ul, ol):not([data-limit])`,\n `uvalib-metadata:not(:defined) > dl > dd[data-limit=\"${n}\"] > :is(ul, ol)`,\n ];\n return (\n `${lists.map((l) => `${l} > li:nth-child(n + ${n + 1})`).join(',\\n')} { display: none; }\\n` +\n `${lists.map((l) => `${l}:has(> li:nth-child(${n + 1}))::after`).join(',\\n')} { content: ''; display: block; block-size: 2.25rem; }`\n );\n }).join('\\n'),\n);\n\nexport const TYPEKIT_URL = 'https://use.typekit.net/oym8nvz.css';\n\n// The body background has no fallback: without dark mode it stays transparent, as before.\n//\n// site-page:not(:defined) applies when base.css is linked in <head>, before the element\n// upgrades: its own formatting context (flow-root), so a heading's top margin cannot collapse\n// through to <body> and shift the page once the element upgrades, and invisible, so its\n// content does not paint above where the header will go. If the script never loads, the\n// content appears anyway after two seconds.\nexport const base = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n html,\n body {\n font-family: var(\n --uva-font-family,\n franklin-gothic-urw,\n 'UVA Franklin Fallback',\n Arial,\n Helvetica,\n sans-serif\n );\n }\n html {\n font-size: var(--uva-font-size-base, 17px);\n }\n body {\n margin: 0;\n line-height: 1.5;\n min-height: 100vh;\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n background-color: var(--uva-color-surface);\n }\n site-page:not(:defined) {\n display: flow-root;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-breadcrumbs:not(:defined),\n uvalib-card:not(:defined),\n uvalib-card-grid:not(:defined),\n uvalib-pager:not(:defined),\n uvalib-contents:not(:defined),\n uvalib-metadata:not(:defined),\n uvalib-tag-list:not(:defined) {\n display: block;\n line-height: 1.5;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n /* A chip row: hidden, one 44px row tall (with the scrolling row's padding), the raw\n children kept on one line so they cannot make it taller. */\n uvalib-chip-group:not(:defined) {\n display: block;\n min-height: 44px;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-chip-group[scroll]:not(:defined) {\n min-height: calc(44px + 0.75rem);\n }\n /* A description: one line of it (0.875rem at 1.5, 0.25rem below the row). */\n uvalib-chip-group[description]:not(:defined) {\n padding-block-end: 1.5625rem;\n }\n /* Its text is drawn from attributes: hold one line until it upgrades. */\n uvalib-results-count:not(:defined) {\n display: block;\n min-block-size: 1.5em;\n }\n uvalib-tag-list:not(:defined)[hidden],\n uvalib-results-count:not(:defined)[hidden] {\n display: none;\n }\n /* The pre-upgrade rules here set display, which beats the hidden attribute's (issue #7).\n More specific than each of them (two pseudo-classes or attributes), so it needs no importance flag. */\n :where(\n site-page,\n uvalib-breadcrumbs,\n uvalib-card,\n uvalib-card-grid,\n uvalib-pager,\n uvalib-contents,\n uvalib-metadata,\n uvalib-chip-group,\n uvalib-tabs,\n uvalib-combobox,\n uvalib-image-regions,\n uvalib-map,\n uvalib-filter-drawer,\n uvalib-filter\n ):not(:defined)[hidden],\n :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {\n display: none;\n }\n /* A record's details before <uvalib-metadata> upgrades (issue #34): the rows already laid\n out as it lays them out (label beside value from 36rem of its own width, stacked below;\n 8px above and below each row, a 1px rule between rows; lists without bullets, 4px apart),\n so the page does not move when it upgrades. Rows the attributes add (creator, rights,\n citation) are not in the page's <dl> and cannot be held. */\n uvalib-metadata:not(:defined) {\n container-type: inline-size;\n font-size: 1rem;\n }\n uvalib-metadata:not(:defined) > dl {\n display: grid;\n grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);\n column-gap: 1.5rem;\n margin: 0;\n }\n uvalib-metadata:not(:defined) > dl > dt {\n grid-column: 1;\n margin: 0;\n padding-block: 0.5rem;\n font-weight: 700;\n }\n uvalib-metadata:not(:defined) > dl > dd {\n grid-column: 2;\n margin: 0;\n padding-block: 0.5rem;\n }\n uvalib-metadata:not(:defined) > dl > dt:not(:first-child),\n uvalib-metadata:not(:defined) > dl > dt:not(:first-child) + dd {\n border-block-start: 1px solid transparent;\n }\n uvalib-metadata:not(:defined) > dl > dd > :is(ul, ol) {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n uvalib-metadata:not(:defined) > dl > dd li + li {\n margin-block-start: 0.25rem;\n }\n @container (width < 36rem) {\n uvalib-metadata:not(:defined) > dl {\n grid-template-columns: minmax(0, 1fr);\n }\n uvalib-metadata:not(:defined) > dl > :is(dt, dd) {\n grid-column: 1;\n }\n uvalib-metadata:not(:defined) > dl > dt {\n padding-block-end: 0;\n }\n uvalib-metadata:not(:defined) > dl > dd {\n padding-block-start: 0;\n }\n uvalib-metadata:not(:defined) > dl > dt:not(:first-child) + dd {\n border-block-start: 0;\n }\n }\n ${metadataLimits}\n /* Tabs stay readable before the script runs: a block, one panel, and a gap the\n size of the tab row (44px) plus its 1rem margin, so the first panel does not\n jump when the element upgrades. Later data-tab panels stay hidden. */\n uvalib-tabs:not(:defined) {\n display: block;\n padding-block-start: calc(44px + 1rem);\n }\n uvalib-tabs:not(:defined) > [data-tab] ~ [data-tab] {\n display: none;\n }\n /* A combobox: its label (from the attribute) and one 44px field (plus a one-line\n description) held, so nothing moves when it upgrades. A fallback <input list> child\n works meanwhile; the other children (options, a datalist) stay out of sight. */\n uvalib-combobox:not(:defined) {\n display: block;\n min-block-size: calc(1.5em + 0.25rem + 44px);\n line-height: 1.5;\n }\n uvalib-combobox[description]:not(:defined) {\n min-block-size: calc(3em + 0.5rem + 44px);\n }\n uvalib-combobox:not(:defined)::before {\n content: attr(label);\n display: block;\n margin-block-end: 0.25rem;\n font-weight: 600;\n }\n uvalib-combobox:not(:defined) > :not(input) {\n display: none;\n }\n uvalib-combobox:not(:defined) > input {\n display: block;\n box-sizing: border-box;\n inline-size: 100%;\n min-block-size: 44px;\n font: inherit;\n line-height: 1.2;\n }\n /* Image regions: the image at its own width and the list beside it (or under it), the\n layout the element keeps once it upgrades, so the image does not move. */\n uvalib-image-regions:not(:defined) {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n align-items: flex-start;\n }\n uvalib-image-regions:not(:defined) > :is(img, picture) {\n display: block;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n height: auto;\n }\n uvalib-image-regions:not(:defined) > :is(ol, ul) {\n flex: 1 1 14rem;\n min-width: 0;\n }\n /* A map: its key instructions (the same text it shows) and the map's height held above\n the child list, so the list does not move when the map is drawn over the page's\n Leaflet. Padding, not margin, so it cannot collapse with the list's own top margin. */\n uvalib-map:not(:defined) {\n display: block;\n }\n uvalib-map:not(:defined)::before {\n content: 'Tab or arrow keys move between places; Enter opens one. With the map focused, arrow keys pan and + and − zoom.';\n display: block;\n padding-block-end: calc(0.5rem + max(12rem, var(--uvalib-map-height, min(24rem, 75vw))));\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--uva-color-text-muted, #4b5563);\n }\n /* A collapsed filter group (<uvalib-filter collapsible collapsed>) draws only its 44px\n legend button once it upgrades: hold that height. Low specificity, so the [hidden] rule\n above still wins. */\n :where(uvalib-filter[collapsible][collapsed]):not(:defined) {\n display: block;\n min-block-size: 44px;\n }\n /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px\n \"Search and filters\" button shows, so hold that height and keep the form and filters out\n of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the\n same two rules in a media query of that width (see the README). Low specificity, so the\n [hidden] rule above still wins. */\n @media (max-width: 48rem) {\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) {\n display: block;\n min-block-size: 44px;\n }\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) > * {\n display: none;\n }\n }\n /* A dialog before <uvalib-dialog> upgrades: its children are the dialog's content, never\n shown in the page, so nothing flashes or moves. Once defined, a closed dialog renders\n nothing (its host is display: contents around a closed <dialog>). */\n uvalib-dialog:not(:defined) {\n display: none;\n }\n /* A citation before <uvalib-citation> upgrades: only the first format's citation, boxed\n as it will be, with the label and 44px format bar held above it (none for hide-label)\n and the 44px Copy citation row below, so nothing moves when it upgrades (an app's\n citations property cannot be held). */\n uvalib-citation:not(:defined) {\n display: block;\n font-size: 1rem;\n line-height: 1.5;\n }\n uvalib-citation:not(:defined):has(> [data-format]) {\n padding-block: calc(2rem + 44px + 0.75rem) calc(0.75rem + 44px);\n }\n uvalib-citation[hide-label]:not(:defined):has(> [data-format]) {\n padding-block-start: calc(44px + 0.75rem);\n }\n uvalib-citation:not(:defined) > [data-format] {\n margin: 0;\n padding: 0.75rem 1rem;\n border: 1px solid transparent;\n overflow-wrap: anywhere;\n text-wrap: pretty;\n }\n uvalib-citation:not(:defined) > [data-format] ~ [data-format],\n uvalib-citation:not(:defined) > [slot] {\n display: none;\n }\n /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme\n prints light (the role tokens resolve to their light values), and the content's links\n are black and underlined, so they are told apart without colour. Content is <main> in\n light DOM and the unslotted children in shadow DOM. print-chrome keeps the page as it is\n shown, apart from the light scheme. */\n @media print {\n :root[data-uva-color-scheme]:has(site-page) {\n color-scheme: light;\n --uva-color-scheme: light;\n }\n /* Light DOM's trail, here too, as the pre-upgrade rule above (unlayered) would win. */\n site-page:not([print-chrome]) > [slot='breadcrumbs'] {\n display: none;\n }\n site-page:not([print-chrome]) > :not([slot], site-header, site-footer, .alerts-list) :any-link,\n site-page:not([print-chrome]) > :any-link:not([slot], .skip-link) {\n color: #000;\n text-decoration: underline;\n }\n }\n @keyframes uvalib-site-page-reveal {\n to {\n visibility: visible;\n }\n }\n`;\n"],"mappings":";;AAkBA,IAAaG,IAAe,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDzBC,IAAQ;CAAC;CAAO;CAAO;CAAO;AAAY;AAQhD,SAAgBC,EAAiB,GAAqB;CACpD,IAAMC,IAAQC,EAAI;CAClB,IAAKD,GAAO,MACZ,KAAK,IAAME,KAAQJ,GAAO,EAAM,KAAK,GAAGI,EAAK,6BAA6B,CAAC,CAAC,YAAY,CAAC,CAAC;AAC5F;;AC3EA,IAAaC,IAAS,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCOnBC,IAAkB,MAAM,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAMT,IAAI,CAAC,GAC5DU,IAAiBX,EACrBU,EAAgB,KAAK,MAAM;CACzB,IAAME,IAAQ,CACZ,+BAA+BC,EAAE,+EACjC,uDAAuDA,EAAE,iBAC3D;CACA,OACE,GAAGD,EAAM,KAAK,MAAM,GAAGE,EAAE,sBAAsBD,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,uBAClED,EAAM,KAAK,MAAM,GAAGE,EAAE,sBAAsBD,IAAI,EAAE,UAAU,CAAC,CAAC,KAAK,KAAK,EAAE;AAEjF,CAAC,CAAC,CAAC,KAAK,IAAI,CACd,GAEaE,IAAc,uCASdC,IAAO,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmJnBL,EAAe"}
@@ -0,0 +1,18 @@
1
+ // src/base/clipboard.ts
2
+ async function e(e, t) {
3
+ let n = navigator.clipboard;
4
+ if (t && typeof ClipboardItem == "function" && typeof n?.write == "function") try {
5
+ await n.write([new ClipboardItem({
6
+ "text/plain": new Blob([e], { type: "text/plain" }),
7
+ "text/html": new Blob([t], { type: "text/html" })
8
+ })]);
9
+ return;
10
+ } catch {}
11
+ await n.writeText(e);
12
+ }
13
+ function t(e) {
14
+ e && e.ownerDocument?.getSelection()?.selectAllChildren(e);
15
+ }
16
+ export { t as n, e as t };
17
+
18
+ //# sourceMappingURL=clipboard-CNG7Y_5X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard-CNG7Y_5X.js","names":["copyText","clipboard","html","text","selectContents","node"],"sources":["../../src/base/clipboard.ts"],"sourcesContent":["/**\n * Copy `text` to the clipboard. With `html`, it is copied as both `text/html` and\n * `text/plain` (a `ClipboardItem`), so emphasis such as an italic title survives a paste into\n * a word processor, falling back to plain text where that is not supported or refused.\n * Rejects when nothing could be copied (no clipboard, or permission denied).\n */\nexport async function copyText(text: string, html?: string): Promise<void> {\n const clipboard = navigator.clipboard;\n if (html && typeof ClipboardItem === 'function' && typeof clipboard?.write === 'function') {\n try {\n await clipboard.write([\n new ClipboardItem({\n 'text/plain': new Blob([text], { type: 'text/plain' }),\n 'text/html': new Blob([html], { type: 'text/html' }),\n }),\n ]);\n return;\n } catch {\n // Some browsers refuse HTML: plain text below.\n }\n }\n await clipboard.writeText(text);\n}\n\n/** Select everything in `node`, so that the visitor can copy it with the keyboard. */\nexport function selectContents(node: Node | null | undefined): void {\n if (node) node.ownerDocument?.getSelection()?.selectAllChildren(node);\n}\n"],"mappings":";AAMA,eAAsBA,EAAS,GAAc,GAA8B;CACzE,IAAMC,IAAY,UAAU;CAC5B,IAAIC,KAAQ,OAAO,iBAAkB,cAAc,OAAOD,GAAW,SAAU,YAC7E,IAAI;EACF,MAAMA,EAAU,MAAM,CACpB,IAAI,cAAc;GAChB,cAAc,IAAI,KAAK,CAACE,CAAI,GAAG,EAAE,MAAM,aAAa,CAAC;GACrD,aAAa,IAAI,KAAK,CAACD,CAAI,GAAG,EAAE,MAAM,YAAY,CAAC;EACrD,CAAC,CACH,CAAC;EACD;CACF,QAAQ,CAER;CAEF,MAAMD,EAAU,UAAUE,CAAI;AAChC;AAGA,SAAgBC,EAAe,GAAqC;CAClE,AAAIC,KAAMA,EAAK,eAAe,aAAa,CAAC,EAAE,kBAAkBA,CAAI;AACtE"}
@@ -0,0 +1,6 @@
1
+ import { o as e } from "./UvalibElement-pGONDAwB.js";
2
+ // node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/if-defined.js
3
+ var t = (t) => t ?? e;
4
+ export { t };
5
+
6
+ //# sourceMappingURL=if-defined-COiQb-gl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if-defined-COiQb-gl.js","names":["t","A","o"],"sources":["../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/if-defined.js"],"sourcesContent":["import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n"],"ignoreList":[0],"mappings":";;AAKG,IAAME,KAAE,MAAGA,KAAGF"}
@@ -1,8 +1,9 @@
1
1
  import { a as e, f as t, i as n, l as r, m as i, n as a, o, p as s, r as c, t as l } from "./UvalibElement-pGONDAwB.js";
2
- import { i as u, n as d, r as f, t as p } from "./site-main-nav-CAwKq_x5.js";
3
- import { a as m } from "./analytics-DTTihuBD.js";
4
- import { t as h } from "./link-DbJSwj16.js";
5
- import { t as g } from "./accessible-DJv7YOtS.js";
2
+ import { t as u } from "./if-defined-COiQb-gl.js";
3
+ import { a as d } from "./analytics-DTTihuBD.js";
4
+ import { t as f } from "./link-DbJSwj16.js";
5
+ import { t as p } from "./accessible-DJv7YOtS.js";
6
+ import { n as m, r as h, t as g } from "./site-main-nav-CmMq2t8t.js";
6
7
  // src/styles/color-scheme.ts
7
8
  var _ = s("\n --uva-color-border: #7a84a0;\n"), v = "color: var(--uva-color-pre-footer-text, #ffffff);", y = t`
8
9
  @supports (color: light-dark(#000, #fff)) {
@@ -56,6 +57,10 @@ var _ = s("\n --uva-color-border: #7a84a0;\n"), v = "color: var(--uva-color-pre
56
57
  text (7.6:1). */
57
58
  --uva-color-highlight: light-dark(var(--uva-brand-orange-200, #ffc999), #854200);
58
59
  --uva-color-on-highlight: light-dark(var(--uva-grey-darkest, #2b2b2b), #ffffff);
60
+ /* base.css's .uvalib-table: the row rules (decorative) and the stripes, where body text
61
+ is 12.5:1 in light and 12.6:1 in dark (AAA); muted text 6.7:1 and 6.9:1. */
62
+ --uva-color-table-border: light-dark(var(--uva-grey-100, #dadada), #4f5a7a);
63
+ --uva-color-table-stripe: light-dark(var(--uva-grey-200, #f1f1f1), #1a2340);
59
64
  }
60
65
  :root[data-uva-color-scheme='system'] {
61
66
  color-scheme: light dark;
@@ -254,7 +259,7 @@ var R = class {
254
259
  "hreflang"
255
260
  ], ne = (e) => e.stopPropagation(), Q = class extends l {
256
261
  static {
257
- this.styles = [g, t`
262
+ this.styles = [p, t`
258
263
  :host {
259
264
  display: block;
260
265
  width: 100%;
@@ -545,14 +550,14 @@ var R = class {
545
550
  constructor() {
546
551
  super(), this.rootLinkDomain = "https://www.library.virginia.edu", this.variant = "full", this.noMainNav = !1, this.colorSchemeSwitch = !1, this.scheme = new R(this, () => this.colorSchemeSwitch, () => this.noStyle), this.schemeName = `uva-color-scheme-${++W}`, this.mainNavItems = null, this.warnedMainNav = !1, this.siteLinks = null, this.warnedInvalid = !1, this.trackClick = (e) => {
547
552
  let t = e.composedPath(), n = t.find((e) => e instanceof HTMLAnchorElement);
548
- n && !t.some((e) => e instanceof Element && /^site-(main-nav|alerts)$/.test(e.localName)) && (n.slot === "skip-link" && n.parentNode === this ? m(this, [B, "skip-link"]) : n.matches(".logo") ? m(this, [B, "logo-click"]) : n.matches(".site-name") ? m(this, [B, "site-name-click"]) : n.closest("nav.inline, nav.menu") && this.renderRoot.contains(n) && m(this, [
553
+ n && !t.some((e) => e instanceof Element && /^site-(main-nav|alerts)$/.test(e.localName)) && (n.slot === "skip-link" && n.parentNode === this ? d(this, [B, "skip-link"]) : n.matches(".logo") ? d(this, [B, "logo-click"]) : n.matches(".site-name") ? d(this, [B, "site-name-click"]) : n.closest("nav.inline, nav.menu") && this.renderRoot.contains(n) && d(this, [
549
554
  B,
550
555
  "link-click",
551
556
  n.textContent.replace(/\s+/g, " ").trim()
552
557
  ]));
553
558
  }, this.trackToggle = (e) => {
554
559
  let t = e.composedPath()[0];
555
- t instanceof HTMLElement && t.id === this.menuId && e.newState === "open" && m(this, [B, "menu-open"]);
560
+ t instanceof HTMLElement && t.id === this.menuId && e.newState === "open" && d(this, [B, "menu-open"]);
556
561
  }, this.onMenuLinkClick = (e) => {
557
562
  if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
558
563
  let t = e.composedPath(), n = t.findIndex((e) => e instanceof Element && e.localName === "a"), r = t.findIndex((e) => e instanceof HTMLElement && e.id === this.menuId);
@@ -598,7 +603,7 @@ var R = class {
598
603
  return (this.siteName ?? "").replace(/\s+/g, " ").trim();
599
604
  }
600
605
  brand() {
601
- let e = r`<a class="logo" href=${h(this.rootLinkDomain, "/")}
606
+ let e = r`<a class="logo" href=${f(this.rootLinkDomain, "/")}
602
607
  ><img src=${this.logoSrc()} alt="UVA Library home" width="304" height="69"
603
608
  /></a>`, t = this.name;
604
609
  return t ? r`<div class="brand">
@@ -608,11 +613,11 @@ var R = class {
608
613
  </div>` : e;
609
614
  }
610
615
  logoSrc() {
611
- return this.scheme.logoDark ? G : h(this.rootLinkDomain, "/sites/default/files/2022-09/library_rgb.png");
616
+ return this.scheme.logoDark ? G : f(this.rootLinkDomain, "/sites/default/files/2022-09/library_rgb.png");
612
617
  }
613
618
  onSchemeChange(e) {
614
619
  let t = e.target;
615
- t.checked && (this.scheme.choose(t.value), m(this, [
620
+ t.checked && (this.scheme.choose(t.value), d(this, [
616
621
  B,
617
622
  "color-scheme",
618
623
  t.value
@@ -654,7 +659,7 @@ var R = class {
654
659
  syncMainNav() {
655
660
  let e = this.lightDom ? this.adoptMainNav() : this.slottedMainNav;
656
661
  if (!e.length) return this.mainNavItems &&= null, e;
657
- let t = e.flatMap((e, t) => t === 0 ? f(e) : [{}]), n = d(t);
662
+ let t = e.flatMap((e, t) => t === 0 ? h(e) : [{}]), n = m(t);
658
663
  (n.invalid || n.flattened) && !this.warnedMainNav && (this.warnedMainNav = !0, console.warn(`${this.localName}: ignoring invalid slot="${Y}" entries (each needs a label, and an href or links; deeper levels are shown in their group).`));
659
664
  let r = n.items.length ? n.items : null;
660
665
  return JSON.stringify(r) !== JSON.stringify(this.mainNavItems) && (this.mainNavItems = r), e;
@@ -782,7 +787,7 @@ var R = class {
782
787
  hreflang=${u(e.hreflang)}
783
788
  >${e.text}</a
784
789
  >
785
- </li>`) : (t ? H : V).map((t) => r`<li><a href=${h(e, t.path)}>${t.label}</a></li>`), a = n ? this.siteLinksLabel || "Site" : "Utility", s = this.menuId, c = `--${s}`, l = !t && !this.noMainNav, d = r`<button
790
+ </li>`) : (t ? H : V).map((t) => r`<li><a href=${f(e, t.path)}>${t.label}</a></li>`), a = n ? this.siteLinksLabel || "Site" : "Utility", s = this.menuId, c = `--${s}`, l = !t && !this.noMainNav, d = r`<button
786
791
  popovertarget=${s}
787
792
  aria-controls=${s}
788
793
  class="menu-toggle"
@@ -810,9 +815,9 @@ var R = class {
810
815
  <ul id=${s} popover style="--menu-anchor: ${c}">
811
816
  ${i}
812
817
  </ul>
813
- </nav>`, f = r`<div hidden>
818
+ </nav>`, p = r`<div hidden>
814
819
  <slot name="site-links" @slotchange=${this.onSourcesChange}></slot>
815
- </div>`, p = (t) => r`<site-main-nav
820
+ </div>`, m = (t) => r`<site-main-nav
816
821
  class=${t ? "accordion" : "bar"}
817
822
  layout=${u(t ? "accordion" : void 0)}
818
823
  ?no-shadow-dom=${this.lightDom}
@@ -823,7 +828,7 @@ var R = class {
823
828
  current=${u(this.mainNavCurrent || void 0)}
824
829
  .items=${this.mainNavItems ?? void 0}
825
830
  @site-main-nav-error=${t ? ne : o}
826
- ></site-main-nav>`, m = r`<button
831
+ ></site-main-nav>`, h = r`<button
827
832
  popovertarget=${s}
828
833
  aria-controls=${s}
829
834
  class="menu-toggle"
@@ -848,21 +853,21 @@ var R = class {
848
853
  Menu
849
854
  </button>
850
855
  <div id=${s} popover class="menu-popover" style="--menu-anchor: ${c}">
851
- ${p(!0)}
856
+ ${m(!0)}
852
857
  <nav class="menu" aria-label=${`${a} menu`}>
853
858
  <ul>
854
859
  ${i}
855
860
  </ul>
856
861
  </nav>
857
862
  </div>
858
- ${p(!1)}`, g = r`<div hidden>
863
+ ${m(!1)}`, g = r`<div hidden>
859
864
  <slot name="site-links" @slotchange=${this.onSourcesChange}></slot>
860
865
  </div>
861
866
  <div hidden>
862
867
  <slot name="main-nav" @slotchange=${this.onSourcesChange}></slot>
863
868
  </div>`;
864
- if (this.scheme.active) return this.renderWithScheme(i, a, l, p);
865
- let _ = t ? o : l ? m : d, v = this.lightDom ? o : l ? g : f;
869
+ if (this.scheme.active) return this.renderWithScheme(i, a, l, m);
870
+ let _ = t ? o : l ? h : d, v = this.lightDom ? o : l ? g : p;
866
871
  return this.name ? r`
867
872
  <header part="header" class=${t ? "vendor" : ""}>
868
873
  ${this.lightDom ? o : r`<slot name="skip-link"></slot><slot name="alerts"></slot>`}
@@ -878,7 +883,7 @@ var R = class {
878
883
  ` : r`
879
884
  <header part="header" class=${t ? "vendor" : ""}>
880
885
  ${this.lightDom ? o : r`<slot name="skip-link"></slot><slot name="alerts"></slot>`}
881
- <a class="logo" href=${h(e, "/")}
886
+ <a class="logo" href=${f(e, "/")}
882
887
  ><img src=${this.logoSrc()} alt="UVA Library home" width="304" height="69"
883
888
  /></a>
884
889
  <nav class="inline" aria-label=${a}>
@@ -925,7 +930,7 @@ a([e({
925
930
  attribute: "color-scheme-switch"
926
931
  })], Q.prototype, "colorSchemeSwitch", void 0), a([n()], Q.prototype, "mainNavItems", void 0), a([n()], Q.prototype, "siteLinks", void 0), i("site-header", Q);
927
932
  var $ = customElements.get("site-main-nav");
928
- $ && $ !== p && console.warn("site-header: <site-main-nav> is already defined by another copy of @uvalib/web-components; the header uses that one. Load the components from one source only.");
933
+ $ && $ !== g && console.warn("site-header: <site-main-nav> is already defined by another copy of @uvalib/web-components; the header uses that one. Load the components from one source only.");
929
934
  export { R as t };
930
935
 
931
- //# sourceMappingURL=site-header-CEmNtmk5.js.map
936
+ //# sourceMappingURL=site-header-B78a_ldi.js.map