@canopy-iiif/app 0.9.4 → 0.9.6
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 +1 -1
- package/ui/dist/index.mjs +63 -55
- package/ui/dist/index.mjs.map +4 -4
- package/ui/dist/server.mjs +35 -27
- package/ui/dist/server.mjs.map +4 -4
- package/ui/styles/components/_footer.scss +30 -0
- package/ui/styles/components/index.scss +1 -0
- package/ui/styles/index.css +27 -0
package/package.json
CHANGED
package/ui/dist/index.mjs
CHANGED
|
@@ -839,8 +839,15 @@ function CanopyHeader(props = {}) {
|
|
|
839
839
|
), /* @__PURE__ */ React11.createElement(HeaderScript, null));
|
|
840
840
|
}
|
|
841
841
|
|
|
842
|
+
// ui/src/layout/CanopyFooter.jsx
|
|
843
|
+
import React12 from "react";
|
|
844
|
+
function CanopyFooter({ className = "", children }) {
|
|
845
|
+
const footerClassName = ["canopy-footer", className].filter(Boolean).join(" ");
|
|
846
|
+
return /* @__PURE__ */ React12.createElement("footer", { className: footerClassName }, /* @__PURE__ */ React12.createElement("div", { className: "canopy-footer__inner" }, children));
|
|
847
|
+
}
|
|
848
|
+
|
|
842
849
|
// ui/src/iiif/Viewer.jsx
|
|
843
|
-
import
|
|
850
|
+
import React13, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
844
851
|
var DEFAULT_VIEWER_OPTIONS = {
|
|
845
852
|
showDownload: false,
|
|
846
853
|
showIIIFBadge: false,
|
|
@@ -896,7 +903,7 @@ var Viewer = (props) => {
|
|
|
896
903
|
} catch (_) {
|
|
897
904
|
json = "{}";
|
|
898
905
|
}
|
|
899
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ React13.createElement("div", { "data-canopy-viewer": "1", className: "not-prose" }, /* @__PURE__ */ React13.createElement(
|
|
900
907
|
"script",
|
|
901
908
|
{
|
|
902
909
|
type: "application/json",
|
|
@@ -904,11 +911,11 @@ var Viewer = (props) => {
|
|
|
904
911
|
}
|
|
905
912
|
));
|
|
906
913
|
}
|
|
907
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ React13.createElement(CloverViewer, { ...props, options: mergedOptions });
|
|
908
915
|
};
|
|
909
916
|
|
|
910
917
|
// ui/src/iiif/Slider.jsx
|
|
911
|
-
import
|
|
918
|
+
import React14, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
912
919
|
var Slider = (props) => {
|
|
913
920
|
const [CloverSlider, setCloverSlider] = useState3(null);
|
|
914
921
|
useEffect3(() => {
|
|
@@ -934,7 +941,7 @@ var Slider = (props) => {
|
|
|
934
941
|
} catch (_) {
|
|
935
942
|
json = "{}";
|
|
936
943
|
}
|
|
937
|
-
return /* @__PURE__ */
|
|
944
|
+
return /* @__PURE__ */ React14.createElement("div", { "data-canopy-slider": "1", className: "not-prose" }, /* @__PURE__ */ React14.createElement(
|
|
938
945
|
"script",
|
|
939
946
|
{
|
|
940
947
|
type: "application/json",
|
|
@@ -942,11 +949,11 @@ var Slider = (props) => {
|
|
|
942
949
|
}
|
|
943
950
|
));
|
|
944
951
|
}
|
|
945
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ React14.createElement(CloverSlider, { ...props });
|
|
946
953
|
};
|
|
947
954
|
|
|
948
955
|
// ui/src/iiif/Scroll.jsx
|
|
949
|
-
import
|
|
956
|
+
import React15, { useEffect as useEffect4, useState as useState4 } from "react";
|
|
950
957
|
var Scroll = (props) => {
|
|
951
958
|
const [CloverScroll, setCloverScroll] = useState4(null);
|
|
952
959
|
useEffect4(() => {
|
|
@@ -971,7 +978,7 @@ var Scroll = (props) => {
|
|
|
971
978
|
} catch (_) {
|
|
972
979
|
json = "{}";
|
|
973
980
|
}
|
|
974
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ React15.createElement("div", { "data-canopy-scroll": "1", className: "not-prose" }, /* @__PURE__ */ React15.createElement(
|
|
975
982
|
"script",
|
|
976
983
|
{
|
|
977
984
|
type: "application/json",
|
|
@@ -979,11 +986,11 @@ var Scroll = (props) => {
|
|
|
979
986
|
}
|
|
980
987
|
));
|
|
981
988
|
}
|
|
982
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ React15.createElement(CloverScroll, { ...props });
|
|
983
990
|
};
|
|
984
991
|
|
|
985
992
|
// ui/src/iiif/MdxRelatedItems.jsx
|
|
986
|
-
import
|
|
993
|
+
import React16 from "react";
|
|
987
994
|
function MdxRelatedItems(props) {
|
|
988
995
|
let json = "{}";
|
|
989
996
|
try {
|
|
@@ -991,11 +998,11 @@ function MdxRelatedItems(props) {
|
|
|
991
998
|
} catch (_) {
|
|
992
999
|
json = "{}";
|
|
993
1000
|
}
|
|
994
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ React16.createElement("div", { "data-canopy-related-items": "1", className: "not-prose" }, /* @__PURE__ */ React16.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
995
1002
|
}
|
|
996
1003
|
|
|
997
1004
|
// ui/src/search/MdxSearchResults.jsx
|
|
998
|
-
import
|
|
1005
|
+
import React17 from "react";
|
|
999
1006
|
function MdxSearchResults(props) {
|
|
1000
1007
|
let json = "{}";
|
|
1001
1008
|
try {
|
|
@@ -1003,11 +1010,11 @@ function MdxSearchResults(props) {
|
|
|
1003
1010
|
} catch (_) {
|
|
1004
1011
|
json = "{}";
|
|
1005
1012
|
}
|
|
1006
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ React17.createElement("div", { "data-canopy-search-results": "1" }, /* @__PURE__ */ React17.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
1007
1014
|
}
|
|
1008
1015
|
|
|
1009
1016
|
// ui/src/search/SearchSummary.jsx
|
|
1010
|
-
import
|
|
1017
|
+
import React18 from "react";
|
|
1011
1018
|
function SearchSummary(props) {
|
|
1012
1019
|
let json = "{}";
|
|
1013
1020
|
try {
|
|
@@ -1015,11 +1022,11 @@ function SearchSummary(props) {
|
|
|
1015
1022
|
} catch (_) {
|
|
1016
1023
|
json = "{}";
|
|
1017
1024
|
}
|
|
1018
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ React18.createElement("div", { "data-canopy-search-summary": "1" }, /* @__PURE__ */ React18.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
1019
1026
|
}
|
|
1020
1027
|
|
|
1021
1028
|
// ui/src/search/MdxSearchTabs.jsx
|
|
1022
|
-
import
|
|
1029
|
+
import React19 from "react";
|
|
1023
1030
|
function MdxSearchTabs(props) {
|
|
1024
1031
|
let json = "{}";
|
|
1025
1032
|
try {
|
|
@@ -1027,11 +1034,11 @@ function MdxSearchTabs(props) {
|
|
|
1027
1034
|
} catch (_) {
|
|
1028
1035
|
json = "{}";
|
|
1029
1036
|
}
|
|
1030
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ React19.createElement("div", { "data-canopy-search-tabs": "1" }, /* @__PURE__ */ React19.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
1031
1038
|
}
|
|
1032
1039
|
|
|
1033
1040
|
// ui/src/search/SearchResults.jsx
|
|
1034
|
-
import
|
|
1041
|
+
import React20 from "react";
|
|
1035
1042
|
function SearchResults({
|
|
1036
1043
|
results = [],
|
|
1037
1044
|
type = "all",
|
|
@@ -1039,19 +1046,19 @@ function SearchResults({
|
|
|
1039
1046
|
query = ""
|
|
1040
1047
|
}) {
|
|
1041
1048
|
if (!results.length) {
|
|
1042
|
-
return /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "text-slate-600" }, /* @__PURE__ */ React20.createElement("em", null, "No results"));
|
|
1043
1050
|
}
|
|
1044
1051
|
const normalizedType = String(type || "all").toLowerCase();
|
|
1045
1052
|
const isAnnotationView = normalizedType === "annotation";
|
|
1046
1053
|
if (isAnnotationView) {
|
|
1047
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ React20.createElement("div", { id: "search-results", className: "space-y-4" }, results.map((r, i) => {
|
|
1048
1055
|
if (!r) return null;
|
|
1049
1056
|
return renderTextCard(r, r.id || i);
|
|
1050
1057
|
}));
|
|
1051
1058
|
}
|
|
1052
1059
|
const renderTextCard = (record, key) => {
|
|
1053
1060
|
if (!record) return null;
|
|
1054
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1055
1062
|
TextCard,
|
|
1056
1063
|
{
|
|
1057
1064
|
key,
|
|
@@ -1067,20 +1074,20 @@ function SearchResults({
|
|
|
1067
1074
|
const isWorkRecord = (record) => String(record && record.type).toLowerCase() === "work";
|
|
1068
1075
|
const shouldRenderAsTextCard = (record) => !isWorkRecord(record) || normalizedType !== "work";
|
|
1069
1076
|
if (layout === "list") {
|
|
1070
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ React20.createElement("ul", { id: "search-results", className: "space-y-3" }, results.map((r, i) => {
|
|
1071
1078
|
if (shouldRenderAsTextCard(r)) {
|
|
1072
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ React20.createElement("li", { key: i, className: `search-result ${r && r.type}` }, renderTextCard(r, i));
|
|
1073
1080
|
}
|
|
1074
1081
|
const hasDims = Number.isFinite(Number(r.thumbnailWidth)) && Number(r.thumbnailWidth) > 0 && Number.isFinite(Number(r.thumbnailHeight)) && Number(r.thumbnailHeight) > 0;
|
|
1075
1082
|
const aspect = hasDims ? Number(r.thumbnailWidth) / Number(r.thumbnailHeight) : void 0;
|
|
1076
|
-
return /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1077
1084
|
"li",
|
|
1078
1085
|
{
|
|
1079
1086
|
key: i,
|
|
1080
1087
|
className: `search-result ${r.type}`,
|
|
1081
1088
|
"data-thumbnail-aspect-ratio": aspect
|
|
1082
1089
|
},
|
|
1083
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ React20.createElement(
|
|
1084
1091
|
Card,
|
|
1085
1092
|
{
|
|
1086
1093
|
href: r.href,
|
|
@@ -1094,20 +1101,20 @@ function SearchResults({
|
|
|
1094
1101
|
);
|
|
1095
1102
|
}));
|
|
1096
1103
|
}
|
|
1097
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ React20.createElement("div", { id: "search-results" }, /* @__PURE__ */ React20.createElement(Grid, null, results.map((r, i) => {
|
|
1098
1105
|
if (shouldRenderAsTextCard(r)) {
|
|
1099
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ React20.createElement(GridItem, { key: i, className: `search-result ${r && r.type}` }, renderTextCard(r, i));
|
|
1100
1107
|
}
|
|
1101
1108
|
const hasDims = Number.isFinite(Number(r.thumbnailWidth)) && Number(r.thumbnailWidth) > 0 && Number.isFinite(Number(r.thumbnailHeight)) && Number(r.thumbnailHeight) > 0;
|
|
1102
1109
|
const aspect = hasDims ? Number(r.thumbnailWidth) / Number(r.thumbnailHeight) : void 0;
|
|
1103
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1104
1111
|
GridItem,
|
|
1105
1112
|
{
|
|
1106
1113
|
key: i,
|
|
1107
1114
|
className: `search-result ${r.type}`,
|
|
1108
1115
|
"data-thumbnail-aspect-ratio": aspect
|
|
1109
1116
|
},
|
|
1110
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ React20.createElement(
|
|
1111
1118
|
Card,
|
|
1112
1119
|
{
|
|
1113
1120
|
href: r.href,
|
|
@@ -1123,7 +1130,7 @@ function SearchResults({
|
|
|
1123
1130
|
}
|
|
1124
1131
|
|
|
1125
1132
|
// ui/src/search/SearchTabs.jsx
|
|
1126
|
-
import
|
|
1133
|
+
import React21 from "react";
|
|
1127
1134
|
function SearchTabs({
|
|
1128
1135
|
type = "all",
|
|
1129
1136
|
onTypeChange,
|
|
@@ -1138,7 +1145,7 @@ function SearchTabs({
|
|
|
1138
1145
|
const toLabel = (t) => t && t.length ? t.charAt(0).toUpperCase() + t.slice(1) : "";
|
|
1139
1146
|
const hasFilters = typeof onOpenFilters === "function";
|
|
1140
1147
|
const filterBadge = activeFilterCount > 0 ? ` (${activeFilterCount})` : "";
|
|
1141
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "canopy-search-tabs-wrapper" }, /* @__PURE__ */ React21.createElement(
|
|
1142
1149
|
"div",
|
|
1143
1150
|
{
|
|
1144
1151
|
role: "tablist",
|
|
@@ -1149,7 +1156,7 @@ function SearchTabs({
|
|
|
1149
1156
|
const active = String(type).toLowerCase() === String(t).toLowerCase();
|
|
1150
1157
|
const cRaw = counts && Object.prototype.hasOwnProperty.call(counts, t) ? counts[t] : void 0;
|
|
1151
1158
|
const c = Number.isFinite(Number(cRaw)) ? Number(cRaw) : 0;
|
|
1152
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1153
1160
|
"button",
|
|
1154
1161
|
{
|
|
1155
1162
|
key: t,
|
|
@@ -1164,7 +1171,7 @@ function SearchTabs({
|
|
|
1164
1171
|
")"
|
|
1165
1172
|
);
|
|
1166
1173
|
})
|
|
1167
|
-
), hasFilters ? /* @__PURE__ */
|
|
1174
|
+
), hasFilters ? /* @__PURE__ */ React21.createElement(
|
|
1168
1175
|
"button",
|
|
1169
1176
|
{
|
|
1170
1177
|
type: "button",
|
|
@@ -1172,12 +1179,12 @@ function SearchTabs({
|
|
|
1172
1179
|
"aria-expanded": filtersOpen ? "true" : "false",
|
|
1173
1180
|
className: "inline-flex items-center gap-2 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-sm font-medium text-slate-700 shadow-sm transition hover:border-brand-200 hover:bg-brand-50 hover:text-brand-700"
|
|
1174
1181
|
},
|
|
1175
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ React21.createElement("span", null, filtersLabel, filterBadge)
|
|
1176
1183
|
) : null);
|
|
1177
1184
|
}
|
|
1178
1185
|
|
|
1179
1186
|
// ui/src/search/SearchFiltersDialog.jsx
|
|
1180
|
-
import
|
|
1187
|
+
import React22 from "react";
|
|
1181
1188
|
function toArray(input) {
|
|
1182
1189
|
if (!input) return [];
|
|
1183
1190
|
if (Array.isArray(input)) return input;
|
|
@@ -1216,20 +1223,20 @@ function FacetSection({ facet, selected, onToggle }) {
|
|
|
1216
1223
|
const selectedValues = selected.get(String(slug)) || /* @__PURE__ */ new Set();
|
|
1217
1224
|
const checkboxId = (valueSlug) => `filter-${slug}-${valueSlug}`;
|
|
1218
1225
|
const hasSelection = selectedValues.size > 0;
|
|
1219
|
-
const [quickQuery, setQuickQuery] =
|
|
1226
|
+
const [quickQuery, setQuickQuery] = React22.useState("");
|
|
1220
1227
|
const hasQuery = quickQuery.trim().length > 0;
|
|
1221
|
-
const filteredValues =
|
|
1228
|
+
const filteredValues = React22.useMemo(
|
|
1222
1229
|
() => facetMatches(values, quickQuery),
|
|
1223
1230
|
[values, quickQuery]
|
|
1224
1231
|
);
|
|
1225
|
-
return /* @__PURE__ */
|
|
1232
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1226
1233
|
"details",
|
|
1227
1234
|
{
|
|
1228
1235
|
className: "canopy-search-filters__facet",
|
|
1229
1236
|
open: hasSelection
|
|
1230
1237
|
},
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ React22.createElement("summary", { className: "canopy-search-filters__facet-summary" }, /* @__PURE__ */ React22.createElement("span", null, label), /* @__PURE__ */ React22.createElement("span", { className: "canopy-search-filters__facet-count" }, values.length)),
|
|
1239
|
+
/* @__PURE__ */ React22.createElement("div", { className: "canopy-search-filters__facet-content" }, /* @__PURE__ */ React22.createElement("div", { className: "canopy-search-filters__quick" }, /* @__PURE__ */ React22.createElement(
|
|
1233
1240
|
"input",
|
|
1234
1241
|
{
|
|
1235
1242
|
type: "search",
|
|
@@ -1239,7 +1246,7 @@ function FacetSection({ facet, selected, onToggle }) {
|
|
|
1239
1246
|
className: "canopy-search-filters__quick-input",
|
|
1240
1247
|
"aria-label": `Filter ${label} values`
|
|
1241
1248
|
}
|
|
1242
|
-
), quickQuery ? /* @__PURE__ */
|
|
1249
|
+
), quickQuery ? /* @__PURE__ */ React22.createElement(
|
|
1243
1250
|
"button",
|
|
1244
1251
|
{
|
|
1245
1252
|
type: "button",
|
|
@@ -1247,11 +1254,11 @@ function FacetSection({ facet, selected, onToggle }) {
|
|
|
1247
1254
|
className: "canopy-search-filters__quick-clear"
|
|
1248
1255
|
},
|
|
1249
1256
|
"Clear"
|
|
1250
|
-
) : null), hasQuery && !filteredValues.length ? /* @__PURE__ */
|
|
1257
|
+
) : null), hasQuery && !filteredValues.length ? /* @__PURE__ */ React22.createElement("p", { className: "canopy-search-filters__facet-notice" }, "No matches found.") : null, /* @__PURE__ */ React22.createElement("ul", { className: "canopy-search-filters__facet-list" }, filteredValues.map((entry) => {
|
|
1251
1258
|
const valueSlug = String(entry.slug || entry.value || "");
|
|
1252
1259
|
const isChecked = selectedValues.has(valueSlug);
|
|
1253
1260
|
const inputId = checkboxId(valueSlug);
|
|
1254
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ React22.createElement("li", { key: valueSlug, className: "canopy-search-filters__facet-item" }, /* @__PURE__ */ React22.createElement(
|
|
1255
1262
|
"input",
|
|
1256
1263
|
{
|
|
1257
1264
|
id: inputId,
|
|
@@ -1263,15 +1270,15 @@ function FacetSection({ facet, selected, onToggle }) {
|
|
|
1263
1270
|
if (onToggle) onToggle(slug, valueSlug, nextChecked);
|
|
1264
1271
|
}
|
|
1265
1272
|
}
|
|
1266
|
-
), /* @__PURE__ */
|
|
1273
|
+
), /* @__PURE__ */ React22.createElement(
|
|
1267
1274
|
"label",
|
|
1268
1275
|
{
|
|
1269
1276
|
htmlFor: inputId,
|
|
1270
1277
|
className: "canopy-search-filters__facet-label"
|
|
1271
1278
|
},
|
|
1272
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ React22.createElement("span", null, entry.value, " ", Number.isFinite(entry.doc_count) ? /* @__PURE__ */ React22.createElement("span", { className: "canopy-search-filters__facet-count" }, "(", entry.doc_count, ")") : null)
|
|
1273
1280
|
));
|
|
1274
|
-
}), !filteredValues.length && !hasQuery ? /* @__PURE__ */
|
|
1281
|
+
}), !filteredValues.length && !hasQuery ? /* @__PURE__ */ React22.createElement("li", { className: "canopy-search-filters__facet-empty" }, "No values available.") : null))
|
|
1275
1282
|
);
|
|
1276
1283
|
}
|
|
1277
1284
|
function SearchFiltersDialog(props = {}) {
|
|
@@ -1293,7 +1300,7 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1293
1300
|
(total, set) => total + set.size,
|
|
1294
1301
|
0
|
|
1295
1302
|
);
|
|
1296
|
-
|
|
1303
|
+
React22.useEffect(() => {
|
|
1297
1304
|
if (!open) return void 0;
|
|
1298
1305
|
if (typeof document === "undefined") return void 0;
|
|
1299
1306
|
const body = document.body;
|
|
@@ -1310,7 +1317,7 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1310
1317
|
if (!open) return null;
|
|
1311
1318
|
const brandId = "canopy-modal-filters-label";
|
|
1312
1319
|
const subtitleText = subtitle != null ? subtitle : title;
|
|
1313
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1314
1321
|
CanopyModal,
|
|
1315
1322
|
{
|
|
1316
1323
|
id: "canopy-modal-filters",
|
|
@@ -1325,8 +1332,8 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1325
1332
|
onBackgroundClick: () => onOpenChange && onOpenChange(false),
|
|
1326
1333
|
bodyClassName: "canopy-modal__body--filters"
|
|
1327
1334
|
},
|
|
1328
|
-
subtitleText ? /* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1335
|
+
subtitleText ? /* @__PURE__ */ React22.createElement("p", { className: "canopy-search-filters__subtitle" }, subtitleText) : null,
|
|
1336
|
+
/* @__PURE__ */ React22.createElement("div", { className: "canopy-search-filters__body" }, Array.isArray(facets) && facets.length ? /* @__PURE__ */ React22.createElement("div", { className: "canopy-search-filters__facets" }, facets.map((facet) => /* @__PURE__ */ React22.createElement(
|
|
1330
1337
|
FacetSection,
|
|
1331
1338
|
{
|
|
1332
1339
|
key: facet.slug || facet.label,
|
|
@@ -1334,8 +1341,8 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1334
1341
|
selected: selectedMap,
|
|
1335
1342
|
onToggle
|
|
1336
1343
|
}
|
|
1337
|
-
))) : /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1344
|
+
))) : /* @__PURE__ */ React22.createElement("p", { className: "canopy-search-filters__empty" }, "No filters are available for this collection.")),
|
|
1345
|
+
/* @__PURE__ */ React22.createElement("footer", { className: "canopy-search-filters__footer" }, /* @__PURE__ */ React22.createElement("div", null, activeCount ? `${activeCount} filter${activeCount === 1 ? "" : "s"} applied` : "No filters applied"), /* @__PURE__ */ React22.createElement("div", { className: "canopy-search-filters__footer-actions" }, /* @__PURE__ */ React22.createElement(
|
|
1339
1346
|
"button",
|
|
1340
1347
|
{
|
|
1341
1348
|
type: "button",
|
|
@@ -1346,7 +1353,7 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1346
1353
|
className: "canopy-search-filters__button canopy-search-filters__button--secondary"
|
|
1347
1354
|
},
|
|
1348
1355
|
"Clear all"
|
|
1349
|
-
), /* @__PURE__ */
|
|
1356
|
+
), /* @__PURE__ */ React22.createElement(
|
|
1350
1357
|
"button",
|
|
1351
1358
|
{
|
|
1352
1359
|
type: "button",
|
|
@@ -1359,7 +1366,7 @@ function SearchFiltersDialog(props = {}) {
|
|
|
1359
1366
|
}
|
|
1360
1367
|
|
|
1361
1368
|
// ui/src/search-form/MdxSearchFormModal.jsx
|
|
1362
|
-
import
|
|
1369
|
+
import React23 from "react";
|
|
1363
1370
|
function MdxSearchFormModal(props = {}) {
|
|
1364
1371
|
const {
|
|
1365
1372
|
placeholder = "Search\u2026",
|
|
@@ -1375,10 +1382,11 @@ function MdxSearchFormModal(props = {}) {
|
|
|
1375
1382
|
const text = typeof label === "string" && label.trim() ? label.trim() : buttonLabel;
|
|
1376
1383
|
const resolvedSearchPath = resolveSearchPath(searchPath);
|
|
1377
1384
|
const data = { placeholder, hotkey, maxResults, groupOrder, label: text, searchPath: resolvedSearchPath };
|
|
1378
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ React23.createElement("div", { "data-canopy-search-form": true, className: "flex-1 min-w-0" }, /* @__PURE__ */ React23.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React23.createElement(SearchPanelForm, { placeholder, buttonLabel, label, searchPath: resolvedSearchPath }), /* @__PURE__ */ React23.createElement(SearchPanelTeaserResults, null)), /* @__PURE__ */ React23.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: JSON.stringify(data) } }));
|
|
1379
1386
|
}
|
|
1380
1387
|
export {
|
|
1381
1388
|
CanopyBrand,
|
|
1389
|
+
CanopyFooter,
|
|
1382
1390
|
CanopyHeader,
|
|
1383
1391
|
CanopyModal,
|
|
1384
1392
|
Card,
|