@uvalib/web-components 1.8.5 → 1.10.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 (98) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +719 -72
  3. package/bin/install-skill.mjs +174 -54
  4. package/dist/base/clipboard.d.ts +9 -0
  5. package/dist/base/clipboard.js +30 -0
  6. package/dist/base/clipboard.js.map +1 -0
  7. package/dist/base.css +301 -3
  8. package/dist/components/uvalib-citation/UvalibCitation.d.ts +124 -0
  9. package/dist/components/uvalib-citation/UvalibCitation.js +545 -0
  10. package/dist/components/uvalib-citation/UvalibCitation.js.map +1 -0
  11. package/dist/components/uvalib-citation/uvalib-citation.d.ts +1 -0
  12. package/dist/components/uvalib-citation/uvalib-citation.js +4 -0
  13. package/dist/components/uvalib-citation/uvalib-citation.js.map +1 -0
  14. package/dist/components/uvalib-dialog/UvalibDialog.d.ts +167 -0
  15. package/dist/components/uvalib-dialog/UvalibDialog.js +688 -0
  16. package/dist/components/uvalib-dialog/UvalibDialog.js.map +1 -0
  17. package/dist/components/uvalib-dialog/uvalib-dialog.d.ts +1 -0
  18. package/dist/components/uvalib-dialog/uvalib-dialog.js +4 -0
  19. package/dist/components/uvalib-dialog/uvalib-dialog.js.map +1 -0
  20. package/dist/components/uvalib-filter/UvalibFilter.d.ts +92 -9
  21. package/dist/components/uvalib-filter/UvalibFilter.js +748 -60
  22. package/dist/components/uvalib-filter/UvalibFilter.js.map +1 -1
  23. package/dist/components/uvalib-list-filter/UvalibListFilter.d.ts +162 -0
  24. package/dist/components/uvalib-list-filter/UvalibListFilter.js +685 -0
  25. package/dist/components/uvalib-list-filter/UvalibListFilter.js.map +1 -0
  26. package/dist/components/uvalib-list-filter/uvalib-list-filter.d.ts +1 -0
  27. package/dist/components/uvalib-list-filter/uvalib-list-filter.js +4 -0
  28. package/dist/components/uvalib-list-filter/uvalib-list-filter.js.map +1 -0
  29. package/dist/components/uvalib-metadata/UvalibMetadata.js +3 -4
  30. package/dist/components/uvalib-metadata/UvalibMetadata.js.map +1 -1
  31. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.d.ts +28 -1
  32. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js +139 -3
  33. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js.map +1 -1
  34. package/dist/custom-elements.json +9503 -6086
  35. package/dist/edition.css +758 -0
  36. package/dist/index.d.ts +6 -0
  37. package/dist/index.js +3 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/styles/base.js +112 -1
  40. package/dist/styles/base.js.map +1 -1
  41. package/dist/styles/color-scheme.js +4 -0
  42. package/dist/styles/color-scheme.js.map +1 -1
  43. package/dist/styles/controls.js +6 -0
  44. package/dist/styles/controls.js.map +1 -1
  45. package/dist/styles/edition.d.ts +1 -0
  46. package/dist/styles/edition.js +747 -0
  47. package/dist/styles/edition.js.map +1 -0
  48. package/dist/styles/field-text.d.ts +1 -0
  49. package/dist/styles/field-text.js +21 -0
  50. package/dist/styles/field-text.js.map +1 -0
  51. package/dist/styles/hidden.js +15 -1
  52. package/dist/styles/hidden.js.map +1 -1
  53. package/dist/styles/layout.d.ts +1 -0
  54. package/dist/styles/layout.js +92 -0
  55. package/dist/styles/layout.js.map +1 -0
  56. package/dist/styles/table.d.ts +1 -0
  57. package/dist/styles/table.js +164 -0
  58. package/dist/styles/table.js.map +1 -0
  59. package/dist/tokens.css +4 -0
  60. package/dist-cdn/base.css +301 -3
  61. package/dist-cdn/chunks/{base-B3tNX103.js → base-DXkGlSgH.js} +113 -2
  62. package/dist-cdn/chunks/base-DXkGlSgH.js.map +1 -0
  63. package/dist-cdn/chunks/clipboard-CNG7Y_5X.js +18 -0
  64. package/dist-cdn/chunks/clipboard-CNG7Y_5X.js.map +1 -0
  65. package/dist-cdn/chunks/if-defined-COiQb-gl.js +6 -0
  66. package/dist-cdn/chunks/if-defined-COiQb-gl.js.map +1 -0
  67. package/dist-cdn/chunks/{site-header-CEmNtmk5.js → site-header-B78a_ldi.js} +27 -22
  68. package/dist-cdn/chunks/site-header-B78a_ldi.js.map +1 -0
  69. package/dist-cdn/chunks/{site-main-nav-CAwKq_x5.js → site-main-nav-CmMq2t8t.js} +52 -51
  70. package/dist-cdn/chunks/site-main-nav-CmMq2t8t.js.map +1 -0
  71. package/dist-cdn/custom-elements.json +9503 -6086
  72. package/dist-cdn/edition.css +758 -0
  73. package/dist-cdn/manifest.json +7 -3
  74. package/dist-cdn/site-header.js +1 -1
  75. package/dist-cdn/site-main-nav.js +1 -1
  76. package/dist-cdn/site-page.js +3 -3
  77. package/dist-cdn/site-style.js +1 -1
  78. package/dist-cdn/skills/uvalib-web-components/SKILL.md +34 -10
  79. package/dist-cdn/skills/uvalib-web-components/reference/components.md +188 -9
  80. package/dist-cdn/tokens.css +4 -0
  81. package/dist-cdn/uvalib-citation.js +382 -0
  82. package/dist-cdn/uvalib-citation.js.map +1 -0
  83. package/dist-cdn/uvalib-dialog.js +419 -0
  84. package/dist-cdn/uvalib-dialog.js.map +1 -0
  85. package/dist-cdn/uvalib-filter.js +603 -69
  86. package/dist-cdn/uvalib-filter.js.map +1 -1
  87. package/dist-cdn/uvalib-list-filter.js +451 -0
  88. package/dist-cdn/uvalib-list-filter.js.map +1 -0
  89. package/dist-cdn/uvalib-metadata.js +49 -49
  90. package/dist-cdn/uvalib-metadata.js.map +1 -1
  91. package/dist-cdn/uvalib-pagefind-search.js +118 -48
  92. package/dist-cdn/uvalib-pagefind-search.js.map +1 -1
  93. package/package.json +14 -1
  94. package/skills/uvalib-web-components/SKILL.md +34 -10
  95. package/skills/uvalib-web-components/reference/components.md +188 -9
  96. package/dist-cdn/chunks/base-B3tNX103.js.map +0 -1
  97. package/dist-cdn/chunks/site-header-CEmNtmk5.js.map +0 -1
  98. package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +0 -1
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
- // Usage: npx @uvalib/web-components install-skill [--dir .claude/skills] [--force]
3
- // npx @uvalib/web-components install-skill --check [--dir .claude/skills] [--strict]
2
+ // Usage: npx @uvalib/web-components install-skill [--global] [--agent <names>] [--dir <dir>] [--force]
3
+ // npx @uvalib/web-components install-skill --check [--global] [--agent <names>] [--dir <dir>] [--strict]
4
+ // npx @uvalib/web-components install-skill --list [--global] [--agent <names>]
4
5
  import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
