@uvalib/web-components 1.2.0 → 1.4.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 (200) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +849 -47
  3. package/dist/analytics.d.ts +10 -0
  4. package/dist/analytics.js +9 -0
  5. package/dist/analytics.js.map +1 -0
  6. package/dist/base/UvalibElement.js +8 -5
  7. package/dist/base/UvalibElement.js.map +1 -1
  8. package/dist/base/analytics-state.d.ts +7 -0
  9. package/dist/base/analytics-state.js.map +1 -1
  10. package/dist/base/light-dom-styles.d.ts +13 -0
  11. package/dist/base/light-dom-styles.js +26 -0
  12. package/dist/base/light-dom-styles.js.map +1 -1
  13. package/dist/base/search-tracker.d.ts +57 -0
  14. package/dist/base/search-tracker.js +51 -0
  15. package/dist/base/search-tracker.js.map +1 -0
  16. package/dist/base.css +286 -14
  17. package/dist/base.d.ts +2 -0
  18. package/dist/base.js +1 -0
  19. package/dist/base.js.map +1 -1
  20. package/dist/components/site-analytics/SiteAnalytics.d.ts +20 -1
  21. package/dist/components/site-analytics/SiteAnalytics.js +93 -12
  22. package/dist/components/site-analytics/SiteAnalytics.js.map +1 -1
  23. package/dist/components/site-page/SitePage.d.ts +23 -0
  24. package/dist/components/site-page/SitePage.js +77 -0
  25. package/dist/components/site-page/SitePage.js.map +1 -1
  26. package/dist/components/uvalib-back-to-top/UvalibBackToTop.d.ts +58 -0
  27. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js +250 -0
  28. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js.map +1 -0
  29. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.d.ts +1 -0
  30. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js +4 -0
  31. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js.map +1 -0
  32. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.d.ts +14 -0
  33. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js +56 -4
  34. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js.map +1 -1
  35. package/dist/components/uvalib-chip-group/UvalibChipGroup.d.ts +25 -3
  36. package/dist/components/uvalib-chip-group/UvalibChipGroup.js +80 -10
  37. package/dist/components/uvalib-chip-group/UvalibChipGroup.js.map +1 -1
  38. package/dist/components/uvalib-combobox/UvalibCombobox.d.ts +212 -0
  39. package/dist/components/uvalib-combobox/UvalibCombobox.js +1088 -0
  40. package/dist/components/uvalib-combobox/UvalibCombobox.js.map +1 -0
  41. package/dist/components/uvalib-combobox/uvalib-combobox.d.ts +1 -0
  42. package/dist/components/uvalib-combobox/uvalib-combobox.js +4 -0
  43. package/dist/components/uvalib-combobox/uvalib-combobox.js.map +1 -0
  44. package/dist/components/uvalib-contents/UvalibContents.d.ts +53 -0
  45. package/dist/components/uvalib-contents/UvalibContents.js +202 -3
  46. package/dist/components/uvalib-contents/UvalibContents.js.map +1 -1
  47. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.d.ts +56 -17
  48. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js +285 -81
  49. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js.map +1 -1
  50. package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +6 -0
  51. package/dist/components/uvalib-date-range/UvalibDateRange.js +23 -0
  52. package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -1
  53. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.d.ts +113 -0
  54. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js +589 -0
  55. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js.map +1 -0
  56. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.d.ts +1 -0
  57. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js +4 -0
  58. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js.map +1 -0
  59. package/dist/components/uvalib-image-regions/UvalibImageRegions.d.ts +138 -0
  60. package/dist/components/uvalib-image-regions/UvalibImageRegions.js +689 -0
  61. package/dist/components/uvalib-image-regions/UvalibImageRegions.js.map +1 -0
  62. package/dist/components/uvalib-image-regions/regions.d.ts +57 -0
  63. package/dist/components/uvalib-image-regions/regions.js +117 -0
  64. package/dist/components/uvalib-image-regions/regions.js.map +1 -0
  65. package/dist/components/uvalib-image-regions/uvalib-image-regions.d.ts +1 -0
  66. package/dist/components/uvalib-image-regions/uvalib-image-regions.js +4 -0
  67. package/dist/components/uvalib-image-regions/uvalib-image-regions.js.map +1 -0
  68. package/dist/components/uvalib-lightbox/UvalibLightbox.d.ts +79 -0
  69. package/dist/components/uvalib-lightbox/UvalibLightbox.js +295 -16
  70. package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -1
  71. package/dist/components/uvalib-map/UvalibMap.d.ts +251 -0
  72. package/dist/components/uvalib-map/UvalibMap.js +1395 -0
  73. package/dist/components/uvalib-map/UvalibMap.js.map +1 -0
  74. package/dist/components/uvalib-map/uvalib-map.d.ts +1 -0
  75. package/dist/components/uvalib-map/uvalib-map.js +4 -0
  76. package/dist/components/uvalib-map/uvalib-map.js.map +1 -0
  77. package/dist/components/uvalib-metadata/UvalibMetadata.d.ts +39 -2
  78. package/dist/components/uvalib-metadata/UvalibMetadata.js +214 -8
  79. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  80. package/dist/components/uvalib-pager/UvalibPager.d.ts +22 -3
  81. package/dist/components/uvalib-pager/UvalibPager.js +42 -4
  82. package/dist/components/uvalib-pager/UvalibPager.js.map +1 -1
  83. package/dist/custom-elements.json +9641 -3131
  84. package/dist/index.d.ts +8 -0
  85. package/dist/index.js +5 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/pagefind.css +4 -0
  88. package/dist/styles/base.js +119 -0
  89. package/dist/styles/base.js.map +1 -1
  90. package/dist/styles/color-scheme.js +5 -0
  91. package/dist/styles/color-scheme.js.map +1 -1
  92. package/dist/styles/controls.js +6 -0
  93. package/dist/styles/controls.js.map +1 -1
  94. package/dist/styles/hidden.d.ts +2 -0
  95. package/dist/styles/hidden.js +51 -0
  96. package/dist/styles/hidden.js.map +1 -0
  97. package/dist/styles/message.d.ts +1 -0
  98. package/dist/styles/message.js +82 -0
  99. package/dist/styles/message.js.map +1 -0
  100. package/dist/styles/pagefind.js +4 -0
  101. package/dist/styles/pagefind.js.map +1 -1
  102. package/dist/styles/result-list.d.ts +1 -0
  103. package/dist/styles/result-list.js +111 -0
  104. package/dist/styles/result-list.js.map +1 -0
  105. package/dist/styles/results.js +0 -15
  106. package/dist/styles/results.js.map +1 -1
  107. package/dist/testing/index.d.ts +110 -0
  108. package/dist/testing/index.js +100 -0
  109. package/dist/testing/index.js.map +1 -0
  110. package/dist/testing/lighthouse-rules.d.ts +10 -0
  111. package/dist/testing/lighthouse-rules.js +44 -0
  112. package/dist/testing/lighthouse-rules.js.map +1 -0
  113. package/dist/tokens.css +5 -0
  114. package/dist-cdn/analytics.js +32 -0
  115. package/dist-cdn/analytics.js.map +1 -0
  116. package/dist-cdn/base.css +286 -14
  117. package/dist-cdn/bento-box.js +3 -3
  118. package/dist-cdn/chunks/{SiteAnalytics-Cm-FyhYS.js → SiteAnalytics-B9gu5aGO.js} +59 -30
  119. package/dist-cdn/chunks/SiteAnalytics-B9gu5aGO.js.map +1 -0
  120. package/dist-cdn/chunks/{UvalibElement-BnI-eRRR.js → UvalibElement-pGONDAwB.js} +108 -101
  121. package/dist-cdn/chunks/UvalibElement-pGONDAwB.js.map +1 -0
  122. package/dist-cdn/chunks/{accessible-GqhVn5_H.js → accessible-DJv7YOtS.js} +2 -2
  123. package/dist-cdn/chunks/{accessible-GqhVn5_H.js.map → accessible-DJv7YOtS.js.map} +1 -1
  124. package/dist-cdn/chunks/analytics-state-Ce8DKe4F.js.map +1 -1
  125. package/dist-cdn/chunks/{base-p5pk0vb2.js → base-BI8h0Gf3.js} +121 -2
  126. package/dist-cdn/chunks/base-BI8h0Gf3.js.map +1 -0
  127. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js → library-weekly-hours-CrV3TlP5.js} +3 -3
  128. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js.map → library-weekly-hours-CrV3TlP5.js.map} +1 -1
  129. package/dist-cdn/chunks/regions-B8ExwUGP.js +86 -0
  130. package/dist-cdn/chunks/regions-B8ExwUGP.js.map +1 -0
  131. package/dist-cdn/chunks/{repeat-CIFUYkyh.js → repeat-m5Zd_QeP.js} +2 -2
  132. package/dist-cdn/chunks/{repeat-CIFUYkyh.js.map → repeat-m5Zd_QeP.js.map} +1 -1
  133. package/dist-cdn/chunks/{site-header-BlOYvQg1.js → site-header-DYRMpdBj.js} +9 -4
  134. package/dist-cdn/chunks/{site-header-BlOYvQg1.js.map → site-header-DYRMpdBj.js.map} +1 -1
  135. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js → site-main-nav-DURrQMal.js} +3 -3
  136. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js.map → site-main-nav-DURrQMal.js.map} +1 -1
  137. package/dist-cdn/chunks/{static-html-1mTAG6nS.js → static-html-C1rhtCHu.js} +2 -2
  138. package/dist-cdn/chunks/{static-html-1mTAG6nS.js.map → static-html-C1rhtCHu.js.map} +1 -1
  139. package/dist-cdn/custom-elements.json +9641 -3131
  140. package/dist-cdn/events-section.js +3 -3
  141. package/dist-cdn/library-hours-setup.js +2 -2
  142. package/dist-cdn/library-weekly-hours.js +1 -1
  143. package/dist-cdn/manifest.json +10 -2
  144. package/dist-cdn/pagefind.css +4 -0
  145. package/dist-cdn/site-alerts.js +4 -4
  146. package/dist-cdn/site-analytics.js +2 -2
  147. package/dist-cdn/site-footer.js +2 -2
  148. package/dist-cdn/site-header.js +1 -1
  149. package/dist-cdn/site-hours-section.js +4 -4
  150. package/dist-cdn/site-main-nav.js +1 -1
  151. package/dist-cdn/site-page.js +56 -11
  152. package/dist-cdn/site-page.js.map +1 -1
  153. package/dist-cdn/site-style.js +2 -2
  154. package/dist-cdn/skills/uvalib-web-components/SKILL.md +98 -13
  155. package/dist-cdn/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  156. package/dist-cdn/skills/uvalib-web-components/reference/components.md +302 -14
  157. package/dist-cdn/skills/uvalib-web-components/reference/snippets.md +1 -1
  158. package/dist-cdn/tokens.css +5 -0
  159. package/dist-cdn/uvalib-analytics.js +2 -2
  160. package/dist-cdn/uvalib-back-to-top.js +156 -0
  161. package/dist-cdn/uvalib-back-to-top.js.map +1 -0
  162. package/dist-cdn/uvalib-breadcrumbs.js +31 -11
  163. package/dist-cdn/uvalib-breadcrumbs.js.map +1 -1
  164. package/dist-cdn/uvalib-card-grid.js +1 -1
  165. package/dist-cdn/uvalib-card.js +3 -3
  166. package/dist-cdn/uvalib-chip-group.js +53 -14
  167. package/dist-cdn/uvalib-chip-group.js.map +1 -1
  168. package/dist-cdn/uvalib-combobox.js +667 -0
  169. package/dist-cdn/uvalib-combobox.js.map +1 -0
  170. package/dist-cdn/uvalib-contents.js +100 -22
  171. package/dist-cdn/uvalib-contents.js.map +1 -1
  172. package/dist-cdn/uvalib-date-histogram.js +237 -127
  173. package/dist-cdn/uvalib-date-histogram.js.map +1 -1
  174. package/dist-cdn/uvalib-date-range.js +14 -2
  175. package/dist-cdn/uvalib-date-range.js.map +1 -1
  176. package/dist-cdn/uvalib-filter-drawer.js +355 -0
  177. package/dist-cdn/uvalib-filter-drawer.js.map +1 -0
  178. package/dist-cdn/uvalib-filter.js +3 -3
  179. package/dist-cdn/uvalib-image-regions.js +460 -0
  180. package/dist-cdn/uvalib-image-regions.js.map +1 -0
  181. package/dist-cdn/uvalib-lightbox.js +214 -59
  182. package/dist-cdn/uvalib-lightbox.js.map +1 -1
  183. package/dist-cdn/uvalib-map.js +667 -0
  184. package/dist-cdn/uvalib-map.js.map +1 -0
  185. package/dist-cdn/uvalib-metadata.js +150 -24
  186. package/dist-cdn/uvalib-metadata.js.map +1 -1
  187. package/dist-cdn/uvalib-pager.js +29 -17
  188. package/dist-cdn/uvalib-pager.js.map +1 -1
  189. package/dist-cdn/uvalib-photo-grid.js +2 -2
  190. package/dist-cdn/uvalib-results-count.js +2 -2
  191. package/dist-cdn/uvalib-tabs.js +2 -2
  192. package/dist-cdn/uvalib-tag-list.js +2 -2
  193. package/package.json +43 -1
  194. package/skills/uvalib-web-components/SKILL.md +98 -13
  195. package/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  196. package/skills/uvalib-web-components/reference/components.md +302 -14
  197. package/skills/uvalib-web-components/reference/snippets.md +1 -1
  198. package/dist-cdn/chunks/SiteAnalytics-Cm-FyhYS.js.map +0 -1
  199. package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js.map +0 -1
  200. package/dist-cdn/chunks/base-p5pk0vb2.js.map +0 -1
