@uvalib/web-components 1.1.1 → 1.3.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 (252) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +1310 -80
  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/url-param.d.ts +23 -0
  17. package/dist/base/url-param.js +49 -0
  18. package/dist/base/url-param.js.map +1 -0
  19. package/dist/base.css +562 -2
  20. package/dist/base.d.ts +2 -0
  21. package/dist/base.js +1 -0
  22. package/dist/base.js.map +1 -1
  23. package/dist/components/site-analytics/SiteAnalytics.d.ts +20 -1
  24. package/dist/components/site-analytics/SiteAnalytics.js +93 -12
  25. package/dist/components/site-analytics/SiteAnalytics.js.map +1 -1
  26. package/dist/components/site-page/SitePage.d.ts +23 -0
  27. package/dist/components/site-page/SitePage.js +77 -0
  28. package/dist/components/site-page/SitePage.js.map +1 -1
  29. package/dist/components/uvalib-back-to-top/UvalibBackToTop.d.ts +58 -0
  30. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js +250 -0
  31. package/dist/components/uvalib-back-to-top/UvalibBackToTop.js.map +1 -0
  32. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.d.ts +1 -0
  33. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js +4 -0
  34. package/dist/components/uvalib-back-to-top/uvalib-back-to-top.js.map +1 -0
  35. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.d.ts +14 -0
  36. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js +56 -4
  37. package/dist/components/uvalib-breadcrumbs/UvalibBreadcrumbs.js.map +1 -1
  38. package/dist/components/uvalib-card/UvalibCard.d.ts +19 -5
  39. package/dist/components/uvalib-card/UvalibCard.js +112 -9
  40. package/dist/components/uvalib-card/UvalibCard.js.map +1 -1
  41. package/dist/components/uvalib-chip-group/UvalibChipGroup.d.ts +178 -0
  42. package/dist/components/uvalib-chip-group/UvalibChipGroup.js +817 -0
  43. package/dist/components/uvalib-chip-group/UvalibChipGroup.js.map +1 -0
  44. package/dist/components/uvalib-chip-group/uvalib-chip-group.d.ts +1 -0
  45. package/dist/components/uvalib-chip-group/uvalib-chip-group.js +4 -0
  46. package/dist/components/uvalib-chip-group/uvalib-chip-group.js.map +1 -0
  47. package/dist/components/uvalib-combobox/UvalibCombobox.d.ts +212 -0
  48. package/dist/components/uvalib-combobox/UvalibCombobox.js +1088 -0
  49. package/dist/components/uvalib-combobox/UvalibCombobox.js.map +1 -0
  50. package/dist/components/uvalib-combobox/uvalib-combobox.d.ts +1 -0
  51. package/dist/components/uvalib-combobox/uvalib-combobox.js +4 -0
  52. package/dist/components/uvalib-combobox/uvalib-combobox.js.map +1 -0
  53. package/dist/components/uvalib-contents/UvalibContents.d.ts +53 -0
  54. package/dist/components/uvalib-contents/UvalibContents.js +202 -3
  55. package/dist/components/uvalib-contents/UvalibContents.js.map +1 -1
  56. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.d.ts +187 -0
  57. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js +1452 -0
  58. package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js.map +1 -0
  59. package/dist/components/uvalib-date-histogram/uvalib-date-histogram.d.ts +1 -0
  60. package/dist/components/uvalib-date-histogram/uvalib-date-histogram.js +4 -0
  61. package/dist/components/uvalib-date-histogram/uvalib-date-histogram.js.map +1 -0
  62. package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +6 -0
  63. package/dist/components/uvalib-date-range/UvalibDateRange.js +23 -0
  64. package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -1
  65. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.d.ts +113 -0
  66. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js +589 -0
  67. package/dist/components/uvalib-filter-drawer/UvalibFilterDrawer.js.map +1 -0
  68. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.d.ts +1 -0
  69. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js +4 -0
  70. package/dist/components/uvalib-filter-drawer/uvalib-filter-drawer.js.map +1 -0
  71. package/dist/components/uvalib-image-regions/UvalibImageRegions.d.ts +130 -0
  72. package/dist/components/uvalib-image-regions/UvalibImageRegions.js +658 -0
  73. package/dist/components/uvalib-image-regions/UvalibImageRegions.js.map +1 -0
  74. package/dist/components/uvalib-image-regions/regions.d.ts +57 -0
  75. package/dist/components/uvalib-image-regions/regions.js +117 -0
  76. package/dist/components/uvalib-image-regions/regions.js.map +1 -0
  77. package/dist/components/uvalib-image-regions/uvalib-image-regions.d.ts +1 -0
  78. package/dist/components/uvalib-image-regions/uvalib-image-regions.js +4 -0
  79. package/dist/components/uvalib-image-regions/uvalib-image-regions.js.map +1 -0
  80. package/dist/components/uvalib-lightbox/UvalibLightbox.d.ts +40 -0
  81. package/dist/components/uvalib-lightbox/UvalibLightbox.js +152 -17
  82. package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -1
  83. package/dist/components/uvalib-lightbox/media.d.ts +1 -18
  84. package/dist/components/uvalib-lightbox/media.js +1 -42
  85. package/dist/components/uvalib-lightbox/media.js.map +1 -1
  86. package/dist/components/uvalib-map/UvalibMap.d.ts +182 -0
  87. package/dist/components/uvalib-map/UvalibMap.js +1001 -0
  88. package/dist/components/uvalib-map/UvalibMap.js.map +1 -0
  89. package/dist/components/uvalib-map/uvalib-map.d.ts +1 -0
  90. package/dist/components/uvalib-map/uvalib-map.js +4 -0
  91. package/dist/components/uvalib-map/uvalib-map.js.map +1 -0
  92. package/dist/components/uvalib-metadata/UvalibMetadata.d.ts +39 -2
  93. package/dist/components/uvalib-metadata/UvalibMetadata.js +214 -8
  94. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  95. package/dist/components/uvalib-pager/UvalibPager.d.ts +77 -4
  96. package/dist/components/uvalib-pager/UvalibPager.js +270 -8
  97. package/dist/components/uvalib-pager/UvalibPager.js.map +1 -1
  98. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.d.ts +27 -1
  99. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js +192 -26
  100. package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js.map +1 -1
  101. package/dist/components/uvalib-results-count/UvalibResultsCount.d.ts +62 -0
  102. package/dist/components/uvalib-results-count/UvalibResultsCount.js +208 -0
  103. package/dist/components/uvalib-results-count/UvalibResultsCount.js.map +1 -0
  104. package/dist/components/uvalib-results-count/uvalib-results-count.d.ts +1 -0
  105. package/dist/components/uvalib-results-count/uvalib-results-count.js +4 -0
  106. package/dist/components/uvalib-results-count/uvalib-results-count.js.map +1 -0
  107. package/dist/components/uvalib-tabs/UvalibTabs.d.ts +127 -0
  108. package/dist/components/uvalib-tabs/UvalibTabs.js +821 -0
  109. package/dist/components/uvalib-tabs/UvalibTabs.js.map +1 -0
  110. package/dist/components/uvalib-tabs/uvalib-tabs.d.ts +1 -0
  111. package/dist/components/uvalib-tabs/uvalib-tabs.js +4 -0
  112. package/dist/components/uvalib-tabs/uvalib-tabs.js.map +1 -0
  113. package/dist/components/uvalib-tag-list/UvalibTagList.d.ts +89 -0
  114. package/dist/components/uvalib-tag-list/UvalibTagList.js +411 -0
  115. package/dist/components/uvalib-tag-list/UvalibTagList.js.map +1 -0
  116. package/dist/components/uvalib-tag-list/uvalib-tag-list.d.ts +1 -0
  117. package/dist/components/uvalib-tag-list/uvalib-tag-list.js +4 -0
  118. package/dist/components/uvalib-tag-list/uvalib-tag-list.js.map +1 -0
  119. package/dist/custom-elements.json +14007 -3497
  120. package/dist/index.d.ts +16 -0
  121. package/dist/index.js +10 -0
  122. package/dist/index.js.map +1 -1
  123. package/dist/pagefind.css +4 -0
  124. package/dist/styles/base.js +154 -1
  125. package/dist/styles/base.js.map +1 -1
  126. package/dist/styles/color-scheme.js +9 -0
  127. package/dist/styles/color-scheme.js.map +1 -1
  128. package/dist/styles/controls.js +8 -0
  129. package/dist/styles/controls.js.map +1 -1
  130. package/dist/styles/hidden.d.ts +2 -0
  131. package/dist/styles/hidden.js +51 -0
  132. package/dist/styles/hidden.js.map +1 -0
  133. package/dist/styles/message.d.ts +1 -0
  134. package/dist/styles/message.js +82 -0
  135. package/dist/styles/message.js.map +1 -0
  136. package/dist/styles/pagefind.js +4 -0
  137. package/dist/styles/pagefind.js.map +1 -1
  138. package/dist/styles/result-list.d.ts +1 -0
  139. package/dist/styles/result-list.js +111 -0
  140. package/dist/styles/result-list.js.map +1 -0
  141. package/dist/styles/results.d.ts +1 -0
  142. package/dist/styles/results.js +242 -0
  143. package/dist/styles/results.js.map +1 -0
  144. package/dist/testing/index.d.ts +110 -0
  145. package/dist/testing/index.js +100 -0
  146. package/dist/testing/index.js.map +1 -0
  147. package/dist/testing/lighthouse-rules.d.ts +10 -0
  148. package/dist/testing/lighthouse-rules.js +44 -0
  149. package/dist/testing/lighthouse-rules.js.map +1 -0
  150. package/dist/tokens.css +9 -0
  151. package/dist-cdn/analytics.js +32 -0
  152. package/dist-cdn/analytics.js.map +1 -0
  153. package/dist-cdn/base.css +562 -2
  154. package/dist-cdn/bento-box.js +3 -3
  155. package/dist-cdn/chunks/{SiteAnalytics-Cm-FyhYS.js → SiteAnalytics-B9gu5aGO.js} +59 -30
  156. package/dist-cdn/chunks/SiteAnalytics-B9gu5aGO.js.map +1 -0
  157. package/dist-cdn/chunks/{UvalibElement-BnI-eRRR.js → UvalibElement-pGONDAwB.js} +108 -101
  158. package/dist-cdn/chunks/UvalibElement-pGONDAwB.js.map +1 -0
  159. package/dist-cdn/chunks/{accessible-GqhVn5_H.js → accessible-DJv7YOtS.js} +2 -2
  160. package/dist-cdn/chunks/{accessible-GqhVn5_H.js.map → accessible-DJv7YOtS.js.map} +1 -1
  161. package/dist-cdn/chunks/analytics-state-Ce8DKe4F.js.map +1 -1
  162. package/dist-cdn/chunks/base-BI8h0Gf3.js +281 -0
  163. package/dist-cdn/chunks/base-BI8h0Gf3.js.map +1 -0
  164. package/dist-cdn/chunks/inline-copy-BANQSMIR.js +69 -0
  165. package/dist-cdn/chunks/inline-copy-BANQSMIR.js.map +1 -0
  166. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js → library-weekly-hours-CrV3TlP5.js} +3 -3
  167. package/dist-cdn/chunks/{library-weekly-hours-COE7Vv6V.js.map → library-weekly-hours-CrV3TlP5.js.map} +1 -1
  168. package/dist-cdn/chunks/regions-B8ExwUGP.js +86 -0
  169. package/dist-cdn/chunks/regions-B8ExwUGP.js.map +1 -0
  170. package/dist-cdn/chunks/{repeat-CIFUYkyh.js → repeat-m5Zd_QeP.js} +2 -2
  171. package/dist-cdn/chunks/{repeat-CIFUYkyh.js.map → repeat-m5Zd_QeP.js.map} +1 -1
  172. package/dist-cdn/chunks/{site-header-C9V7Wuw2.js → site-header-DYRMpdBj.js} +13 -4
  173. package/dist-cdn/chunks/site-header-DYRMpdBj.js.map +1 -0
  174. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js → site-main-nav-DURrQMal.js} +3 -3
  175. package/dist-cdn/chunks/{site-main-nav-AaxZ9rQf.js.map → site-main-nav-DURrQMal.js.map} +1 -1
  176. package/dist-cdn/chunks/source-children-BHsDwCvL.js +53 -0
  177. package/dist-cdn/chunks/source-children-BHsDwCvL.js.map +1 -0
  178. package/dist-cdn/chunks/{static-html-1mTAG6nS.js → static-html-C1rhtCHu.js} +2 -2
  179. package/dist-cdn/chunks/{static-html-1mTAG6nS.js.map → static-html-C1rhtCHu.js.map} +1 -1
  180. package/dist-cdn/chunks/url-param-C1sk_F1d.js +28 -0
  181. package/dist-cdn/chunks/url-param-C1sk_F1d.js.map +1 -0
  182. package/dist-cdn/custom-elements.json +14007 -3497
  183. package/dist-cdn/events-section.js +3 -3
  184. package/dist-cdn/library-hours-setup.js +2 -2
  185. package/dist-cdn/library-weekly-hours.js +1 -1
  186. package/dist-cdn/manifest.json +15 -2
  187. package/dist-cdn/pagefind.css +4 -0
  188. package/dist-cdn/site-alerts.js +4 -4
  189. package/dist-cdn/site-analytics.js +2 -2
  190. package/dist-cdn/site-footer.js +2 -2
  191. package/dist-cdn/site-header.js +1 -1
  192. package/dist-cdn/site-hours-section.js +4 -4
  193. package/dist-cdn/site-main-nav.js +1 -1
  194. package/dist-cdn/site-page.js +56 -11
  195. package/dist-cdn/site-page.js.map +1 -1
  196. package/dist-cdn/site-style.js +2 -2
  197. package/dist-cdn/skills/uvalib-web-components/SKILL.md +269 -24
  198. package/dist-cdn/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  199. package/dist-cdn/skills/uvalib-web-components/reference/components.md +514 -13
  200. package/dist-cdn/skills/uvalib-web-components/reference/snippets.md +1 -1
  201. package/dist-cdn/tokens.css +9 -0
  202. package/dist-cdn/uvalib-analytics.js +2 -2
  203. package/dist-cdn/uvalib-back-to-top.js +156 -0
  204. package/dist-cdn/uvalib-back-to-top.js.map +1 -0
  205. package/dist-cdn/uvalib-breadcrumbs.js +31 -11
  206. package/dist-cdn/uvalib-breadcrumbs.js.map +1 -1
  207. package/dist-cdn/uvalib-card-grid.js +1 -1
  208. package/dist-cdn/uvalib-card.js +97 -23
  209. package/dist-cdn/uvalib-card.js.map +1 -1
  210. package/dist-cdn/uvalib-chip-group.js +535 -0
  211. package/dist-cdn/uvalib-chip-group.js.map +1 -0
  212. package/dist-cdn/uvalib-combobox.js +667 -0
  213. package/dist-cdn/uvalib-combobox.js.map +1 -0
  214. package/dist-cdn/uvalib-contents.js +102 -23
  215. package/dist-cdn/uvalib-contents.js.map +1 -1
  216. package/dist-cdn/uvalib-date-histogram.js +960 -0
  217. package/dist-cdn/uvalib-date-histogram.js.map +1 -0
  218. package/dist-cdn/uvalib-date-range.js +14 -2
  219. package/dist-cdn/uvalib-date-range.js.map +1 -1
  220. package/dist-cdn/uvalib-filter-drawer.js +355 -0
  221. package/dist-cdn/uvalib-filter-drawer.js.map +1 -0
  222. package/dist-cdn/uvalib-filter.js +3 -3
  223. package/dist-cdn/uvalib-image-regions.js +447 -0
  224. package/dist-cdn/uvalib-image-regions.js.map +1 -0
  225. package/dist-cdn/uvalib-lightbox.js +145 -78
  226. package/dist-cdn/uvalib-lightbox.js.map +1 -1
  227. package/dist-cdn/uvalib-map.js +471 -0
  228. package/dist-cdn/uvalib-map.js.map +1 -0
  229. package/dist-cdn/uvalib-metadata.js +152 -25
  230. package/dist-cdn/uvalib-metadata.js.map +1 -1
  231. package/dist-cdn/uvalib-pager.js +164 -18
  232. package/dist-cdn/uvalib-pager.js.map +1 -1
  233. package/dist-cdn/uvalib-photo-grid.js +123 -21
  234. package/dist-cdn/uvalib-photo-grid.js.map +1 -1
  235. package/dist-cdn/uvalib-results-count.js +101 -0
  236. package/dist-cdn/uvalib-results-count.js.map +1 -0
  237. package/dist-cdn/uvalib-tabs.js +436 -0
  238. package/dist-cdn/uvalib-tabs.js.map +1 -0
  239. package/dist-cdn/uvalib-tag-list.js +267 -0
  240. package/dist-cdn/uvalib-tag-list.js.map +1 -0
  241. package/package.json +66 -3
  242. package/skills/uvalib-web-components/SKILL.md +269 -24
  243. package/skills/uvalib-web-components/reference/accessibility-testing.md +34 -2
  244. package/skills/uvalib-web-components/reference/components.md +514 -13
  245. package/skills/uvalib-web-components/reference/snippets.md +1 -1
  246. package/dist-cdn/chunks/SiteAnalytics-Cm-FyhYS.js.map +0 -1
  247. package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js.map +0 -1
  248. package/dist-cdn/chunks/base-CAFQWnZG.js +0 -128
  249. package/dist-cdn/chunks/base-CAFQWnZG.js.map +0 -1
  250. package/dist-cdn/chunks/site-header-C9V7Wuw2.js.map +0 -1
  251. package/dist-cdn/chunks/source-children-RuAec527.js +0 -119
  252. package/dist-cdn/chunks/source-children-RuAec527.js.map +0 -1
