@uvalib/web-components 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +515 -47
- package/dist/base/url-param.d.ts +23 -0
- package/dist/base/url-param.js +49 -0
- package/dist/base/url-param.js.map +1 -0
- package/dist/base.css +289 -1
- package/dist/components/uvalib-card/UvalibCard.d.ts +19 -5
- package/dist/components/uvalib-card/UvalibCard.js +112 -9
- package/dist/components/uvalib-card/UvalibCard.js.map +1 -1
- package/dist/components/uvalib-chip-group/UvalibChipGroup.d.ts +156 -0
- package/dist/components/uvalib-chip-group/UvalibChipGroup.js +747 -0
- package/dist/components/uvalib-chip-group/UvalibChipGroup.js.map +1 -0
- package/dist/components/uvalib-chip-group/uvalib-chip-group.d.ts +1 -0
- package/dist/components/uvalib-chip-group/uvalib-chip-group.js +4 -0
- package/dist/components/uvalib-chip-group/uvalib-chip-group.js.map +1 -0
- package/dist/components/uvalib-date-histogram/UvalibDateHistogram.d.ts +148 -0
- package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js +1248 -0
- package/dist/components/uvalib-date-histogram/UvalibDateHistogram.js.map +1 -0
- package/dist/components/uvalib-date-histogram/uvalib-date-histogram.d.ts +1 -0
- package/dist/components/uvalib-date-histogram/uvalib-date-histogram.js +4 -0
- package/dist/components/uvalib-date-histogram/uvalib-date-histogram.js.map +1 -0
- package/dist/components/uvalib-lightbox/UvalibLightbox.js +8 -1
- package/dist/components/uvalib-lightbox/UvalibLightbox.js.map +1 -1
- package/dist/components/uvalib-lightbox/media.d.ts +1 -18
- package/dist/components/uvalib-lightbox/media.js +1 -42
- package/dist/components/uvalib-lightbox/media.js.map +1 -1
- package/dist/components/uvalib-pager/UvalibPager.d.ts +58 -4
- package/dist/components/uvalib-pager/UvalibPager.js +232 -8
- package/dist/components/uvalib-pager/UvalibPager.js.map +1 -1
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.d.ts +27 -1
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js +192 -26
- package/dist/components/uvalib-photo-grid/UvalibPhotoGrid.js.map +1 -1
- package/dist/components/uvalib-results-count/UvalibResultsCount.d.ts +62 -0
- package/dist/components/uvalib-results-count/UvalibResultsCount.js +208 -0
- package/dist/components/uvalib-results-count/UvalibResultsCount.js.map +1 -0
- package/dist/components/uvalib-results-count/uvalib-results-count.d.ts +1 -0
- package/dist/components/uvalib-results-count/uvalib-results-count.js +4 -0
- package/dist/components/uvalib-results-count/uvalib-results-count.js.map +1 -0
- package/dist/components/uvalib-tabs/UvalibTabs.d.ts +127 -0
- package/dist/components/uvalib-tabs/UvalibTabs.js +821 -0
- package/dist/components/uvalib-tabs/UvalibTabs.js.map +1 -0
- package/dist/components/uvalib-tabs/uvalib-tabs.d.ts +1 -0
- package/dist/components/uvalib-tabs/uvalib-tabs.js +4 -0
- package/dist/components/uvalib-tabs/uvalib-tabs.js.map +1 -0
- package/dist/components/uvalib-tag-list/UvalibTagList.d.ts +89 -0
- package/dist/components/uvalib-tag-list/UvalibTagList.js +411 -0
- package/dist/components/uvalib-tag-list/UvalibTagList.js.map +1 -0
- package/dist/components/uvalib-tag-list/uvalib-tag-list.d.ts +1 -0
- package/dist/components/uvalib-tag-list/uvalib-tag-list.js +4 -0
- package/dist/components/uvalib-tag-list/uvalib-tag-list.js.map +1 -0
- package/dist/custom-elements.json +7140 -2630
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/base.js +35 -1
- package/dist/styles/base.js.map +1 -1
- package/dist/styles/color-scheme.js +4 -0
- package/dist/styles/color-scheme.js.map +1 -1
- package/dist/styles/controls.js +2 -0
- package/dist/styles/controls.js.map +1 -1
- package/dist/styles/results.d.ts +1 -0
- package/dist/styles/results.js +257 -0
- package/dist/styles/results.js.map +1 -0
- package/dist/tokens.css +4 -0
- package/dist-cdn/base.css +289 -1
- package/dist-cdn/chunks/{base-CAFQWnZG.js → base-p5pk0vb2.js} +36 -2
- package/dist-cdn/chunks/{base-CAFQWnZG.js.map → base-p5pk0vb2.js.map} +1 -1
- package/dist-cdn/chunks/inline-copy-BANQSMIR.js +69 -0
- package/dist-cdn/chunks/inline-copy-BANQSMIR.js.map +1 -0
- package/dist-cdn/chunks/{site-header-C9V7Wuw2.js → site-header-BlOYvQg1.js} +5 -1
- package/dist-cdn/chunks/site-header-BlOYvQg1.js.map +1 -0
- package/dist-cdn/chunks/source-children-BHsDwCvL.js +53 -0
- package/dist-cdn/chunks/source-children-BHsDwCvL.js.map +1 -0
- package/dist-cdn/chunks/url-param-C1sk_F1d.js +28 -0
- package/dist-cdn/chunks/url-param-C1sk_F1d.js.map +1 -0
- package/dist-cdn/custom-elements.json +7140 -2630
- package/dist-cdn/manifest.json +7 -2
- package/dist-cdn/site-header.js +1 -1
- package/dist-cdn/site-page.js +2 -2
- package/dist-cdn/site-style.js +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +179 -19
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +220 -6
- package/dist-cdn/tokens.css +4 -0
- package/dist-cdn/uvalib-card.js +94 -20
- package/dist-cdn/uvalib-card.js.map +1 -1
- package/dist-cdn/uvalib-chip-group.js +496 -0
- package/dist-cdn/uvalib-chip-group.js.map +1 -0
- package/dist-cdn/uvalib-contents.js +2 -1
- package/dist-cdn/uvalib-contents.js.map +1 -1
- package/dist-cdn/uvalib-date-histogram.js +850 -0
- package/dist-cdn/uvalib-date-histogram.js.map +1 -0
- package/dist-cdn/uvalib-lightbox.js +26 -48
- package/dist-cdn/uvalib-lightbox.js.map +1 -1
- package/dist-cdn/uvalib-metadata.js +2 -1
- package/dist-cdn/uvalib-metadata.js.map +1 -1
- package/dist-cdn/uvalib-pager.js +141 -7
- package/dist-cdn/uvalib-pager.js.map +1 -1
- package/dist-cdn/uvalib-photo-grid.js +121 -19
- package/dist-cdn/uvalib-photo-grid.js.map +1 -1
- package/dist-cdn/uvalib-results-count.js +101 -0
- package/dist-cdn/uvalib-results-count.js.map +1 -0
- package/dist-cdn/uvalib-tabs.js +436 -0
- package/dist-cdn/uvalib-tabs.js.map +1 -0
- package/dist-cdn/uvalib-tag-list.js +267 -0
- package/dist-cdn/uvalib-tag-list.js.map +1 -0
- package/package.json +24 -3
- package/skills/uvalib-web-components/SKILL.md +179 -19
- package/skills/uvalib-web-components/reference/components.md +220 -6
- package/dist-cdn/chunks/site-header-C9V7Wuw2.js.map +0 -1
- package/dist-cdn/chunks/source-children-RuAec527.js +0 -119
- package/dist-cdn/chunks/source-children-RuAec527.js.map +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { UvalibElement } from '../../base/UvalibElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* Tabs, as on library.virginia.edu: a row of buttons over one visible panel.
|
|
4
|
+
*
|
|
5
|
+
* Each panel is a child with `data-tab="Events"` (and an `id` when the tab should be
|
|
6
|
+
* linkable). Or put `<button slot="tab">` elements first and one panel element after
|
|
7
|
+
* each; the button text is the label and those buttons are hidden, because the component
|
|
8
|
+
* draws the real tabs. The selected panel stays visible across the upgrade. With
|
|
9
|
+
* `base.css`, later `data-tab` panels stay hidden before the element upgrades, and
|
|
10
|
+
* space is reserved for the tab row so the first panel does not jump. The tab row
|
|
11
|
+
* wraps on a narrow screen.
|
|
12
|
+
*
|
|
13
|
+
* Arrow keys, Home and End move between tabs. Selection follows the arrow unless
|
|
14
|
+
* `activation="manual"`, in which case Enter or Space selects the focused tab. `selected`
|
|
15
|
+
* is the panel id (a label or a 0-based index also selects). It reflects the panel id.
|
|
16
|
+
* `url-param` writes that id into the query string, or into the hash when the page is a
|
|
17
|
+
* hash route (`#/stories?tab=events`). `url-param="hash"` uses the hash itself (`#events`)
|
|
18
|
+
* and leaves a hash route (`#/…`) alone.
|
|
19
|
+
*
|
|
20
|
+
* @tagname uvalib-tabs
|
|
21
|
+
* @slot - The panels. Each element with `data-tab` is a panel, or each element that is not a `slot="tab"` button.
|
|
22
|
+
* @slot tab - A `<button>` whose text labels the panel that follows. Hidden once the tabs are drawn.
|
|
23
|
+
* @fires change - The selected tab changed after the first render, including a script setting `selected` and the Back button. `detail` is `{ id, label, index }` (`id` is the panel id, `index` from 0). Not fired on the first render. Bubbles and is composed.
|
|
24
|
+
* @fires uvalib-analytics-event - For `<site-analytics>`: a click or arrow-key selection, `['uvalib-tabs', 'change', '<tab label>']`. The label is cut to 100 characters. Not fired on the first render, when `selected` is set from script, or when Back or the hash restores a tab.
|
|
25
|
+
* @cssprop --uva-color-button-bg - Dark-mode role token: unselected tab background (else `--uva-blue-alt-base`).
|
|
26
|
+
* @cssprop --uva-color-button-text - Text on an unselected tab (else #fff).
|
|
27
|
+
* @cssprop --uva-color-button-hover-bg - Dark-mode role token: unselected tab hover (else `--uva-blue-alt-dark`).
|
|
28
|
+
* @cssprop --uva-color-accent-bg - Dark-mode role token: selected tab background (else `--uva-brand-blue`).
|
|
29
|
+
* @cssprop --uva-color-on-accent - Selected tab text and the selected underline (else #fff).
|
|
30
|
+
* @cssprop --uva-color-focus - Dark-mode role token: focus outline (else `--uva-brand-orange`).
|
|
31
|
+
* @cssprop [--uva-blue-alt-base=#007BAC] - Unselected tab when `--uva-color-button-bg` is unset.
|
|
32
|
+
* @cssprop [--uva-blue-alt-dark=#005679] - Unselected hover when `--uva-color-button-hover-bg` is unset.
|
|
33
|
+
* @cssprop [--uva-brand-blue=#232D4B] - Selected tab when `--uva-color-accent-bg` is unset.
|
|
34
|
+
* @cssprop [--uva-brand-orange=#E57200] - Focus outline when `--uva-color-focus` is unset.
|
|
35
|
+
*/
|
|
36
|
+
export declare class UvalibTabs extends UvalibElement {
|
|
37
|
+
static styles: import("lit").CSSResult[];
|
|
38
|
+
/**
|
|
39
|
+
* The selected tab. A panel id, the tab label, or a 0-based index. Reflects the
|
|
40
|
+
* panel id once the tabs have been read. Empty selects the first tab.
|
|
41
|
+
*/
|
|
42
|
+
selected: string;
|
|
43
|
+
/**
|
|
44
|
+
* `manual`: arrow keys move focus and Enter or Space selects. Anything else,
|
|
45
|
+
* including empty, selects as the arrow moves.
|
|
46
|
+
*/
|
|
47
|
+
activation: string;
|
|
48
|
+
/**
|
|
49
|
+
* Name of the query parameter that stores the selected panel id, so the tab is
|
|
50
|
+
* linkable and Back restores it. `hash` stores it in the hash (`#panel-id`)
|
|
51
|
+
* instead. Empty does not touch the URL.
|
|
52
|
+
*/
|
|
53
|
+
urlParam: string;
|
|
54
|
+
/** Accessible name of the tab list. Empty uses “Tabs”. */
|
|
55
|
+
label: string;
|
|
56
|
+
private readonly uid;
|
|
57
|
+
private mount?;
|
|
58
|
+
private earlySlot?;
|
|
59
|
+
private readonly buttons;
|
|
60
|
+
/** Shadow-only tabpanels. Ids cannot point out of a shadow root, so the panel lives beside the tab. */
|
|
61
|
+
private readonly panelHosts;
|
|
62
|
+
private readonly boundLists;
|
|
63
|
+
private observer?;
|
|
64
|
+
private listening;
|
|
65
|
+
private booted;
|
|
66
|
+
private userAct;
|
|
67
|
+
private fromHistory;
|
|
68
|
+
private pendingFocus;
|
|
69
|
+
private cursor;
|
|
70
|
+
private lastKey;
|
|
71
|
+
/** `selected` as authored, before a URL param replaces it. Back to a URL with no param restores this. */
|
|
72
|
+
private initialSelected;
|
|
73
|
+
private view;
|
|
74
|
+
private viewIndex;
|
|
75
|
+
private warnedValue;
|
|
76
|
+
private warnedShape;
|
|
77
|
+
private get isLight();
|
|
78
|
+
private get manual();
|
|
79
|
+
private get listLabel();
|
|
80
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
disconnectedCallback(): void;
|
|
83
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve `selected` to a panel id before render. Setting it here does not
|
|
86
|
+
* schedule another update; setting it in `updated()` does, and warns.
|
|
87
|
+
*/
|
|
88
|
+
protected willUpdate(): void;
|
|
89
|
+
protected updated(): void;
|
|
90
|
+
private install;
|
|
91
|
+
/** Hide every panel except the selected one before the first paint. Never hides that one. */
|
|
92
|
+
private suppressUnselected;
|
|
93
|
+
private observe;
|
|
94
|
+
private readonly onMutations;
|
|
95
|
+
private insideChrome;
|
|
96
|
+
private listen;
|
|
97
|
+
private unlisten;
|
|
98
|
+
private readonly onHistory;
|
|
99
|
+
private readonly onClick;
|
|
100
|
+
private readonly onKeydown;
|
|
101
|
+
private childrenOf;
|
|
102
|
+
private collect;
|
|
103
|
+
private warnShape;
|
|
104
|
+
private warnValue;
|
|
105
|
+
/** Panel id, then label, then a 0-based index. `-1` when nothing matches. */
|
|
106
|
+
private indexFor;
|
|
107
|
+
private resolve;
|
|
108
|
+
private sync;
|
|
109
|
+
private ensureList;
|
|
110
|
+
private syncButtons;
|
|
111
|
+
/** The id of the element that is `role="tabpanel"`. In shadow that element is not the light child. */
|
|
112
|
+
private controlledId;
|
|
113
|
+
private syncPanels;
|
|
114
|
+
/**
|
|
115
|
+
* A shadow button cannot reference a light-DOM id. The tabpanel is a shadow
|
|
116
|
+
* element; the author's panel is slotted into it and hidden with it.
|
|
117
|
+
*/
|
|
118
|
+
private syncShadowPanels;
|
|
119
|
+
private markPanel;
|
|
120
|
+
private setAttr;
|
|
121
|
+
private focusPending;
|
|
122
|
+
private emit;
|
|
123
|
+
private page;
|
|
124
|
+
/** The id in the URL, or null when this component should not read one. */
|
|
125
|
+
private readUrl;
|
|
126
|
+
private writeUrl;
|
|
127
|
+
}
|