@@ -6,12 +6,22 @@ export interface HistogramItem {
6
6
  count: number;
7
7
  }
8
8
  /**
9
- * Monthly or yearly counts as bars: a date distribution for a search page, an archive
10
- * timeline or a card. Give `items` (`{ date, count }`, `date` a `YYYY` or `YYYY-MM`) or a
11
- * child `<table>` (the no-JS fallback). `granularity="month"` draws twelve bars for every
9
+ * Monthly, yearly or per-decade counts as bars: a date distribution for a search page, an
10
+ * archive timeline or a card. Give `items` (`{ date, count }`, `date` a `YYYY` or `YYYY-MM`)
11
+ * or a child `<table>` (the no-JS fallback). `granularity="month"` draws twelve bars for every
12
12
  * year from the first date to the last, including months with a count of zero. A year-only
13
13
  * count in a month chart, a day, or any other date is a chip beside the chart.
14
14
  *
15
+ * `granularity="decade"` is for a long span (two centuries of minutes): one bar per decade
16
+ * ("1810s: 22 meetings"), an empty decade a gap, five decades to a row labelled with its
17
+ * first year (1800, 1850, …), the decades lined up in columns. Choosing a decade selects
18
+ * its first to last year (`selected="1810/1819"`, `select` `{ from: '1810-01-01', to:
19
+ * '1819-12-31' }`); up and down arrows move 50 years. `granularity="auto"` draws months
20
+ * when every count is a month within 3 years (at most 36 bars), years up to 30 years, and
21
+ * decades beyond. A year row that scrolls sideways is not offered: 200 years at the 24px
22
+ * minimum bar is over 5,000px, so a sidebar would show ten years at a time and lose the
23
+ * shape that decades show whole.
24
+ *
15
25
  * Each bar is a button named like "October 2015: 5,311 photos". Arrow keys move between
16
26
  * bars; Enter or Space selects. `selected` is one bucket (`2015-10`, `2015`) or a range
17
27
  * (`2015-03/2016-01`, also `..` or an en dash). The selection is `aria-pressed`, an inset
@@ -20,20 +30,23 @@ export interface HistogramItem {
20
30
  * again clears it (`from` and `to` are empty strings).
21
31
  *
22
32
  * `range-for` is the id of a `<uvalib-date-range>`. A bar click sets that element's
23
- * `value`. Its `date-range-change` (and its `value` when this element connects, reconnects,
24
- * or the range is added later) highlights the buckets that overlap the range. A value
25
- * that is exactly the range's own `min` and `max` is no selection. Setting `selected`
26
- * here updates the date range; setting the date range's `value` in script does not,
27
- * unless this element connects afterwards or the range fires `date-range-change`.
33
+ * `value`. Whenever the range's value changes, from its controls or set in script (a Clear
34
+ * button, Back/Forward, a restored URL), this element highlights the buckets that overlap it
35
+ * (it listens for `uvalib-date-range-value`). A value that is exactly the range's own `min`
36
+ * and `max` is no selection. On connect or reconnect, or when the range is added later, the
37
+ * range's value wins when it holds a selection or changed while this element was away;
38
+ * otherwise `selected` is written to it. A range value is never rounded to whole buckets
39
+ * and written back. Setting `selected` here updates the date range.
28
40
  *
29
41
  * `variant="strip"` is the small per-year row for a card: not interactive, `role="img"`,
30
- * one bar per year whatever `granularity` is.
42
+ * one bar per year, or per decade with `decade` (or `auto` over more than 30 years).
31
43
  *
32
44
  * The chart reserves its height before the counts arrive: one bar track, or one track
33
- * per year when those years are already known from the data, a linked date range or the
34
- * table (`--uvalib-date-histogram-bar-size`, 8rem, plus the year-row gap). Filling the
35
- * bars in does not move the page. On a narrow screen a month row scrolls inside the
36
- * component; "Scroll sideways to see more." shows while it overflows. Years wrap.
45
+ * per year (per half-century for decades) when those years are already known from the
46
+ * data, a linked date range or the table (`--uvalib-date-histogram-bar-size`, 8rem, plus
47
+ * the row gap). Filling the bars in does not move the page. On a narrow screen a month row
48
+ * scrolls inside the component; "Scroll sideways to see more." shows while it overflows.
49
+ * Years wrap; a decade row fits 320px.
37
50
  *
38
51
  * @tagname uvalib-date-histogram
39
52
  * @slot - A `<table>` of dates and counts: two columns (date, count) or a year-by-month grid. Without JavaScript it is the fallback. With JavaScript it supplies the counts when `items` is empty. Show as table lists those counts, including odd dates; once `items` is set it lists `items` instead.
@@ -61,8 +74,12 @@ export declare class UvalibDateHistogram extends UvalibElement {
61
74
  static styles: import("lit").CSSResult[];
62
75
  /** Counts to draw. When non-empty, wins over the child table. Set a new array to update. */
