@uvalib/web-components 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +172 -0
- package/README.md +1164 -2
- package/bin/install-skill.mjs +139 -0
- package/dist/base/UvalibElement.d.ts +21 -0
- package/dist/base/UvalibElement.js +68 -0
- package/dist/base/UvalibElement.js.map +1 -0
- package/dist/base/analytics.d.ts +44 -0
- package/dist/base/analytics.js +59 -0
- package/dist/base/analytics.js.map +1 -0
- package/dist/base/color-scheme.d.ts +93 -0
- package/dist/base/color-scheme.js +267 -0
- package/dist/base/color-scheme.js.map +1 -0
- package/dist/base/define.d.ts +2 -0
- package/dist/base/define.js +6 -0
- package/dist/base/define.js.map +1 -0
- package/dist/base/heading-level.d.ts +12 -0
- package/dist/base/heading-level.js +52 -0
- package/dist/base/heading-level.js.map +1 -0
- package/dist/base/light-dom-styles.d.ts +18 -0
- package/dist/base/light-dom-styles.js +134 -0
- package/dist/base/light-dom-styles.js.map +1 -0
- package/dist/base.css +30 -0
- package/dist/base.d.ts +5 -0
- package/dist/base.js +5 -0
- package/dist/base.js.map +1 -0
- package/dist/components/bento-box/ArticlesSection.d.ts +19 -0
- package/dist/components/bento-box/ArticlesSection.js +22 -0
- package/dist/components/bento-box/ArticlesSection.js.map +1 -0
- package/dist/components/bento-box/BentoBox.d.ts +85 -0
- package/dist/components/bento-box/BentoBox.js +366 -0
- package/dist/components/bento-box/BentoBox.js.map +1 -0
- package/dist/components/bento-box/BentoSection.d.ts +115 -0
- package/dist/components/bento-box/BentoSection.js +486 -0
- package/dist/components/bento-box/BentoSection.js.map +1 -0
- package/dist/components/bento-box/CatalogSection.d.ts +18 -0
- package/dist/components/bento-box/CatalogSection.js +19 -0
- package/dist/components/bento-box/CatalogSection.js.map +1 -0
- package/dist/components/bento-box/LibGuidesSection.d.ts +24 -0
- package/dist/components/bento-box/LibGuidesSection.js +73 -0
- package/dist/components/bento-box/LibGuidesSection.js.map +1 -0
- package/dist/components/bento-box/VirgoSection.d.ts +19 -0
- package/dist/components/bento-box/VirgoSection.js +58 -0
- package/dist/components/bento-box/VirgoSection.js.map +1 -0
- package/dist/components/bento-box/WebsiteSection.d.ts +25 -0
- package/dist/components/bento-box/WebsiteSection.js +40 -0
- package/dist/components/bento-box/WebsiteSection.js.map +1 -0
- package/dist/components/bento-box/bento-box.d.ts +1 -0
- package/dist/components/bento-box/bento-box.js +13 -0
- package/dist/components/bento-box/bento-box.js.map +1 -0
- package/dist/components/bento-box/bento-data.d.ts +147 -0
- package/dist/components/bento-box/bento-data.js +422 -0
- package/dist/components/bento-box/bento-data.js.map +1 -0
- package/dist/components/events-section/EventsSection.d.ts +91 -0
- package/dist/components/events-section/EventsSection.js +435 -0
- package/dist/components/events-section/EventsSection.js.map +1 -0
- package/dist/components/events-section/events-data.d.ts +90 -0
- package/dist/components/events-section/events-data.js +174 -0
- package/dist/components/events-section/events-data.js.map +1 -0
- package/dist/components/events-section/events-section.d.ts +1 -0
- package/dist/components/events-section/events-section.js +4 -0
- package/dist/components/events-section/events-section.js.map +1 -0
- package/dist/components/library-hours/hours-data.d.ts +104 -0
- package/dist/components/library-hours/hours-data.js +267 -0
- package/dist/components/library-hours/hours-data.js.map +1 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.d.ts +21 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.js +59 -0
- package/dist/components/library-hours-setup/LibraryHoursSetup.js.map +1 -0
- package/dist/components/library-hours-setup/library-hours-setup.d.ts +1 -0
- package/dist/components/library-hours-setup/library-hours-setup.js +5 -0
- package/dist/components/library-hours-setup/library-hours-setup.js.map +1 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.d.ts +107 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js +502 -0
- package/dist/components/library-weekly-hours/LibraryWeeklyHours.js.map +1 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.d.ts +1 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.js +4 -0
- package/dist/components/library-weekly-hours/library-weekly-hours.js.map +1 -0
- package/dist/components/link.d.ts +2 -0
- package/dist/components/link.js +7 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/site-analytics/SiteAnalytics.d.ts +44 -0
- package/dist/components/site-analytics/SiteAnalytics.js +161 -0
- package/dist/components/site-analytics/SiteAnalytics.js.map +1 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.d.ts +8 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.js +22 -0
- package/dist/components/site-analytics/SiteAnalyticsMixin.js.map +1 -0
- package/dist/components/site-analytics/site-analytics.d.ts +1 -0
- package/dist/components/site-analytics/site-analytics.js +4 -0
- package/dist/components/site-analytics/site-analytics.js.map +1 -0
- package/dist/components/site-footer/SiteFooter.d.ts +34 -0
- package/dist/components/site-footer/SiteFooter.js +275 -0
- package/dist/components/site-footer/SiteFooter.js.map +1 -0
- package/dist/components/site-footer/icons.d.ts +4 -0
- package/dist/components/site-footer/icons.js +7 -0
- package/dist/components/site-footer/icons.js.map +1 -0
- package/dist/components/site-footer/site-footer.d.ts +1 -0
- package/dist/components/site-footer/site-footer.js +4 -0
- package/dist/components/site-footer/site-footer.js.map +1 -0
- package/dist/components/site-header/SiteHeader.d.ts +154 -0
- package/dist/components/site-header/SiteHeader.js +845 -0
- package/dist/components/site-header/SiteHeader.js.map +1 -0
- package/dist/components/site-header/site-header.d.ts +1 -0
- package/dist/components/site-header/site-header.js +12 -0
- package/dist/components/site-header/site-header.js.map +1 -0
- package/dist/components/site-hours-section/SiteHoursSection.d.ts +63 -0
- package/dist/components/site-hours-section/SiteHoursSection.js +243 -0
- package/dist/components/site-hours-section/SiteHoursSection.js.map +1 -0
- package/dist/components/site-hours-section/site-hours-section.d.ts +1 -0
- package/dist/components/site-hours-section/site-hours-section.js +4 -0
- package/dist/components/site-hours-section/site-hours-section.js.map +1 -0
- package/dist/components/site-main-nav/SiteMainNav.d.ts +136 -0
- package/dist/components/site-main-nav/SiteMainNav.js +678 -0
- package/dist/components/site-main-nav/SiteMainNav.js.map +1 -0
- package/dist/components/site-main-nav/main-nav-data.d.ts +5 -0
- package/dist/components/site-main-nav/main-nav-data.js +90 -0
- package/dist/components/site-main-nav/main-nav-data.js.map +1 -0
- package/dist/components/site-main-nav/main-nav-items.d.ts +49 -0
- package/dist/components/site-main-nav/main-nav-items.js +138 -0
- package/dist/components/site-main-nav/main-nav-items.js.map +1 -0
- package/dist/components/site-main-nav/site-main-nav.d.ts +1 -0
- package/dist/components/site-main-nav/site-main-nav.js +4 -0
- package/dist/components/site-main-nav/site-main-nav.js.map +1 -0
- package/dist/components/site-page/SitePage.d.ts +145 -0
- package/dist/components/site-page/SitePage.js +480 -0
- package/dist/components/site-page/SitePage.js.map +1 -0
- package/dist/components/site-page/alerts.d.ts +24 -0
- package/dist/components/site-page/alerts.js +78 -0
- package/dist/components/site-page/alerts.js.map +1 -0
- package/dist/components/site-page/site-page.d.ts +1 -0
- package/dist/components/site-page/site-page.js +7 -0
- package/dist/components/site-page/site-page.js.map +1 -0
- package/dist/components/site-style/SiteStyle.d.ts +37 -0
- package/dist/components/site-style/SiteStyle.js +76 -0
- package/dist/components/site-style/SiteStyle.js.map +1 -0
- package/dist/components/site-style/site-style.d.ts +1 -0
- package/dist/components/site-style/site-style.js +4 -0
- package/dist/components/site-style/site-style.js.map +1 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.d.ts +10 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.js +11 -0
- package/dist/components/uvalib-analytics/UvalibAnalytics.js.map +1 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.d.ts +13 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.js +25 -0
- package/dist/components/uvalib-analytics/UvalibAnalyticsMixin.js.map +1 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.d.ts +1 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.js +4 -0
- package/dist/components/uvalib-analytics/uvalib-analytics.js.map +1 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.d.ts +46 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js +339 -0
- package/dist/components/uvalib-date-range/UvalibDateRange.js.map +1 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.d.ts +1 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.js +4 -0
- package/dist/components/uvalib-date-range/uvalib-date-range.js.map +1 -0
- package/dist/components/uvalib-filter/UvalibFilter.d.ts +73 -0
- package/dist/components/uvalib-filter/UvalibFilter.js +279 -0
- package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -0
- package/dist/components/uvalib-filter/uvalib-filter.d.ts +1 -0
- package/dist/components/uvalib-filter/uvalib-filter.js +4 -0
- package/dist/components/uvalib-filter/uvalib-filter.js.map +1 -0
- package/dist/custom-elements.json +15178 -0
- package/dist/data/fetch-json.d.ts +28 -0
- package/dist/data/fetch-json.js +43 -0
- package/dist/data/fetch-json.js.map +1 -0
- package/dist/data/new-york.d.ts +5 -0
- package/dist/data/new-york.js +23 -0
- package/dist/data/new-york.js.map +1 -0
- package/dist/data/sites.d.ts +12 -0
- package/dist/data/sites.js +89 -0
- package/dist/data/sites.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/accessible.d.ts +1 -0
- package/dist/styles/accessible.js +37 -0
- package/dist/styles/accessible.js.map +1 -0
- package/dist/styles/base.d.ts +2 -0
- package/dist/styles/base.js +41 -0
- package/dist/styles/base.js.map +1 -0
- package/dist/styles/color-scheme.d.ts +1 -0
- package/dist/styles/color-scheme.js +81 -0
- package/dist/styles/color-scheme.js.map +1 -0
- package/dist/styles/tokens.d.ts +1 -0
- package/dist/styles/tokens.js +85 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/styles/w3-subset.d.ts +1 -0
- package/dist/styles/w3-subset.js +33 -0
- package/dist/styles/w3-subset.js.map +1 -0
- package/dist/tokens.css +152 -0
- package/dist-cdn/base.css +30 -0
- package/dist-cdn/bento-box.js +1035 -0
- package/dist-cdn/bento-box.js.map +1 -0
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js +174 -0
- package/dist-cdn/chunks/SiteAnalytics-T1Wx3lsb.js.map +1 -0
- package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js +695 -0
- package/dist-cdn/chunks/UvalibElement-BnI-eRRR.js.map +1 -0
- package/dist-cdn/chunks/accessible-GqhVn5_H.js +40 -0
- package/dist-cdn/chunks/accessible-GqhVn5_H.js.map +1 -0
- package/dist-cdn/chunks/analytics-C8D8n_wt.js +55 -0
- package/dist-cdn/chunks/analytics-C8D8n_wt.js.map +1 -0
- package/dist-cdn/chunks/base-DCGd2Oii.js +117 -0
- package/dist-cdn/chunks/base-DCGd2Oii.js.map +1 -0
- package/dist-cdn/chunks/fetch-json-Cyqv-gLU.js +25 -0
- package/dist-cdn/chunks/fetch-json-Cyqv-gLU.js.map +1 -0
- package/dist-cdn/chunks/heading-level-DIuNS44-.js +31 -0
- package/dist-cdn/chunks/heading-level-DIuNS44-.js.map +1 -0
- package/dist-cdn/chunks/hours-data-Bw6vkIw7.js +181 -0
- package/dist-cdn/chunks/hours-data-Bw6vkIw7.js.map +1 -0
- package/dist-cdn/chunks/library-weekly-hours-ByQ8ugxh.js +346 -0
- package/dist-cdn/chunks/library-weekly-hours-ByQ8ugxh.js.map +1 -0
- package/dist-cdn/chunks/link-DbJSwj16.js +7 -0
- package/dist-cdn/chunks/link-DbJSwj16.js.map +1 -0
- package/dist-cdn/chunks/new-york-DkcnqvJ4.js +18 -0
- package/dist-cdn/chunks/new-york-DkcnqvJ4.js.map +1 -0
- package/dist-cdn/chunks/repeat-CIFUYkyh.js +101 -0
- package/dist-cdn/chunks/repeat-CIFUYkyh.js.map +1 -0
- package/dist-cdn/chunks/site-header-BwDkZ2LL.js +802 -0
- package/dist-cdn/chunks/site-header-BwDkZ2LL.js.map +1 -0
- package/dist-cdn/chunks/site-main-nav-BLAAunnr.js +605 -0
- package/dist-cdn/chunks/site-main-nav-BLAAunnr.js.map +1 -0
- package/dist-cdn/chunks/static-html-1mTAG6nS.js +22 -0
- package/dist-cdn/chunks/static-html-1mTAG6nS.js.map +1 -0
- package/dist-cdn/custom-elements.json +15178 -0
- package/dist-cdn/events-section.js +401 -0
- package/dist-cdn/events-section.js.map +1 -0
- package/dist-cdn/library-hours-setup.js +28 -0
- package/dist-cdn/library-hours-setup.js.map +1 -0
- package/dist-cdn/library-weekly-hours.js +1 -0
- package/dist-cdn/manifest.json +23 -0
- package/dist-cdn/site-analytics.js +6 -0
- package/dist-cdn/site-analytics.js.map +1 -0
- package/dist-cdn/site-footer.js +267 -0
- package/dist-cdn/site-footer.js.map +1 -0
- package/dist-cdn/site-header.js +1 -0
- package/dist-cdn/site-hours-section.js +145 -0
- package/dist-cdn/site-hours-section.js.map +1 -0
- package/dist-cdn/site-main-nav.js +1 -0
- package/dist-cdn/site-page.js +317 -0
- package/dist-cdn/site-page.js.map +1 -0
- package/dist-cdn/site-style.js +42 -0
- package/dist-cdn/site-style.js.map +1 -0
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +276 -0
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +631 -0
- package/dist-cdn/skills/uvalib-web-components/reference/migration.md +74 -0
- package/dist-cdn/skills/uvalib-web-components/reference/snippets.md +147 -0
- package/dist-cdn/tokens.css +152 -0
- package/dist-cdn/uvalib-analytics.js +6 -0
- package/dist-cdn/uvalib-analytics.js.map +1 -0
- package/dist-cdn/uvalib-date-range.js +262 -0
- package/dist-cdn/uvalib-date-range.js.map +1 -0
- package/dist-cdn/uvalib-filter.js +184 -0
- package/dist-cdn/uvalib-filter.js.map +1 -0
- package/package.json +152 -4
- package/skills/uvalib-web-components/SKILL.md +276 -0
- package/skills/uvalib-web-components/reference/components.md +631 -0
- package/skills/uvalib-web-components/reference/migration.md +74 -0
- package/skills/uvalib-web-components/reference/snippets.md +147 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** How a fetch is attempted: attempts, the delay between them (ms) and each attempt's timeout (ms). */
|
|
2
|
+
export interface FetchTiming {
|
|
3
|
+
retries: number;
|
|
4
|
+
retryDelay: number;
|
|
5
|
+
timeout: number;
|
|
6
|
+
}
|
|
7
|
+
/** A non-OK HTTP answer's error carries its `status` (a 401 refreshes a token, for example). */
|
|
8
|
+
export type HttpError = Error & {
|
|
9
|
+
status: number;
|
|
10
|
+
};
|
|
11
|
+
/** Request options: any `RequestInit` (method, headers, body, signal) plus retry control. */
|
|
12
|
+
export interface FetchOptions extends RequestInit {
|
|
13
|
+
/**
|
|
14
|
+
* Whether a non-OK answer with this status is tried again. Default: every status (as the
|
|
15
|
+
* hours and events data always did). A network error or timeout is always tried again.
|
|
16
|
+
*/
|
|
17
|
+
retryStatus?: (status: number) => boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch `url` and read the answer as JSON (or, with `text`, as text). Each attempt times out
|
|
21
|
+
* after `timing.timeout` ms; a failed, non-OK or timed-out attempt is retried after
|
|
22
|
+
* `timing.retryDelay` ms, `timing.retries` attempts in all (a non-OK status only when
|
|
23
|
+
* `retryStatus` allows it). Once `options.signal` aborts, no attempt follows and the call
|
|
24
|
+
* rejects with its reason. Otherwise rejects with the last attempt's error.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchJson(url: string, timing: FetchTiming, { retryStatus, signal, ...init }?: FetchOptions, text?: boolean): Promise<unknown>;
|
|
27
|
+
/** `fetchJson`, reading the answer as text. */
|
|
28
|
+
export declare const fetchText: (url: string, timing: FetchTiming, options?: FetchOptions) => Promise<string>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Shared fetching for the data-backed components (library hours, events, search results).
|
|
2
|
+
// Internal: not exported from the package entry. No side effects on import.
|
|
3
|
+
/**
|
|
4
|
+
* Fetch `url` and read the answer as JSON (or, with `text`, as text). Each attempt times out
|
|
5
|
+
* after `timing.timeout` ms; a failed, non-OK or timed-out attempt is retried after
|
|
6
|
+
* `timing.retryDelay` ms, `timing.retries` attempts in all (a non-OK status only when
|
|
7
|
+
* `retryStatus` allows it). Once `options.signal` aborts, no attempt follows and the call
|
|
8
|
+
* rejects with its reason. Otherwise rejects with the last attempt's error.
|
|
9
|
+
*/
|
|
10
|
+
export async function fetchJson(url, timing, { retryStatus, signal, ...init } = {}, text = false) {
|
|
11
|
+
let error;
|
|
12
|
+
const attempts = Math.max(1, timing.retries);
|
|
13
|
+
for (let i = 0; i < attempts; i++) {
|
|
14
|
+
if (i > 0)
|
|
15
|
+
await new Promise((r) => setTimeout(r, timing.retryDelay));
|
|
16
|
+
signal?.throwIfAborted();
|
|
17
|
+
try {
|
|
18
|
+
// A hung attempt times out and counts as a failed attempt.
|
|
19
|
+
const timeout = AbortSignal.timeout(timing.timeout);
|
|
20
|
+
const response = await fetch(url, {
|
|
21
|
+
...init,
|
|
22
|
+
signal: signal ? AbortSignal.any([signal, timeout]) : timeout,
|
|
23
|
+
});
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
error = Object.assign(new Error(`${response.status} ${response.statusText} for ${url}`), {
|
|
26
|
+
status: response.status,
|
|
27
|
+
});
|
|
28
|
+
if (retryStatus && !retryStatus(response.status))
|
|
29
|
+
break;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
return await (text ? response.text() : response.json());
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
signal?.throwIfAborted();
|
|
36
|
+
error = e;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
40
|
+
}
|
|
41
|
+
/** `fetchJson`, reading the answer as text. */
|
|
42
|
+
export const fetchText = (url, timing, options) => fetchJson(url, timing, options, true);
|
|
43
|
+
//# sourceMappingURL=fetch-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-json.js","sourceRoot":"","sources":["../../src/data/fetch-json.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,4EAA4E;AAqB5E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,MAAmB,EACnB,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,KAAmB,EAAE,EACnD,IAAI,GAAG,KAAK;IAEZ,IAAI,KAAc,CAAC;IACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QACtE,MAAM,EAAE,cAAc,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,2DAA2D;YAC3D,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;gBAChC,GAAG,IAAI;gBACP,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;aAC9D,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,QAAQ,GAAG,EAAE,CAAC,EAAE;oBACvF,MAAM,EAAE,QAAQ,CAAC,MAAM;iBACxB,CAAC,CAAC;gBACH,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAAE,MAAM;gBACxD,SAAS;YACX,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,EAAE,cAAc,EAAE,CAAC;YACzB,KAAK,GAAG,CAAC,CAAC;QACZ,CAAC;IACH,CAAC;IACD,MAAM,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,MAAmB,EAAE,OAAsB,EAAE,EAAE,CACpF,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TIME_ZONE = "America/New_York";
|
|
2
|
+
/** An en-US `Intl.DateTimeFormat` for `options`, created once per `key` and reused. */
|
|
3
|
+
export declare function formatter(key: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
4
|
+
/** The date in America/New_York at the instant `at` (ms; default now), as `YYYY-MM-DD`. */
|
|
5
|
+
export declare function todayInNewYork(at?: number): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Dates in the library's time zone, America/New_York, whatever the visitor's own zone.
|
|
2
|
+
// Internal: not exported from the package entry. No side effects on import.
|
|
3
|
+
export const TIME_ZONE = 'America/New_York';
|
|
4
|
+
const formatters = new Map();
|
|
5
|
+
/** An en-US `Intl.DateTimeFormat` for `options`, created once per `key` and reused. */
|
|
6
|
+
export function formatter(key, options) {
|
|
7
|
+
let f = formatters.get(key);
|
|
8
|
+
if (!f)
|
|
9
|
+
formatters.set(key, (f = new Intl.DateTimeFormat('en-US', options)));
|
|
10
|
+
return f;
|
|
11
|
+
}
|
|
12
|
+
/** The date in America/New_York at the instant `at` (ms; default now), as `YYYY-MM-DD`. */
|
|
13
|
+
export function todayInNewYork(at = Date.now()) {
|
|
14
|
+
const parts = formatter('today', {
|
|
15
|
+
timeZone: TIME_ZONE,
|
|
16
|
+
year: 'numeric',
|
|
17
|
+
month: '2-digit',
|
|
18
|
+
day: '2-digit',
|
|
19
|
+
}).formatToParts(at);
|
|
20
|
+
const get = (type) => parts.find((p) => p.type === type)?.value ?? '';
|
|
21
|
+
return `${get('year')}-${get('month')}-${get('day')}`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=new-york.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-york.js","sourceRoot":"","sources":["../../src/data/new-york.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,4EAA4E;AAE5E,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAE5C,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE1D,uFAAuF;AACvF,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,OAAmC;IACxE,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,CAAC;QAAE,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,CAAC;AACX,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,cAAc,CAAC,KAAa,IAAI,CAAC,GAAG,EAAE;IACpD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;KACf,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACrB,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IAC9E,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Site {
|
|
2
|
+
name: string;
|
|
3
|
+
/** Absent for sites that are listed but have no Matomo property. */
|
|
4
|
+
matomoSiteId?: number;
|
|
5
|
+
description?: string;
|
|
6
|
+
urls?: string[];
|
|
7
|
+
inactive?: boolean;
|
|
8
|
+
matomoDefault?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const sites: Site[];
|
|
11
|
+
/** Matomo site id for an href: first site whose url prefixes it, else the matomoDefault site's id. */
|
|
12
|
+
export declare function findMatomoId(href: string, list?: Site[]): number | undefined;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const sites = [
|
|
2
|
+
{
|
|
3
|
+
name: '100 Objects',
|
|
4
|
+
matomoSiteId: 31,
|
|
5
|
+
urls: ['https://100objects.lib.virginia.edu/'],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'Avalon',
|
|
9
|
+
matomoSiteId: 42,
|
|
10
|
+
urls: ['https://avalon.lib.virginia.edu/'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'Explore',
|
|
14
|
+
matomoSiteId: 2,
|
|
15
|
+
urls: ['https://explore.lib.virginia.edu/'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Faculty Newsletter',
|
|
19
|
+
matomoSiteId: 22,
|
|
20
|
+
inactive: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Library Cluster',
|
|
24
|
+
matomoSiteId: 3,
|
|
25
|
+
urls: ['https://jti.lib.virginia.edu/', 'https://etext.virginia.edu/'],
|
|
26
|
+
inactive: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Library Web Site',
|
|
30
|
+
matomoSiteId: 10,
|
|
31
|
+
urls: ['https://www.library.virginia.edu/', 'https://library.virginia.edu/'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Mobile',
|
|
35
|
+
matomoSiteId: 13,
|
|
36
|
+
inactive: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Research Guides',
|
|
40
|
+
matomoSiteId: 5,
|
|
41
|
+
urls: ['https://guides.lib.virginia.edu/'],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Staff newsletter',
|
|
45
|
+
matomoSiteId: 26,
|
|
46
|
+
inactive: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Tedium Reducer III',
|
|
50
|
+
matomoSiteId: 41,
|
|
51
|
+
urls: ['https://fillholdreader.internal.lib.virginia.edu/'],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Test UX',
|
|
55
|
+
matomoSiteId: 23,
|
|
56
|
+
description: 'Test Matomo Id for development/testing purposes',
|
|
57
|
+
matomoDefault: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'The Taper',
|
|
61
|
+
matomoSiteId: 25,
|
|
62
|
+
urls: ['https://thetaper.library.virginia.edu/'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Virgo',
|
|
66
|
+
matomoSiteId: 1,
|
|
67
|
+
urls: ['https://search.lib.virginia.edu/'],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Virgo Lite',
|
|
71
|
+
matomoSiteId: 40,
|
|
72
|
+
urls: ['https://search-kiosk.lib.virginia.edu/'],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Modern Library Bibliography',
|
|
76
|
+
urls: ['https://mlbib.library.virginia.edu/'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Board of Visitors Minutes',
|
|
80
|
+
urls: ['https://bov.library.virginia.edu/'],
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
/** Matomo site id for an href: first site whose url prefixes it, else the matomoDefault site's id. */
|
|
84
|
+
export function findMatomoId(href, list = sites) {
|
|
85
|
+
const matched = list.find((s) => s.urls?.some((u) => href.startsWith(u)));
|
|
86
|
+
const fallback = list.find((s) => s.matomoDefault === true);
|
|
87
|
+
return matched?.matomoSiteId || fallback?.matomoSiteId;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=sites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/data/sites.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,KAAK,GAAW;IAC3B;QACE,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,sCAAsC,CAAC;KAC/C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,kCAAkC,CAAC;KAC3C;IACD;QACE,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,CAAC;QACf,IAAI,EAAE,CAAC,mCAAmC,CAAC;KAC5C;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,YAAY,EAAE,CAAC;QACf,IAAI,EAAE,CAAC,+BAA+B,EAAE,6BAA6B,CAAC;QACtE,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,mCAAmC,EAAE,+BAA+B,CAAC;KAC7E;IACD;QACE,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,YAAY,EAAE,CAAC;QACf,IAAI,EAAE,CAAC,kCAAkC,CAAC;KAC3C;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,mDAAmD,CAAC;KAC5D;IACD;QACE,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,iDAAiD;QAC9D,aAAa,EAAE,IAAI;KACpB;IACD;QACE,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,wCAAwC,CAAC;KACjD;IACD;QACE,IAAI,EAAE,OAAO;QACb,YAAY,EAAE,CAAC;QACf,IAAI,EAAE,CAAC,kCAAkC,CAAC;KAC3C;IACD;QACE,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,CAAC,wCAAwC,CAAC;KACjD;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,CAAC,qCAAqC,CAAC;KAC9C;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,CAAC,mCAAmC,CAAC;KAC5C;CACF,CAAC;AAEF,sGAAsG;AACtG,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAe,KAAK;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC;IAC5D,OAAO,OAAO,EAAE,YAAY,IAAI,QAAQ,EAAE,YAAY,CAAC;AACzD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export * from './base.js';
|
|
2
|
+
export { SitePage, ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC, } from './components/site-page/SitePage.js';
|
|
3
|
+
export type { AlertsEnv } from './components/site-page/SitePage.js';
|
|
4
|
+
export { SiteHeader } from './components/site-header/SiteHeader.js';
|
|
5
|
+
export { SiteMainNav } from './components/site-main-nav/SiteMainNav.js';
|
|
6
|
+
export type { MainNavItem, MainNavLink } from './components/site-main-nav/SiteMainNav.js';
|
|
7
|
+
export { SiteFooter } from './components/site-footer/SiteFooter.js';
|
|
8
|
+
export { SiteAnalytics } from './components/site-analytics/SiteAnalytics.js';
|
|
9
|
+
export { SiteAnalyticsMixin } from './components/site-analytics/SiteAnalyticsMixin.js';
|
|
10
|
+
export type { ISiteAnalyticsMixin } from './components/site-analytics/SiteAnalyticsMixin.js';
|
|
11
|
+
export { UvalibAnalytics } from './components/uvalib-analytics/UvalibAnalytics.js';
|
|
12
|
+
export { UvalibAnalyticsMixin } from './components/uvalib-analytics/UvalibAnalyticsMixin.js';
|
|
13
|
+
export type { IUvalibAnalyticsMixin } from './components/uvalib-analytics/UvalibAnalyticsMixin.js';
|
|
14
|
+
export { SiteStyle } from './components/site-style/SiteStyle.js';
|
|
15
|
+
export { UvalibFilter } from './components/uvalib-filter/UvalibFilter.js';
|
|
16
|
+
export type { FilterBucket, FilterFacet, FilterScopeOption, } from './components/uvalib-filter/UvalibFilter.js';
|
|
17
|
+
export { UvalibDateRange } from './components/uvalib-date-range/UvalibDateRange.js';
|
|
18
|
+
export { SiteHoursSection } from './components/site-hours-section/SiteHoursSection.js';
|
|
19
|
+
export { LibraryWeeklyHours } from './components/library-weekly-hours/LibraryWeeklyHours.js';
|
|
20
|
+
export type { HoursState } from './components/library-weekly-hours/LibraryWeeklyHours.js';
|
|
21
|
+
export { LibraryHoursSetup } from './components/library-hours-setup/LibraryHoursSetup.js';
|
|
22
|
+
export type { LibraryInfo, DayHours } from './components/library-hours/hours-data.js';
|
|
23
|
+
export { EventsSection } from './components/events-section/EventsSection.js';
|
|
24
|
+
export type { EventsState } from './components/events-section/EventsSection.js';
|
|
25
|
+
export type { EventItem } from './components/events-section/events-data.js';
|
|
26
|
+
export { BentoBox } from './components/bento-box/BentoBox.js';
|
|
27
|
+
export type { BentoBoxName } from './components/bento-box/BentoBox.js';
|
|
28
|
+
export { CatalogSection } from './components/bento-box/CatalogSection.js';
|
|
29
|
+
export { ArticlesSection } from './components/bento-box/ArticlesSection.js';
|
|
30
|
+
export { LibGuidesSection } from './components/bento-box/LibGuidesSection.js';
|
|
31
|
+
export { WebsiteSection } from './components/bento-box/WebsiteSection.js';
|
|
32
|
+
export type { BentoState } from './components/bento-box/BentoSection.js';
|
|
33
|
+
export type { BentoEndpoints, GuideItem, VirgoItem, WebsiteItem, } from './components/bento-box/bento-data.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './base.js';
|
|
2
|
+
export { SitePage, ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC, } from './components/site-page/SitePage.js';
|
|
3
|
+
export { SiteHeader } from './components/site-header/SiteHeader.js';
|
|
4
|
+
export { SiteMainNav } from './components/site-main-nav/SiteMainNav.js';
|
|
5
|
+
export { SiteFooter } from './components/site-footer/SiteFooter.js';
|
|
6
|
+
export { SiteAnalytics } from './components/site-analytics/SiteAnalytics.js';
|
|
7
|
+
export { SiteAnalyticsMixin } from './components/site-analytics/SiteAnalyticsMixin.js';
|
|
8
|
+
export { UvalibAnalytics } from './components/uvalib-analytics/UvalibAnalytics.js';
|
|
9
|
+
export { UvalibAnalyticsMixin } from './components/uvalib-analytics/UvalibAnalyticsMixin.js';
|
|
10
|
+
export { SiteStyle } from './components/site-style/SiteStyle.js';
|
|
11
|
+
export { UvalibFilter } from './components/uvalib-filter/UvalibFilter.js';
|
|
12
|
+
export { UvalibDateRange } from './components/uvalib-date-range/UvalibDateRange.js';
|
|
13
|
+
export { SiteHoursSection } from './components/site-hours-section/SiteHoursSection.js';
|
|
14
|
+
export { LibraryWeeklyHours } from './components/library-weekly-hours/LibraryWeeklyHours.js';
|
|
15
|
+
export { LibraryHoursSetup } from './components/library-hours-setup/LibraryHoursSetup.js';
|
|
16
|
+
export { EventsSection } from './components/events-section/EventsSection.js';
|
|
17
|
+
export { BentoBox } from './components/bento-box/BentoBox.js';
|
|
18
|
+
export { CatalogSection } from './components/bento-box/CatalogSection.js';
|
|
19
|
+
export { ArticlesSection } from './components/bento-box/ArticlesSection.js';
|
|
20
|
+
export { LibGuidesSection } from './components/bento-box/LibGuidesSection.js';
|
|
21
|
+
export { WebsiteSection } from './components/bento-box/WebsiteSection.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAE7F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAM1E,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAG7E,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const accessible: import("lit").CSSResult;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const accessible = css `
|
|
3
|
+
.visually-hidden {
|
|
4
|
+
position: absolute;
|
|
5
|
+
width: 1px;
|
|
6
|
+
height: 1px;
|
|
7
|
+
margin: -1px;
|
|
8
|
+
padding: 0;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
clip: rect(0, 0, 0, 0);
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
border: 0;
|
|
13
|
+
}
|
|
14
|
+
.skip-link {
|
|
15
|
+
position: absolute;
|
|
16
|
+
left: 0;
|
|
17
|
+
top: 0;
|
|
18
|
+
z-index: 1000;
|
|
19
|
+
padding: 0.5em 1em;
|
|
20
|
+
background: var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));
|
|
21
|
+
color: var(--uva-color-on-accent, #fff);
|
|
22
|
+
transform: translateY(-120%);
|
|
23
|
+
}
|
|
24
|
+
.skip-link:focus-visible {
|
|
25
|
+
transform: translateY(0);
|
|
26
|
+
}
|
|
27
|
+
a:focus-visible,
|
|
28
|
+
button:focus-visible,
|
|
29
|
+
input:focus-visible,
|
|
30
|
+
select:focus-visible,
|
|
31
|
+
textarea:focus-visible,
|
|
32
|
+
[tabindex]:focus-visible {
|
|
33
|
+
outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));
|
|
34
|
+
outline-offset: 2px;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=accessible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessible.js","sourceRoot":"","sources":["../../src/styles/accessible.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC5B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const TYPEKIT_URL = 'https://use.typekit.net/oym8nvz.css';
|
|
3
|
+
// The body background has no fallback: without dark mode it stays transparent, as before.
|
|
4
|
+
//
|
|
5
|
+
// site-page:not(:defined) applies when base.css is linked in <head>, before the element
|
|
6
|
+
// upgrades: its own formatting context (flow-root), so a heading's top margin cannot collapse
|
|
7
|
+
// through to <body> and shift the page once the element upgrades, and invisible, so its
|
|
8
|
+
// content does not paint above where the header will go. If the script never loads, the
|
|
9
|
+
// content appears anyway after two seconds.
|
|
10
|
+
export const base = css `
|
|
11
|
+
*,
|
|
12
|
+
*::before,
|
|
13
|
+
*::after {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
html,
|
|
17
|
+
body {
|
|
18
|
+
font-family: var(--uva-font-family, franklin-gothic-urw, Arial, Helvetica, sans-serif);
|
|
19
|
+
}
|
|
20
|
+
html {
|
|
21
|
+
font-size: var(--uva-font-size-base, 17px);
|
|
22
|
+
}
|
|
23
|
+
body {
|
|
24
|
+
margin: 0;
|
|
25
|
+
line-height: 1.5;
|
|
26
|
+
min-height: 100vh;
|
|
27
|
+
color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));
|
|
28
|
+
background-color: var(--uva-color-surface);
|
|
29
|
+
}
|
|
30
|
+
site-page:not(:defined) {
|
|
31
|
+
display: flow-root;
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
animation: uvalib-site-page-reveal 0s 2s forwards;
|
|
34
|
+
}
|
|
35
|
+
@keyframes uvalib-site-page-reveal {
|
|
36
|
+
to {
|
|
37
|
+
visibility: visible;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/styles/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,qCAAqC,CAAC;AAEjE,0FAA0F;AAC1F,EAAE;AACF,wFAAwF;AACxF,8FAA8F;AAC9F,wFAAwF;AACxF,wFAAwF;AACxF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const colorScheme: import("lit").CSSResult;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
// Hand-written (not generated): the opt-in dark mode. Nothing here applies until the page's
|
|
3
|
+
// root element has `data-uva-color-scheme` (set by `color-scheme-switch` or the documented
|
|
4
|
+
// inline snippet), and only in browsers with light-dark(); everywhere else the role tokens are
|
|
5
|
+
// undefined and every component falls back to its palette token or hex value, exactly as
|
|
6
|
+
// before. The palette tokens in tokens.ts are untouched.
|
|
7
|
+
//
|
|
8
|
+
// Role tokens are light-dark() pairs; the light half reads the palette token, so a host's
|
|
9
|
+
// own `:root { --uva-brand-*: … }` still applies in light mode. They are resolved where they
|
|
10
|
+
// are used, against that element's `color-scheme`, which every component sets from
|
|
11
|
+
// `--uva-color-scheme` (default `light`). Tokens with no single light value (the decorative
|
|
12
|
+
// border, the alerts component's properties) are set in dark only.
|
|
13
|
+
/** Dark values for properties that have no one light value: each reader keeps its own. */
|
|
14
|
+
const darkOnly = `
|
|
15
|
+
--uva-color-border: #7a84a0;
|
|
16
|
+
--uvalib-alerts-text: #e8e8e8;
|
|
17
|
+
--uvalib-alerts-header-bg: #0e4a57;
|
|
18
|
+
--uvalib-alerts-alert1-bg: #4a1622;
|
|
19
|
+
--uvalib-alerts-alert1-border: #ef3f6b;
|
|
20
|
+
--uvalib-alerts-alert2-bg: #3d3510;
|
|
21
|
+
--uvalib-alerts-alert2-border: #ecc602;
|
|
22
|
+
--uvalib-alerts-alert3-bg: #0d3247;
|
|
23
|
+
--uvalib-alerts-alert3-border: #55c4ec;
|
|
24
|
+
--uvalib-alerts-regional-bg: #0f3a3d;
|
|
25
|
+
--uvalib-alerts-regional-border: 0.2em solid #25cad3;
|
|
26
|
+
`;
|
|
27
|
+
const dark = unsafeCSS(darkOnly);
|
|
28
|
+
/**
|
|
29
|
+
* Links in the pre-footer band are the site's own content: unstyled ones would keep the
|
|
30
|
+
* browser's dark link colours (#9e9eff is 3.37:1 on the band). White is 8.05:1, visited too.
|
|
31
|
+
* Layered like the rest of this sheet, so a site's own link colours still win.
|
|
32
|
+
*/
|
|
33
|
+
const preFooterLinks = 'color: var(--uva-color-pre-footer-text, #ffffff);';
|
|
34
|
+
export const colorScheme = css `
|
|
35
|
+
@supports (color: light-dark(#000, #fff)) {
|
|
36
|
+
:root[data-uva-color-scheme] {
|
|
37
|
+
--uva-color-surface: light-dark(#ffffff, #10172b);
|
|
38
|
+
--uva-color-surface-raised: light-dark(#ffffff, #232d4b);
|
|
39
|
+
--uva-color-surface-hover: light-dark(var(--uva-grey-100, #dadada), #2c3858);
|
|
40
|
+
--uva-color-text: light-dark(var(--uva-grey-darkest, #2b2b2b), #e8e8e8);
|
|
41
|
+
--uva-color-text-muted: light-dark(#4b5563, #adadad);
|
|
42
|
+
--uva-color-link: light-dark(var(--uva-brand-blue, #232d4b), #87b9d9);
|
|
43
|
+
--uva-color-utility-link: light-dark(var(--uva-blue-alt-dark, #005679), #91d8f2);
|
|
44
|
+
--uva-color-focus: light-dark(var(--uva-brand-orange, #e57200), #ffb370);
|
|
45
|
+
--uva-color-current: light-dark(var(--uva-brand-orange, #e57200), #e57200);
|
|
46
|
+
--uva-color-accent-bg: light-dark(var(--uva-brand-blue, #232d4b), #87b9d9);
|
|
47
|
+
--uva-color-on-accent: light-dark(#ffffff, #10172b);
|
|
48
|
+
--uva-color-control-border: light-dark(var(--uva-grey, #808080), #7a84a0);
|
|
49
|
+
--uva-color-input-text: light-dark(#1f2937, #e8e8e8);
|
|
50
|
+
--uva-color-track: light-dark(#e5e7eb, #2c3858);
|
|
51
|
+
--uva-color-shadow: light-dark(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
|
|
52
|
+
--uva-color-pre-footer-bg: light-dark(var(--uva-blue-alt-300, #bfe7f7), #005679);
|
|
53
|
+
--uva-color-pre-footer-text: light-dark(var(--uva-grey-darkest, #2b2b2b), #ffffff);
|
|
54
|
+
}
|
|
55
|
+
:root[data-uva-color-scheme='system'] {
|
|
56
|
+
color-scheme: light dark;
|
|
57
|
+
--uva-color-scheme: light dark;
|
|
58
|
+
}
|
|
59
|
+
:root[data-uva-color-scheme='light'] {
|
|
60
|
+
color-scheme: light;
|
|
61
|
+
--uva-color-scheme: light;
|
|
62
|
+
}
|
|
63
|
+
:root[data-uva-color-scheme='dark'] {
|
|
64
|
+
color-scheme: dark;
|
|
65
|
+
--uva-color-scheme: dark;
|
|
66
|
+
${dark}
|
|
67
|
+
}
|
|
68
|
+
:root[data-uva-color-scheme='dark'] [slot='pre-footer'] a {
|
|
69
|
+
${unsafeCSS(preFooterLinks)}
|
|
70
|
+
}
|
|
71
|
+
@media (prefers-color-scheme: dark) {
|
|
72
|
+
:root[data-uva-color-scheme='system'] {
|
|
73
|
+
${dark}
|
|
74
|
+
}
|
|
75
|
+
:root[data-uva-color-scheme='system'] [slot='pre-footer'] a {
|
|
76
|
+
${unsafeCSS(preFooterLinks)}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
//# sourceMappingURL=color-scheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-scheme.js","sourceRoot":"","sources":["../../src/styles/color-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,4FAA4F;AAC5F,2FAA2F;AAC3F,+FAA+F;AAC/F,yFAAyF;AACzF,yDAAyD;AACzD,EAAE;AACF,0FAA0F;AAC1F,6FAA6F;AAC7F,mFAAmF;AACnF,4FAA4F;AAC5F,mEAAmE;AAEnE,0FAA0F;AAC1F,MAAM,QAAQ,GAAG;;;;;;;;;;;;CAYhB,CAAC;AAEF,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEjC;;;;GAIG;AACH,MAAM,cAAc,GAAG,mDAAmD,CAAC;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgCtB,IAAI;;;QAGJ,SAAS,CAAC,cAAc,CAAC;;;;UAIvB,IAAI;;;UAGJ,SAAS,CAAC,cAAc,CAAC;;;;CAIlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tokens: import("lit").CSSResult;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// GENERATED by scripts/sync-tokens.mjs from ../monorepo/packages/drupal_library_theme/src/scss/base — do not edit
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
export const tokens = css `
|
|
4
|
+
:root {
|
|
5
|
+
--uva-brand-blue-lightest: #87B9D9;
|
|
6
|
+
--uva-brand-blue-lighter: #3395D4;
|
|
7
|
+
--uva-brand-blue-light: #0370B7;
|
|
8
|
+
--uva-brand-blue-base: #232D4B;
|
|
9
|
+
--uva-brand-blue-300: #87B9D9;
|
|
10
|
+
--uva-brand-blue-200: #3395D4;
|
|
11
|
+
--uva-brand-blue-100: #0370B7;
|
|
12
|
+
--uva-brand-blue: #232D4B;
|
|
13
|
+
--uva-brand-orange-lightest: #FFEAD6;
|
|
14
|
+
--uva-brand-orange-lighter: #FFC999;
|
|
15
|
+
--uva-brand-orange-light: #FFB370;
|
|
16
|
+
--uva-brand-orange-base: #E57200;
|
|
17
|
+
--uva-brand-orange-dark: #B35900;
|
|
18
|
+
--uva-brand-orange-darker: #854200;
|
|
19
|
+
--uva-brand-orange-300: #FFEAD6;
|
|
20
|
+
--uva-brand-orange-200: #FFC999;
|
|
21
|
+
--uva-brand-orange-100: #FFB370;
|
|
22
|
+
--uva-brand-orange: #E57200;
|
|
23
|
+
--uva-brand-orange-A: #B35900;
|
|
24
|
+
--uva-brand-orange-B: #854200;
|
|
25
|
+
--uva-blue-alt-lightest: #BFE7F7;
|
|
26
|
+
--uva-blue-alt-lighter: #91D8F2;
|
|
27
|
+
--uva-blue-alt-light: #55C4EC;
|
|
28
|
+
--uva-blue-alt-base: #007BAC;
|
|
29
|
+
--uva-blue-alt-dark: #005679;
|
|
30
|
+
--uva-blue-alt-darkest: #141E3C;
|
|
31
|
+
--uva-blue-alt-400: #e6f2f7;
|
|
32
|
+
--uva-blue-alt-300: #BFE7F7;
|
|
33
|
+
--uva-blue-alt-200: #91D8F2;
|
|
34
|
+
--uva-blue-alt-100: #55C4EC;
|
|
35
|
+
--uva-blue-alt: #007BAC;
|
|
36
|
+
--uva-blue-alt-A: #005679;
|
|
37
|
+
--uva-blue-alt-B: #141E3C;
|
|
38
|
+
--uva-teal-lightest: #C8F2F4;
|
|
39
|
+
--uva-teal-light: #5BD7DE;
|
|
40
|
+
--uva-teal-base: #25CAD3;
|
|
41
|
+
--uva-teal-dark: #1DA1A8;
|
|
42
|
+
--uva-teal-darker: #16777C;
|
|
43
|
+
--uva-teal-200: #C8F2F4;
|
|
44
|
+
--uva-teal-100: #5BD7DE;
|
|
45
|
+
--uva-teal: #25CAD3;
|
|
46
|
+
--uva-teal-A: #1DA1A8;
|
|
47
|
+
--uva-teal-B: #16777C;
|
|
48
|
+
--uva-green-lightest: #DDEFDC;
|
|
49
|
+
--uva-green-lighter: #89CC74;
|
|
50
|
+
--uva-green-base: #62BB46;
|
|
51
|
+
--uva-green-dark: #4E9737;
|
|
52
|
+
--uva-green-200: #DDEFDC;
|
|
53
|
+
--uva-green-100: #89CC74;
|
|
54
|
+
--uva-green: #62BB46;
|
|
55
|
+
--uva-green-A: #4E9737;
|
|
56
|
+
--uva-red-lightest: #FBCFDA;
|
|
57
|
+
--uva-red-base: #EF3F6B;
|
|
58
|
+
--uva-red-dark: #DF1E43;
|
|
59
|
+
--uva-red-darker: #B30000;
|
|
60
|
+
--uva-red-100: #FBCFDA;
|
|
61
|
+
--uva-red: #EF3F6B;
|
|
62
|
+
--uva-red-A: #DF1E43;
|
|
63
|
+
--uva-red-B: #B30000;
|
|
64
|
+
--uva-yellow-lightest: #FEF6C8;
|
|
65
|
+
--uva-yellow-base: #ECC602;
|
|
66
|
+
--uva-yellow-dark: #B99C02;
|
|
67
|
+
--uva-yellow-100: #FEF6C8;
|
|
68
|
+
--uva-yellow: #ECC602;
|
|
69
|
+
--uva-yellow-A: #B99C02;
|
|
70
|
+
--uva-grey-lightest: #F1F1F1;
|
|
71
|
+
--uva-grey-light: #DADADA;
|
|
72
|
+
--uva-grey-base: #808080;
|
|
73
|
+
--uva-grey-dark: #4F4F4F;
|
|
74
|
+
--uva-grey-darkest: #2B2B2B;
|
|
75
|
+
--uva-grey-200: #F1F1F1;
|
|
76
|
+
--uva-grey-100: #DADADA;
|
|
77
|
+
--uva-grey-50: #ADADAD;
|
|
78
|
+
--uva-grey: #808080;
|
|
79
|
+
--uva-grey-A: #4F4F4F;
|
|
80
|
+
--uva-grey-B: #2B2B2B;
|
|
81
|
+
--uva-font-family: franklin-gothic-urw, Arial, Helvetica, sans-serif;
|
|
82
|
+
--uva-font-size-base: 17px;
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/styles/tokens.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const w3Subset: import("lit").CSSResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
// Subset of w3.css (via monorepo packages/site-style/src/SiteStyleW3.ts): only the
|
|
3
|
+
// classes used by the header and footer templates.
|
|
4
|
+
export const w3Subset = css `
|
|
5
|
+
.w3-col {
|
|
6
|
+
float: left;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
.w3-container:after,
|
|
10
|
+
.w3-container:before,
|
|
11
|
+
.w3-row:after,
|
|
12
|
+
.w3-row:before,
|
|
13
|
+
.w3-row-padding:after,
|
|
14
|
+
.w3-row-padding:before,
|
|
15
|
+
.w3-clear:after,
|
|
16
|
+
.w3-clear:before {
|
|
17
|
+
content: '';
|
|
18
|
+
display: table;
|
|
19
|
+
clear: both;
|
|
20
|
+
}
|
|
21
|
+
.w3-container {
|
|
22
|
+
padding: 0.01em 16px;
|
|
23
|
+
}
|
|
24
|
+
.w3-row-padding,
|
|
25
|
+
.w3-row-padding > .w3-col {
|
|
26
|
+
padding: 0 8px;
|
|
27
|
+
}
|
|
28
|
+
.w3-mobile {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100% !important;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
//# sourceMappingURL=w3-subset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"w3-subset.js","sourceRoot":"","sources":["../../src/styles/w3-subset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,mFAAmF;AACnF,mDAAmD;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B1B,CAAC"}
|