@@ -0,0 +1,187 @@
1
+ import { type PropertyValues, type TemplateResult } from 'lit';
2
+ import { UvalibElement } from '../../base/UvalibElement.js';
3
+ /** One dated count. `date` is `YYYY`, `YYYY-MM`, or an odd value such as a day or "undated". */
4
+ export interface HistogramItem {
5
+ date: string;
6
+ count: number;
7
+ }
8
+ /**
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
+ * year from the first date to the last, including months with a count of zero. A year-only
13
+ * count in a month chart, a day, or any other date is a chip beside the chart.
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
+ *
25
+ * Each bar is a button named like "October 2015: 5,311 photos". Arrow keys move between
26
+ * bars; Enter or Space selects. `selected` is one bucket (`2015-10`, `2015`) or a range
27
+ * (`2015-03/2016-01`, also `..` or an en dash). The selection is `aria-pressed`, an inset
28
+ * ring and a stripe, not colour alone. Choosing a bar fires `select` with `{ from, to }`
29
+ * as ISO dates (a month runs from its first day to its last). Choosing the selected bar
30
+ * again clears it (`from` and `to` are empty strings).
31
+ *
32
+ * `range-for` is the id of a `<uvalib-date-range>`. A bar click sets that element's
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.
40
+ *
41
+ * `variant="strip"` is the small per-year row for a card: not interactive, `role="img"`,
42
+ * one bar per year, or per decade with `decade` (or `auto` over more than 30 years).
43
+ *
44
+ * The chart reserves its height before the counts arrive: one bar track, or one track
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.
50
+ *
51
+ * @tagname uvalib-date-histogram
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.
53
+ * @fires select - A bar or an odd-date chip was chosen, or the current one chosen again to clear it. `detail` is `{ from, to }` (ISO dates, or the odd token). Empty strings clear the selection. Not fired when `selected` is set in script or when a linked date range changes. Bubbles and is composed.
54
+ * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-date-histogram', 'select', '<from>–<to>']` when both ends are ISO dates, or `'other'` for any other choice. Not fired when the selection is cleared, set in script, or restored from a date range. Bubbles and is composed.
55
+ * @csspart chart - The bar chart (shadow mode).
56
+ * @csspart bar - A bar button, or a strip segment (shadow mode).
57
+ * @csspart table - The generated table in Show as table (shadow mode).
58
+ * @cssprop [--uvalib-date-histogram-bar-size=8rem] - Height of each bar track. The chart reserves one track, or one per known year, before the counts arrive.
59
+ * @cssprop [--uvalib-date-histogram-strip-size=1.5rem] - Height of `variant="strip"`.
60
+ * @cssprop [--uva-brand-blue=#232d4b] - Bar fill.
61
+ * @cssprop [--uva-brand-orange=#e57200] - Focus ring when `--uva-color-focus` is unset.
62
+ * @cssprop [--uva-font-family=inherit] - Font family.
63
+ * @cssprop --uva-color-accent-bg - Dark-mode role token: bar fill (else `--uva-brand-blue`).
64
+ * @cssprop --uva-color-on-accent - Dark-mode role token: the selection stripe (else #fff).
65
+ * @cssprop --uva-color-text - Dark-mode role token: labels and the selection ring (else #2b2b2b).
66
+ * @cssprop --uva-color-text-muted - Dark-mode role token: the scroll hint (else #4b5563).
67
+ * @cssprop --uva-color-track - Dark-mode role token: the empty part of a bar (else #e5e7eb).
68
+ * @cssprop --uva-color-surface - Dark-mode role token: the sticky year label (else #fff).
69
+ * @cssprop --uva-color-surface-raised - Dark-mode role token: odd-date chips (else #fff).
70
+ * @cssprop --uva-color-control-border - Dark-mode role token: bar, chip and table borders (else #808080).
71
+ * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).
72
+ */
73
+ export declare class UvalibDateHistogram extends UvalibElement {
74
+ static styles: import("lit").CSSResult[];
75
+ /** Counts to draw. When non-empty, wins over the child table. Set a new array to update. */
76
+ items: HistogramItem[];
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';
83
+ /** `log` scales bar height by log(count + 1). Anything else is linear. */
84
+ scale: 'linear' | 'log';
85
+ /**
86
+ * One bucket (`2015-10` or `2015`) or a range (`2015-03/2016-01`). A linked date range
87
+ * writes a range here. Empty when nothing is selected.
88
+ */
89
+ selected: string;
90
+ /** Id of a `<uvalib-date-range>` to keep in step with, both ways. */
91
+ rangeFor: string;
92
+ /** `strip`: a non-interactive per-year row (`role="img"`). Anything else is the bar chart. */
93
+ variant: string;
94
+ /** Word after the count in each bar's name. Plural; a count of one drops a trailing s. */
95
+ unit: string;
96
+ /** Accessible name of the bar group, and the start of the strip's summary. */
97
+ label: string;
98
+ private tableItems;
99
+ private authorTable;
100
+ private overflowing;
101
+ private activeKey;
102
+ private readonly uid;
103
+ private tableKey;
104
+ private warnedGrain;
105
+ private partner;
106
+ /** The next update came from the linked date range, so it must not write back. */
107
+ private echo;
108
+ private seen;
109
+ /** True while `choose()` assigns `selected`, so that click keeps the roving tab stop. */
110
+ private choosing;
111
+ private ro?;
112
+ private observed?;
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?;
118
+ constructor();
119
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
120
+ connectedCallback(): void;
121
+ disconnectedCallback(): void;
122
+ protected willUpdate(changed: PropertyValues<this>): void;
123
+ protected updated(changed: PropertyValues<this>): void;
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;
129
+ private get strip();
130
+ private get log();
131
+ private get labelText();
132
+ private get data();
133
+ private readTable;
134
+ private findPartner;
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;
142
+ /** While the named date range is not in the tree yet, take its value when it appears. */
143
+ private watchForPartner;
144
+ private partnerEnds;
145
+ /** `[min, max]` is the date range's empty state (a cleared selection, or the host's initial value). */
146
+ private isFullSpan;
147
+ /** The date range's value as it shows it: missing ends are `min` / `max`, both clamped to them. */
148
+ private partnerRange;
149
+ private onPartner;
150
+ /** Show the date range's value. A `selected` that already spans it exactly is kept as written. */
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
+ */
157
+ private pushPartner;
158
+ private emit;
159
+ private choose;
160
+ private onBarClick;
161
+ private onBarKeydown;
162
+ private flatKeys;
163
+ private focusBar;
164
+ private measureOverflow;
165
+ /**
166
+ * A lone odd token (a year chip on a month chart, a day, "undated", "c. 1910–1920")
167
+ * highlights only itself. A bucket at this grain, or a range of dates, highlights overlaps.
168
+ */
169
+ private selectionHighlights;
170
+ private overlaps;
171
+ private pressed;
172
+ /** An odd chip matches its own key, or an ISO day inside a multi-bucket range. */
173
+ private chipOn;
174
+ private focusKey;
175
+ private barTemplate;
176
+ private renderBars;
177
+ private renderOdds;
178
+ private generatedTable;
179
+ private oddsTable;
180
+ private renderDisclosure;
181
+ /** One bar track, or one per year when the span is already known, so late `items` do not shift the page. */
182
+ private reserveStyle;
183
+ /** Rows: one per year for months, one per half-century for decades. */
184
+ private reservedRows;
185
+ private renderStrip;
186
+ render(): TemplateResult;
187
+ }