63
76
  items: HistogramItem[];
64
- /** `month` (twelve bars per year) or `year`. Anything else is month, with one console warning. */
65
- granularity: 'year' | 'month';
77
+ /**
78
+ * `month` (twelve bars per year), `year`, `decade` (one bar per decade, five to a row), or
79
+ * `auto`: months when every count is a month within 3 years, years up to 30 years, else
80
+ * decades. Anything else is month, with one console warning.
81
+ */
82
+ granularity: 'year' | 'month' | 'decade' | 'auto';
66
83
  /** `log` scales bar height by log(count + 1). Anything else is linear. */
67
84
  scale: 'linear' | 'log';
68
85
  /**
@@ -94,6 +111,10 @@ export declare class UvalibDateHistogram extends UvalibElement {
94
111
  private ro?;
95
112
  private observed?;
96
113
  private partnerObserver?;
114
+ /** The date range's value when this element last read or wrote it, and which range that was. */
115
+ private lastSeen?;
116
+ private lastSeenEl?;
117
+ private drawnGrain?;
97
118
  constructor();
98
119
  protected createRenderRoot(): HTMLElement | DocumentFragment;
99
120
  connectedCallback(): void;
@@ -101,6 +122,10 @@ export declare class UvalibDateHistogram extends UvalibElement {
101
122
  protected willUpdate(changed: PropertyValues<this>): void;
102
123
  protected updated(changed: PropertyValues<this>): void;
103
124
  private get grain();
125
+ /** The strip is one bar per year, or per decade for `decade` (or `auto` over a long span). */
126
+ private get stripGrain();
127
+ /** Years from the linked date range's `min` to its `max`, or null. */
128
+ private partnerSpan;
104
129
  private get strip();
105
130
  private get log();
106
131
  private get labelText();
@@ -108,14 +133,27 @@ export declare class UvalibDateHistogram extends UvalibElement {
108
133
  private readTable;
109
134
  private findPartner;
110
135
  private bindPartner;
136
+ private unlisten;
137
+ /**
138
+ * On connect, or when the date range appears: the range's value wins when it holds a
139
+ * selection or changed while this element was away; otherwise `selected` is written to it.
140
+ */
141
+ private syncOnBind;
111
142
  /** While the named date range is not in the tree yet, take its value when it appears. */
112
143
  private watchForPartner;
113
144
  private partnerEnds;
114
145
  /** `[min, max]` is the date range's empty state (a cleared selection, or the host's initial value). */
115
146
  private isFullSpan;
116
- private applyPartnerValue;
147
+ /** The date range's value as it shows it: missing ends are `min` / `max`, both clamped to them. */
148
+ private partnerRange;
117
149
  private onPartner;
150
+ /** Show the date range's value. A `selected` that already spans it exactly is kept as written. */
118
151
  private pullPartner;
152
+ /**
153
+ * Write `selected` to the date range. A `selected` that is only the range's own value
154
+ * rounded to this chart's buckets is not written back (that would widen the range),
155
+ * unless `force` (a visitor chose that bar again to take the whole bucket).
156
+ */
119
157
  private pushPartner;
120
158
  private emit;
121
159
  private choose;
@@ -142,7 +180,8 @@ export declare class UvalibDateHistogram extends UvalibElement {
142
180
  private renderDisclosure;
143
181
  /** One bar track, or one per year when the span is already known, so late `items` do not shift the page. */
144
182
  private reserveStyle;
145
- private reservedYears;
183
+ /** Rows: one per year for months, one per half-century for decades. */
184
+ private reservedRows;
146
185
  private renderStrip;
147
186
  render(): TemplateResult;
148
187
  }