5
- import { dirname, join, resolve } from 'node:path';
6
+ import { homedir } from 'node:os';
7
+ import { dirname, join, relative, resolve } from 'node:path';
6
8
  import { fileURLToPath } from 'node:url';
7
9
 
8
10
  const PACKAGE = '@uvalib/web-components';
@@ -10,16 +12,50 @@ const SKILL = 'uvalib-web-components';
10
12
  /** Written next to SKILL.md in every installed copy. */
11
13
  const STAMP = 'installed.json';
12
14
 
13
- const usage = `Usage: npx ${PACKAGE} install-skill [--dir <skills-dir>] [--force]
14
- npx ${PACKAGE} install-skill --check [--dir <skills-dir>] [--strict]
15
+ /**
16
+ * Where each agent looks for skills (the Agent Skills format, a folder with a SKILL.md):
17
+ * `project` relative to the current folder, `global` relative to the home folder. `agents` is
18
+ * the shared `.agents/skills` folder of the open standard, read by Codex, Gemini CLI, GitHub
19
+ * Copilot, Cursor, Grok and others; the rest are each tool's own folder, for tools or versions
20
+ * that do not read the shared one.
21
+ */
22
+ const AGENTS = {
23
+ agents: {
24
+ project: '.agents/skills',
25
+ global: '.agents/skills',
26
+ reads: 'Codex, Gemini CLI, GitHub Copilot, Cursor, Grok and other Agent Skills tools',
27
+ },
28
+ claude: { project: '.claude/skills', global: '.claude/skills', reads: 'Claude Code' },
29
+ codex: { project: '.agents/skills', global: '.agents/skills', reads: 'OpenAI Codex' },
30
+ gemini: { project: '.gemini/skills', global: '.gemini/skills', reads: 'Gemini CLI' },
31
+ copilot: { project: '.github/skills', global: '.copilot/skills', reads: 'GitHub Copilot' },
32
+ cursor: { project: '.cursor/skills', global: '.cursor/skills', reads: 'Cursor' },
33
+ grok: { project: '.agents/skills', global: '.grok/skills', reads: 'Grok' },
34
+ };
35
+ /** Claude Code reads only its own folder; everything else reads the shared one. */
36
+ const DEFAULT_AGENTS = ['claude', 'agents'];
15
37
 
16
- Copies the ${SKILL} agent skill into <skills-dir>/${SKILL}
17
- (default: .claude/skills) and records the package version in ${STAMP}.
18
- Refuses to overwrite an existing copy without --force.
38
+ const usage = `Usage: npx ${PACKAGE} install-skill [--global] [--agent <names>] [--dir <dir>] [--force]
39
+ npx ${PACKAGE} install-skill --check [--global] [--agent <names>] [--dir <dir>] [--strict]
40
+ npx ${PACKAGE} install-skill --list [--global] [--agent <names>]
19
41
 
