@canopy-iiif/app 1.5.7 → 1.5.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-iiif/app",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Mat Jordan <mat@northwestern.edu>",
package/ui/dist/index.mjs CHANGED
@@ -93,6 +93,7 @@ function Card({
93
93
  {
94
94
  src,
95
95
  alt: alt || title || "",
96
+ "aria-hidden": !alt && !title ? "true" : void 0,
96
97
  loading: "lazy",
97
98
  onLoad: () => setImageLoaded(true),
98
99
  onError: () => setImageLoaded(true)
@@ -103,6 +104,7 @@ function Card({
103
104
  {
104
105
  src,
105
106
  alt: alt || title || "",
107
+ "aria-hidden": !alt && !title ? "true" : void 0,
106
108
  loading: "lazy",
107
109
  onLoad: () => setImageLoaded(true),
108
110
  onError: () => setImageLoaded(true),
@@ -269,7 +271,7 @@ function renderMarkdownTokens(tokens, query, keyPrefix = "token") {
269
271
  case "code":
270
272
  return /* @__PURE__ */ React3.createElement("code", { key }, token.value);
271
273
  case "link":
272
- return /* @__PURE__ */ React3.createElement("a", { key, href: token.href, target: "_blank", rel: "noreferrer" }, renderMarkdownTokens(token.children || [], query, key));
274
+ return /* @__PURE__ */ React3.createElement("a", { key, href: token.href, target: "_blank", rel: "noreferrer" }, renderMarkdownTokens(token.children || [], query, key), /* @__PURE__ */ React3.createElement("span", { className: "sr-only" }, " (opens in new tab)"));
273
275
  case "break":
274
276
  return /* @__PURE__ */ React3.createElement("br", { key });
275
277
  case "text":
@@ -456,7 +458,7 @@ import React11 from "react";
456
458
 
457
459
  // ui/src/Icons.jsx
458
460
  import React8 from "react";
459
- var MagnifyingGlassIcon = (props) => /* @__PURE__ */ React8.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...props }, /* @__PURE__ */ React8.createElement("path", { d: "M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z" }));
461
+ var MagnifyingGlassIcon = (props) => /* @__PURE__ */ React8.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", "aria-hidden": "true", focusable: "false", ...props }, /* @__PURE__ */ React8.createElement("path", { d: "M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z" }));
460
462
 
461
463
  // ui/src/search/SearchPanelForm.jsx
462
464
  import React9 from "react";
@@ -595,7 +597,7 @@ function SearchPanelForm(props = {}) {
595
597
  onPointerDown: handlePointerDown,
596
598
  "data-has-value": hasValue ? "1" : "0"
597
599
  },
598
- /* @__PURE__ */ React9.createElement("label", { htmlFor: inputId, className: "canopy-search-form__label" }, /* @__PURE__ */ React9.createElement(MagnifyingGlassIcon, { className: "canopy-search-form__icon" }), /* @__PURE__ */ React9.createElement(
600
+ /* @__PURE__ */ React9.createElement("label", { htmlFor: inputId, className: "canopy-search-form__label" }, /* @__PURE__ */ React9.createElement(MagnifyingGlassIcon, { className: "canopy-search-form__icon" }), /* @__PURE__ */ React9.createElement("span", { className: "sr-only" }, "Search"), /* @__PURE__ */ React9.createElement(
599
601
  "input",
600
602
  {
601
603
  id: inputId,
@@ -605,7 +607,6 @@ function SearchPanelForm(props = {}) {
605
607
  "data-canopy-search-form-input": true,
606
608
  placeholder,
607
609
  className: "canopy-search-form__input",
608
- "aria-label": "Search",
609
610
  ref: inputRef,
610
611
  onChange: handleInputChange,
611
612
  onInput: handleInputChange
@@ -1056,7 +1057,15 @@ function CanopyHeader(props = {}) {
1056
1057
  className: "canopy-nav-links canopy-header__desktop-nav",
1057
1058
  "aria-label": "Primary navigation"
1058
1059
  },
1059
- navLinks.map((link) => /* @__PURE__ */ React14.createElement("a", { key: link.href, href: link.href }, link.label || link.href))
1060
+ navLinks.map((link) => /* @__PURE__ */ React14.createElement(
1061
+ "a",
1062
+ {
1063
+ key: link.href,
1064
+ href: link.href,
1065
+ "aria-current": link.isActive ? "page" : void 0
1066
+ },
1067
+ link.label || link.href
1068
+ ))
1060
1069
  ),
1061
1070
  /* @__PURE__ */ React14.createElement("div", { className: "canopy-header__actions" }, /* @__PURE__ */ React14.createElement(
1062
1071
  "button",
@@ -1135,7 +1144,15 @@ function CanopyHeader(props = {}) {
1135
1144
  className: "canopy-nav-links canopy-modal__nav",
1136
1145
  "aria-label": "Primary navigation"
1137
1146
  },
1138
- navLinks.map((link) => /* @__PURE__ */ React14.createElement("a", { key: link.href, href: link.href }, link.label || link.href))
1147
+ navLinks.map((link) => /* @__PURE__ */ React14.createElement(
1148
+ "a",
1149
+ {
1150
+ key: link.href,
1151
+ href: link.href,
1152
+ "aria-current": link.isActive ? "page" : void 0
1153
+ },
1154
+ link.label || link.href
1155
+ ))
1139
1156
  ),
1140
1157
  hasSectionNav ? /* @__PURE__ */ React14.createElement(
1141
1158
  "nav",
@@ -1212,6 +1229,7 @@ function TeaserCard({
1212
1229
  {
1213
1230
  src: thumbnail,
1214
1231
  alt: "",
1232
+ "aria-hidden": "true",
1215
1233
  loading: "lazy",
1216
1234
  className: "canopy-search-teaser__thumb-img"
1217
1235
  }
@@ -1688,7 +1706,7 @@ function SearchResults({
1688
1706
  const FigureTemplate = templates && templates.figure ? templates.figure : DefaultFigureTemplate;
1689
1707
  const ArticleTemplate = templates && templates.article ? templates.article : DefaultArticleTemplate;
1690
1708
  if (isAnnotationView) {
1691
- return /* @__PURE__ */ React28.createElement("div", { id: "search-results", className: "space-y-4" }, results.map((r, i) => {
1709
+ return /* @__PURE__ */ React28.createElement("div", { id: "search-results", className: "space-y-4", role: "region", "aria-label": "Search results" }, results.map((r, i) => {
1692
1710
  if (!r) return null;
1693
1711
  return /* @__PURE__ */ React28.createElement(
1694
1712
  ArticleTemplate,
@@ -1708,7 +1726,7 @@ function SearchResults({
1708
1726
  return !isWorkRecord(record) || normalizedType !== "work";
1709
1727
  };
1710
1728
  if (layout === "list") {
1711
- return /* @__PURE__ */ React28.createElement("div", { id: "search-results", className: "space-y-6" }, results.map((r, i) => {
1729
+ return /* @__PURE__ */ React28.createElement("div", { id: "search-results", className: "space-y-6", role: "region", "aria-label": "Search results" }, results.map((r, i) => {
1712
1730
  if (shouldRenderAsArticle(r)) {
1713
1731
  return /* @__PURE__ */ React28.createElement("div", { key: i, className: `search-result ${r && r.type}` }, /* @__PURE__ */ React28.createElement(ArticleTemplate, { record: r, query, layout }));
1714
1732
  }
@@ -1733,7 +1751,7 @@ function SearchResults({
1733
1751
  );
1734
1752
  }));
1735
1753
  }
1736
- return /* @__PURE__ */ React28.createElement("div", { id: "search-results" }, /* @__PURE__ */ React28.createElement(Grid, null, results.map((r, i) => {
1754
+ return /* @__PURE__ */ React28.createElement("div", { id: "search-results", role: "region", "aria-label": "Search results" }, /* @__PURE__ */ React28.createElement(Grid, null, results.map((r, i) => {
1737
1755
  if (shouldRenderAsArticle(r)) {
1738
1756
  return /* @__PURE__ */ React28.createElement(GridItem, { key: i, className: `search-result ${r && r.type}` }, /* @__PURE__ */ React28.createElement(ArticleTemplate, { record: r, query, layout }));
1739
1757
  }
@@ -1933,7 +1951,8 @@ function FacetSection({ facet, selected, onToggle }) {
1933
1951
  {
1934
1952
  type: "button",
1935
1953
  onClick: () => setQuickQuery(""),
1936
- className: "canopy-search-filters__quick-clear"
1954
+ className: "canopy-search-filters__quick-clear",
1955
+ "aria-label": `Clear ${label} filter search`
1937
1956
  },
1938
1957
  "Clear"
1939
1958
  ) : null), hasQuery && !filteredValues.length ? /* @__PURE__ */ React30.createElement("p", { className: "canopy-search-filters__facet-notice" }, "No matches found.") : null, /* @__PURE__ */ React30.createElement("ul", { className: "canopy-search-filters__facet-list" }, filteredValues.map((entry) => {