20
- --check compares an installed copy with the latest release on npm. It prints one
21
- line, with the update command, only when the copy is missing or out of date, and
22
- exits 0 (so it can run as a Claude Code SessionStart hook); --strict exits 1
42
+ Copies the ${SKILL} agent skill (an Agent Skills folder with SKILL.md) into
43
+ <skills-dir>/${SKILL} for each agent, and records the package version in ${STAMP}.
44
+
45
+ (default) this project: .claude/skills (Claude Code) and .agents/skills
46
+ (Codex, Gemini CLI, GitHub Copilot, Cursor, Grok and other tools
47
+ that read the shared Agent Skills folder)
48
+ --global, -g your home folder instead (~/.claude/skills and ~/.agents/skills),
49
+ for every project on this computer
50
+ --agent <names> comma-separated: ${Object.keys(AGENTS).join(', ')}, or all
51
+ (each tool's own folder; see --list)
52
+ --dir <dir> one skills folder of your choosing instead (overrides the above)
53
+ --force overwrite existing copies (an update)
54
+ --list print the folders it would use, and exit
55
+
56
+ --check compares the installed copies with the latest release on npm. It prints one
57
+ line per copy, with the update command, only when a copy is missing or out of date,
58
+ and exits 0 (so it can run from an agent's session-start hook); --strict exits 1
23
59
  instead. A network failure only warns.`;
24
60
 
25
61
  const args = process.argv.slice(2);
@@ -28,43 +64,116 @@ if (args[0] !== 'install-skill') {
28
64
  process.exit(args[0] === '--help' || args[0] === '-h' ? 0 : 1);
29
65
  }
30
66
 
31
- let dir = '.claude/skills';
67
+ let dir = null;
32
68
  let force = false;
33
69
  let check = false;
34
70
  let strict = false;
71
+ let list = false;
72
+ let global = false;
73
+ let agentNames = null;
35
74
  for (let i = 1; i < args.length; i++) {
36
- if (args[i] === '--force') force = true;
37
- else if (args[i] === '--check') check = true;
38
- else if (args[i] === '--strict') strict = true;
39
- else if (args[i] === '--dir' && args[i + 1]) dir = args[++i];
40
- else {
41
- console.error(usage);
42
- process.exit(1);
43
- }
75
+ const a = args[i];
76
+ if (a === '--force') force = true;
77
+ else if (a === '--check') check = true;
78
+ else if (a === '--strict') strict = true;
79
+ else if (a === '--list') list = true;
80
+ else if (a === '--global' || a === '-g') global = true;
81
+ else if (a === '--dir' && args[i + 1]) dir = args[++i];
82
+ else if (a === '--agent' && args[i + 1]) agentNames = args[++i];
83
+ else if (a.startsWith('--agent=')) agentNames = a.slice('--agent='.length);
84
+ else if (a.startsWith('--dir=')) dir = a.slice('--dir='.length);
85
+ else if (a === '--help' || a === '-h') {
86
+ console.log(usage);
87
+ process.exit(0);
88
+ } else fail(`Unknown option: ${a}`);
89
+ }
90
+ if (dir !== null && (agentNames !== null || global)) {
91
+ fail('--dir names one folder; use it without --agent or --global.');
44
92
  }
45
93
 
94
+ /** Every folder to use: `{ dir, shown, reads }`, one per distinct path. */
95
+ const targets = resolveTargets();
46
96
  const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
47
97
  const version = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8')).version;
48
- const dest = join(resolve(dir), SKILL);
49
- const updateCommand = `npx ${PACKAGE}@latest install-skill --dir ${dir} --force`;
98
+ const updateCommand = `npx ${PACKAGE}@latest install-skill${optionsText()} --force`;
50
99
 
100
+ if (list) {
101
+ for (const t of targets) console.log(`${join(t.shown, SKILL)} (${t.reads})`);
102
+ process.exit(0);
103
+ }
51
104
  if (check) await runCheck();
52
105
  else install();
53
106
 
107
+ function fail(message) {
108
+ console.error(`${message}\n\n${usage}`);
109
+ process.exit(1);
110
+ }
111
+
112
+ function resolveTargets() {
113
+ if (dir !== null) return [{ dir: resolve(dir), shown: dir, reads: 'the folder you named' }];
114
+ let names = DEFAULT_AGENTS;
115
+ if (agentNames !== null) {
116
+ names = agentNames
117
+ .split(',')
118
+ .map((n) => n.trim().toLowerCase())
119
+ .filter(Boolean);
120
+ if (names.includes('all')) names = Object.keys(AGENTS);
121
+ const unknown = names.filter((n) => !AGENTS[n]);
122
+ if (unknown.length || !names.length) {
123
+ fail(
124
+ `Unknown agent: ${unknown.join(', ') || '(none)'}. Known: ${Object.keys(AGENTS).join(', ')}, all.`,
125
+ );
126
+ }
127
+ }
128
+ const byPath = new Map();
129
+ for (const name of names) {
130
+ const sub = AGENTS[name][global ? 'global' : 'project'];
131
+ const abs = global ? join(homedir(), sub) : resolve(sub);
132
+ const shown = global ? join('~', sub) : sub;
133
+ const entry = byPath.get(abs);
134
+ if (entry) entry.readers.push(AGENTS[name].reads);
135
+ else byPath.set(abs, { dir: abs, shown, readers: [AGENTS[name].reads] });
136
+ }
137
+ return [...byPath.values()].map(({ dir, shown, readers }) => ({
138
+ dir,
139
+ shown,
140
+ // The shared folder's own description already names the tools that read it.
141
+ reads: readers.includes(AGENTS.agents.reads)
142
+ ? AGENTS.agents.reads
143
+ : [...new Set(readers)].join(', '),
144
+ }));
145
+ }
146
+
147
+ /** The options that chose the folders, to repeat in the update command. */
148
+ function optionsText() {
149
+ if (dir !== null) return ` --dir ${dir}`;
150
+ return `${global ? ' --global' : ''}${agentNames !== null ? ` --agent ${agentNames}` : ''}`;
151
+ }
152
+
54
153
  function install() {
55
154
  const src = join(pkgRoot, 'skills', SKILL);
56
- if (existsSync(dest)) {
57
- if (!force) {
58
- console.error(`${dest} already exists; pass --force to overwrite.`);
59
- process.exit(1);
60
- }
155
+ const existing = targets.filter((t) => existsSync(join(t.dir, SKILL)));
156
+ if (existing.length && !force) {
157
+ for (const t of existing) console.error(`${join(t.dir, SKILL)} already exists.`);
158
+ console.error('Pass --force to overwrite (nothing was changed).');
159
+ process.exit(1);
160
+ }
161
+ for (const t of targets) {
162
+ const dest = join(t.dir, SKILL);
61
163
  rmSync(dest, { recursive: true, force: true });
164
+ mkdirSync(t.dir, { recursive: true });
165
+ cpSync(src, dest, { recursive: true });
166
+ const stamp = { package: PACKAGE, version, installedAt: new Date().toISOString() };
167
+ writeFileSync(join(dest, STAMP), JSON.stringify(stamp, null, 2) + '\n');
168
+ console.log(`Installed ${SKILL} skill ${version} to ${shownPath(dest)} (${t.reads})`);
62
169
  }
63
- mkdirSync(dirname(dest), { recursive: true });
64
- cpSync(src, dest, { recursive: true });
65
- const stamp = { package: PACKAGE, version, installedAt: new Date().toISOString() };
66
- writeFileSync(join(dest, STAMP), JSON.stringify(stamp, null, 2) + '\n');
67
- console.log(`Installed ${SKILL} skill ${version} to ${dest}`);
170
+ }
171
+
172
+ /** A path as the user would type it: relative to here, or from ~. */
173
+ function shownPath(p) {
174
+ const home = homedir();
175
+ if (p === home || p.startsWith(home + '/')) return join('~', relative(home, p));
176
+ return relative(process.cwd(), p) || '.';
68
177
  }
69
178
 
70
179
  /** -1, 0 or 1 for x.y.z versions (a pre-release sorts before its release). */
@@ -110,30 +219,41 @@ async function latestVersion() {
110
219
  }
111
220
 
112
221
  async function runCheck() {
113
- const report = (message) => {
114
- console.log(message);
115
- process.exit(strict ? 1 : 0);
116
- };
117
- if (!existsSync(join(dest, 'SKILL.md'))) {
118
- report(`The ${SKILL} agent skill is not installed in ${dir}. Install it: ${updateCommand}`);
119
- }
120
- let installed = null;
121
- try {
122
- installed = JSON.parse(readFileSync(join(dest, STAMP), 'utf8')).version ?? null;
123
- } catch {
124
- // Copies installed before version stamps existed have none.
222
+ const messages = [];
223
+ const stamped = [];
224
+ for (const t of targets) {
225
+ const dest = join(t.dir, SKILL);
226
+ if (!existsSync(join(dest, 'SKILL.md'))) {
227
+ messages.push(
228
+ `The ${SKILL} agent skill is not installed in ${t.shown}. Install it: ${updateCommand}`,
229
+ );
230
+ continue;
231
+ }
232
+ let installed = null;
233
+ try {
234
+ installed = JSON.parse(readFileSync(join(dest, STAMP), 'utf8')).version ?? null;
235
+ } catch {
236
+ // Copies installed before version stamps existed have none.
237
+ }
238
+ stamped.push({ t, installed });
125
239
  }
126
- const latest = await latestVersion();
127
- if (!latest) process.exit(0);
128
- if (!installed) {
129
- report(
130
- `The ${SKILL} agent skill in ${dir} has no version stamp (it predates ${STAMP}); the latest is ${latest}. Update it: ${updateCommand}`,
131
- );
240
+ const latest = stamped.length ? await latestVersion() : null;
241
+ if (latest) {
242
+ for (const { t, installed } of stamped) {
243
+ if (!installed) {
244
+ messages.push(
245
+ `The ${SKILL} agent skill in ${t.shown} has no version stamp (it predates ${STAMP}); the latest is ${latest}. Update it: ${updateCommand}`,
246
+ );
247
+ } else if (compare(installed, latest) < 0) {
248
+ messages.push(
249
+ `The ${SKILL} agent skill in ${t.shown} is ${installed}; ${latest} is available. Update it: ${updateCommand}`,
250
+ );
251
+ }
252
+ }
132
253
  }
133
- if (compare(installed, latest) < 0) {
134
- report(
135
- `The ${SKILL} agent skill in ${dir} is ${installed}; ${latest} is available. Update it: ${updateCommand}`,
136
- );
254
+ if (messages.length) {
255
+ console.log(messages.join('\n'));
256
+ process.exit(strict ? 1 : 0);
137
257
  }
138
258
  process.exit(0);
139
259
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copy `text` to the clipboard. With `html`, it is copied as both `text/html` and
3
+ * `text/plain` (a `ClipboardItem`), so emphasis such as an italic title survives a paste into
4
+ * a word processor, falling back to plain text where that is not supported or refused.
5
+ * Rejects when nothing could be copied (no clipboard, or permission denied).
6
+ */
7
+ export declare function copyText(text: string, html?: string): Promise<void>;
8
+ /** Select everything in `node`, so that the visitor can copy it with the keyboard. */
9
+ export declare function selectContents(node: Node | null | undefined): void;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copy `text` to the clipboard. With `html`, it is copied as both `text/html` and
3
+ * `text/plain` (a `ClipboardItem`), so emphasis such as an italic title survives a paste into
4
+ * a word processor, falling back to plain text where that is not supported or refused.
5
+ * Rejects when nothing could be copied (no clipboard, or permission denied).
6
+ */
7
+ export async function copyText(text, html) {
8
+ const clipboard = navigator.clipboard;
9
+ if (html && typeof ClipboardItem === 'function' && typeof clipboard?.write === 'function') {
10
+ try {
11
+ await clipboard.write([
12
+ new ClipboardItem({
13
+ 'text/plain': new Blob([text], { type: 'text/plain' }),
14
+ 'text/html': new Blob([html], { type: 'text/html' }),
15
+ }),
16
+ ]);
17
+ return;
18
+ }
19
+ catch {
20
+ // Some browsers refuse HTML: plain text below.
21
+ }
22
+ }
23
+ await clipboard.writeText(text);
24
+ }
25
+ /** Select everything in `node`, so that the visitor can copy it with the keyboard. */
26
+ export function selectContents(node) {
27
+ if (node)
28
+ node.ownerDocument?.getSelection()?.selectAllChildren(node);
29
+ }
30
+ //# sourceMappingURL=clipboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../src/base/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAY,EAAE,IAAa;IACxD,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;IACtC,IAAI,IAAI,IAAI,OAAO,aAAa,KAAK,UAAU,IAAI,OAAO,SAAS,EAAE,KAAK,KAAK,UAAU,EAAE,CAAC;QAC1F,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,KAAK,CAAC;gBACpB,IAAI,aAAa,CAAC;oBAChB,YAAY,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;oBACtD,WAAW,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;iBACrD,CAAC;aACH,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC;IACD,MAAM,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,IAAI,IAAI;QAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
package/dist/base.css CHANGED
@@ -130,7 +130,9 @@
130
130
  uvalib-combobox,
131
131
  uvalib-image-regions,
132
132
  uvalib-map,
133
- uvalib-filter-drawer
133
+ uvalib-filter-drawer,
134
+ uvalib-filter,
135
+ uvalib-list-filter
134
136
  ):not(:defined)[hidden],
135
137
  :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {
136
138
  display: none;
@@ -276,6 +278,25 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
276
278
  font: inherit;
277
279
  line-height: 1.2;
278
280
  }
281
+ /* A list filter draws its label, a 44px field and a one-line count from attributes: hold
282
+ their height (less the label with hide-label, less the count with results-count), so the
283
+ list below does not move when it upgrades. The list itself is the page's and stays
284
+ fully shown until then. */
285
+ uvalib-list-filter:not(:defined) {
286
+ display: block;
287
+ font-size: 1rem;
288
+ line-height: 1.5;
289
+ min-block-size: calc(1.5em + 0.25rem + 44px + 0.25rem + 1.5em);
290
+ }
291
+ uvalib-list-filter[hide-label]:not(:defined) {
292
+ min-block-size: calc(44px + 0.25rem + 1.5em);
293
+ }
294
+ uvalib-list-filter[results-count]:not(:defined) {
295
+ min-block-size: calc(1.5em + 0.25rem + 44px);
296
+ }
297
+ uvalib-list-filter[hide-label][results-count]:not(:defined) {
298
+ min-block-size: 44px;
299
+ }
279
300
  /* Image regions: the image at its own width and the list beside it (or under it), the
280
301
  layout the element keeps once it upgrades, so the image does not move. */
281
302
  uvalib-image-regions:not(:defined) {
@@ -309,6 +330,13 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
309
330
  line-height: 1.5;
310
331
  color: var(--uva-color-text-muted, #4b5563);
311
332
  }
333
+ /* A collapsed filter group (<uvalib-filter collapsible collapsed>) draws only its 44px
334
+ legend button once it upgrades: hold that height. Low specificity, so the [hidden] rule
335
+ above still wins. */
336
+ :where(uvalib-filter[collapsible][collapsed]):not(:defined) {
337
+ display: block;
338
+ min-block-size: 44px;
339
+ }
312
340
  /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px
313
341
  "Search and filters" button shows, so hold that height and keep the form and filters out
314
342
  of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the
@@ -323,6 +351,89 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
323
351
  display: none;
324
352
  }
325
353
  }
354
+ /* A contents list before <uvalib-contents> upgrades (a .uvalib-sidebar-layout sidebar): the
355
+ headline's line held above, the links already padded as it pads them (the rules drawn
356
+ transparent while hidden), so the list does not move. Narrow (the default 64rem
357
+ collapse-below, closed): only its 44px button shows once it upgrades, so hold that and
358
+ clip the list; the reveal releases it, so the list still shows if the script never loads.
359
+ The [hidden] rule above still wins (it alone sets display). */
360
+ uvalib-contents:not(:defined) {
361
+ padding-block-start: calc(1.125rem * 1.3 + 0.5rem);
362
+ animation-name: uvalib-contents-reveal;
363
+ }
364
+ :where(uvalib-contents):not(:defined) :is(ol, ul) {
365
+ margin: 0;
366
+ padding: 0;
367
+ list-style: none;
368
+ }
369
+ :where(uvalib-contents):not(:defined) > :is(ol, ul) {
370
+ border-block: 1px solid transparent;
371
+ }
372
+ :where(uvalib-contents):not(:defined) > :is(ol, ul) > li + li {
373
+ border-block-start: 1px solid transparent;
374
+ }
375
+ :where(uvalib-contents):not(:defined) li > a {
376
+ display: block;
377
+ padding: 0.5rem 0.75rem 0.5rem calc(0.75rem + 4px);
378
+ }
379
+ :where(uvalib-contents):not(:defined) li li > a {
380
+ padding-block: 0.25rem;
381
+ }
382
+ :where(uvalib-contents):not(:defined) li :is(ol, ul) {
383
+ padding-inline-start: 1rem;
384
+ border-inline-start: 2px solid transparent;
385
+ }
386
+ /* In light DOM (no-shadow-dom) a nested list is indented by a margin, with 0.5rem below. */
387
+ :where(uvalib-contents[no-shadow-dom]):not(:defined) li :is(ol, ul) {
388
+ margin: 0 0 0.5rem 0.75rem;
389
+ padding-inline-start: 0;
390
+ }
391
+ @media (max-width: 64rem) {
392
+ uvalib-contents:not([collapse-below], [open]):not(:defined) {
393
+ max-block-size: 44px;
394
+ padding-block-start: 0;
395
+ overflow: hidden;
396
+ }
397
+ }
398
+ @keyframes uvalib-contents-reveal {
399
+ to {
400
+ visibility: visible;
401
+ max-block-size: none;
402
+ overflow: visible;
403
+ }
404
+ }
405
+ /* A dialog before <uvalib-dialog> upgrades: its children are the dialog's content, never
406
+ shown in the page, so nothing flashes or moves. Once defined, a closed dialog renders
407
+ nothing (its host is display: contents around a closed <dialog>). */
408
+ uvalib-dialog:not(:defined) {
409
+ display: none;
410
+ }
411
+ /* A citation before <uvalib-citation> upgrades: only the first format's citation, boxed
412
+ as it will be, with the label and 44px format bar held above it (none for hide-label)
413
+ and the 44px Copy citation row below, so nothing moves when it upgrades (an app's
414
+ citations property cannot be held). */
415
+ uvalib-citation:not(:defined) {
416
+ display: block;
417
+ font-size: 1rem;
418
+ line-height: 1.5;
419
+ }
420
+ uvalib-citation:not(:defined):has(> [data-format]) {
421
+ padding-block: calc(2rem + 44px + 0.75rem) calc(0.75rem + 44px);
422
+ }
423
+ uvalib-citation[hide-label]:not(:defined):has(> [data-format]) {
424
+ padding-block-start: calc(44px + 0.75rem);
425
+ }
426
+ uvalib-citation:not(:defined) > [data-format] {
427
+ margin: 0;
428
+ padding: 0.75rem 1rem;
429
+ border: 1px solid transparent;
430
+ overflow-wrap: anywhere;
431
+ text-wrap: pretty;
432
+ }
433
+ uvalib-citation:not(:defined) > [data-format] ~ [data-format],
434
+ uvalib-citation:not(:defined) > [slot] {
435
+ display: none;
436
+ }
326
437
  /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme
327
438
  prints light (the role tokens resolve to their light values), and the content's links
328
439
  are black and underlined, so they are told apart without colour. Content is <main> in
@@ -379,6 +490,8 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
379
490
  --uva-color-link: light-dark(var(--uva-brand-blue, #232d4b), #87b9d9);
380
491
  --uva-color-highlight: light-dark(var(--uva-brand-orange-200, #ffc999), #854200);
381
492
  --uva-color-on-highlight: light-dark(var(--uva-grey-darkest, #2b2b2b), #ffffff);
493
+ --uva-color-table-border: light-dark(var(--uva-grey-100, #dadada), #4f5a7a);
494
+ --uva-color-table-stripe: light-dark(var(--uva-grey-200, #f1f1f1), #1a2340);
382
495
  }
383
496
  :root[data-uva-color-scheme='system'] {
384
497
  color-scheme: light dark;
@@ -947,9 +1060,194 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
947
1060
  }
948
1061
 
949
1062
 
1063
+ .uvalib-table {
1064
+ inline-size: 100%;
1065
+ margin-block: 0 1rem;
1066
+ border-collapse: collapse;
1067
+ border-spacing: 0;
1068
+ color: inherit;
1069
+ }
1070
+ .uvalib-table > caption {
1071
+ caption-side: top;
1072
+ padding-block: 0 0.5rem;
1073
+ font-size: 1.125rem;
1074
+ font-weight: 700;
1075
+ line-height: 1.3;
1076
+ text-align: start;
1077
+ }
1078
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1079
+ padding: 0.5rem;
1080
+ border-block-end: 1px solid var(--uva-color-table-border, var(--uva-grey-100, #dadada));
1081
+ text-align: start;
1082
+ vertical-align: top;
1083
+ overflow-wrap: anywhere;
1084
+ }
1085
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
1086
+ padding-inline-start: 1rem;
1087
+ }
1088
+ .uvalib-table th {
1089
+ font-weight: 700;
1090
+ }
1091
+ .uvalib-table > thead > tr > :is(th, td) {
1092
+ border-block-end-width: 2px;
1093
+ vertical-align: bottom;
1094
+ }
1095
+ .uvalib-table--striped > tbody > tr:nth-child(even) {
1096
+ background-color: var(--uva-color-table-stripe, var(--uva-grey-200, #f1f1f1));
1097
+ }
1098
+ .uvalib-table.uvalib-table--compact > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1099
+ padding: 0.25rem 0.5rem;
1100
+ }
1101
+ .uvalib-table.uvalib-table--compact > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
1102
+ padding-inline-start: 0.5rem;
1103
+ }
1104
+ /* Numbers: right-aligned (end), with digits of equal width so columns line up. */
1105
+ .uvalib-table .uvalib-table__num {
1106
+ text-align: end;
1107
+ font-variant-numeric: tabular-nums;
1108
+ }
1109
+
1110
+ /* A wide table scrolls inside its wrapper (role="region", tabindex="0", aria-labelledby the
1111
+ caption's id), never the page. */
1112
+ .uvalib-table-scroll {
1113
+ display: block;
1114
+ max-inline-size: 100%;
1115
+ margin-block: 0 1rem;
1116
+ overflow-x: auto;
1117
+ overscroll-behavior-inline: contain;
1118
+ }
1119
+ .uvalib-table-scroll:focus-visible {
1120
+ outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));
1121
+ outline-offset: 2px;
1122
+ }
1123
+ .uvalib-table-scroll > .uvalib-table {
1124
+ margin-block-end: 0;
1125
+ }
1126
+ .uvalib-table-scroll > .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
1127
+ overflow-wrap: break-word;
1128
+ }
1129
+
1130
+ /* Stacked rows on a narrow wrapper (opt-in; add explicit ARIA roles, see above). */
1131
+ .uvalib-table-stack {
1132
+ container: uvalib-table-stack / inline-size;
1133
+ margin-block: 0 1rem;
1134
+ }
1135
+ .uvalib-table-stack > .uvalib-table {
1136
+ margin-block-end: 0;
1137
+ }
1138
+ @container uvalib-table-stack (width <= 30em) {
1139
+ .uvalib-table-stack .uvalib-table--stack,
1140
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot),
1141
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr,
1142
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td),
1143
+ .uvalib-table-stack .uvalib-table--stack > caption {
1144
+ display: block;
1145
+ }
1146
+ /* The column headers stay for assistive technology; each cell shows its own label. */
1147
+ .uvalib-table-stack .uvalib-table--stack > thead {
1148
+ position: absolute;
1149
+ inline-size: 1px;
1150
+ block-size: 1px;
1151
+ overflow: hidden;
1152
+ clip-path: inset(50%);
1153
+ white-space: nowrap;
1154
+ }
1155
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1156
+ padding-block: 0.5rem;
1157
+ border-block-end: 1px solid var(--uva-color-table-border, var(--uva-grey-100, #dadada));
1158
+ }
1159
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td) {
1160
+ padding: 0.25rem 1rem;
1161
+ border: 0;
1162
+ text-align: start;
1163
+ }
1164
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr > [data-label]::before {
1165
+ content: attr(data-label);
1166
+ /* The label repeats the column header, so it is not read twice. */
1167
+ content: attr(data-label) / '';
1168
+ display: block;
1169
+ font-weight: 700;
1170
+ }
1171
+ }
1172
+
1173
+ @media (forced-colors: active) {
1174
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td),
1175
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1176
+ border-color: CanvasText;
1177
+ }
1178
+ }
1179
+ @media print {
1180
+ .uvalib-table > :is(thead, tbody, tfoot) > tr > :is(th, td),
1181
+ .uvalib-table-stack .uvalib-table--stack > :is(tbody, tfoot) > tr {
1182
+ border-color: #000000;
1183
+ }
1184
+ .uvalib-table--striped > tbody > tr:nth-child(even) {
1185
+ background-color: transparent;
1186
+ }
1187
+ .uvalib-table-scroll {
1188
+ overflow: visible;
1189
+ }
1190
+ }
1191
+
1192
+
1193
+ .uvalib-sidebar-layout {
1194
+ container: uvalib-sidebar-layout / inline-size;
1195
+ display: flex;
1196
+ flex-wrap: wrap;
1197
+ align-items: stretch;
1198
+ gap: var(--uvalib-sidebar-stack-gap, 2rem) var(--uvalib-sidebar-gap, 3.5rem);
1199
+ }
1200
+ .uvalib-sidebar-layout > :is(.uvalib-sidebar-layout__sidebar, .uvalib-sidebar-layout__main) {
1201
+ flex: 1 1 100%;
1202
+ box-sizing: border-box;
1203
+ min-inline-size: 0;
1204
+ overflow-wrap: break-word;
1205
+ }
1206
+ @container uvalib-sidebar-layout (width >= 913px) {
1207
+ .uvalib-sidebar-layout > .uvalib-sidebar-layout__sidebar {
1208
+ flex: 0 0 var(--uvalib-sidebar-width, clamp(14rem, 25%, 20rem));
1209
+ }
1210
+ .uvalib-sidebar-layout > .uvalib-sidebar-layout__main {
1211
+ flex: 1 1 0;
1212
+ }
1213
+ .uvalib-sidebar-layout--sticky > .uvalib-sidebar-layout__sidebar {
1214
+ position: sticky;
1215
+ top: var(--uvalib-sidebar-sticky-top, 1rem);
1216
+ align-self: flex-start;
1217
+ max-block-size: calc(100dvh - 2 * var(--uvalib-sidebar-sticky-top, 1rem));
1218
+ overflow-y: auto;
1219
+ overscroll-behavior: contain;
1220
+ }
1221
+ }
1222
+ @media print {
1223
+ .uvalib-sidebar-layout > :is(.uvalib-sidebar-layout__sidebar, .uvalib-sidebar-layout__main) {
1224
+ flex: 1 1 100%;
1225
+ position: static;
1226
+ max-block-size: none;
1227
+ overflow: visible;
1228
+ }
1229
+ .uvalib-sidebar-layout--print-hide-sidebar > .uvalib-sidebar-layout__sidebar {
1230
+ display: none;
1231
+ }
1232
+ }
1233
+
1234
+
950
1235
  /* hidden hides every base.css class, though each sets display (see hidden.ts). */
951
- :where(.uvalib-button, .uvalib-input, .uvalib-search-form, .uvalib-badge, .uvalib-media, .uvalib-media__badges, .uvalib-toolbar, .uvalib-toolbar__field, .uvalib-toolbar__group, .uvalib-toolbar__summary, .uvalib-empty-state, .uvalib-skeleton, .uvalib-skeleton-text, .uvalib-message, .uvalib-message__icon, .uvalib-result-list, .uvalib-result, .uvalib-result__title, .uvalib-result__meta, .uvalib-result__snippet, .uvalib-result__actions)[hidden],
952
- :where(.uvalib-media > :is(img, video, picture))[hidden] {
1236
+ :where(.uvalib-button, .uvalib-input, .uvalib-search-form, .uvalib-badge, .uvalib-media, .uvalib-media__badges, .uvalib-toolbar, .uvalib-toolbar__field, .uvalib-toolbar__group, .uvalib-toolbar__summary, .uvalib-empty-state, .uvalib-skeleton, .uvalib-skeleton-text, .uvalib-message, .uvalib-message__icon, .uvalib-result-list, .uvalib-result, .uvalib-result__title, .uvalib-result__meta, .uvalib-result__snippet, .uvalib-result__actions, .uvalib-table, .uvalib-table-scroll, .uvalib-table-stack, .uvalib-sidebar-layout, .uvalib-help)[hidden],
1237
+ :where(.uvalib-media > :is(img, video, picture), .uvalib-table--stack > :is(tbody, tfoot, caption), .uvalib-table--stack > :is(tbody, tfoot) > tr, .uvalib-table--stack > :is(tbody, tfoot) > tr > :is(th, td))[hidden] {
953
1238
  display: none !important;
954
1239
  }
955
1240
 
1241
+
1242
+ .uvalib-help {
1243
+ display: block;
1244
+ margin-block: 0.25rem 0;
1245
+ color: var(--uva-color-text-muted, #4b5563);
1246
+ font-size: 0.9375rem;
1247
+ line-height: 1.4;
1248
+ }
1249
+ .uvalib-required {
1250
+ color: var(--uva-color-text-muted, #4b5563);
1251
+ font-weight: 400;
1252
+ }
1253
+