@canopy-iiif/app 0.8.2 → 0.8.4

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 (37) hide show
  1. package/lib/AGENTS.md +1 -1
  2. package/lib/build/build.js +10 -0
  3. package/lib/build/dev.js +87 -40
  4. package/lib/build/iiif.js +124 -43
  5. package/lib/build/mdx.js +14 -4
  6. package/lib/build/pages.js +23 -9
  7. package/lib/build/runtimes.js +6 -6
  8. package/lib/build/search.js +7 -10
  9. package/lib/build/verify.js +9 -9
  10. package/lib/components/featured.js +17 -3
  11. package/lib/components/navigation.js +308 -0
  12. package/lib/page-context.js +14 -0
  13. package/lib/search/search-app.jsx +2 -2
  14. package/lib/search/{command-runtime.js → search-form-runtime.js} +9 -9
  15. package/lib/search/search.js +2 -2
  16. package/package.json +1 -1
  17. package/ui/dist/index.mjs +76 -63
  18. package/ui/dist/index.mjs.map +3 -3
  19. package/ui/dist/server.mjs +170 -67
  20. package/ui/dist/server.mjs.map +4 -4
  21. package/ui/styles/base/_common.scss +19 -6
  22. package/ui/styles/base/_heading.scss +17 -0
  23. package/ui/styles/base/index.scss +2 -1
  24. package/ui/styles/components/_sub-navigation.scss +76 -0
  25. package/ui/styles/components/header/_header.scss +13 -0
  26. package/ui/styles/components/header/_logo.scss +20 -0
  27. package/ui/styles/components/header/_navbar.scss +15 -0
  28. package/ui/styles/components/header/index.scss +3 -0
  29. package/ui/styles/components/index.scss +5 -4
  30. package/ui/styles/components/search/_filters.scss +265 -0
  31. package/ui/styles/components/search/_form.scss +171 -0
  32. package/ui/styles/components/search/_results.scss +158 -0
  33. package/ui/styles/components/search/index.scss +3 -0
  34. package/ui/styles/index.css +584 -71
  35. package/ui/styles/variables.scss +15 -5
  36. package/ui/styles/components/_command.scss +0 -164
  37. package/ui/styles/components/_header.scss +0 -0
@@ -1 +1,2 @@
1
- @use './common';
1
+ @use "./common";
2
+ @use "./heading";
@@ -0,0 +1,76 @@
1
+ .canopy-sub-navigation {
2
+ --sub-nav-indent: 0.85rem;
3
+ font-size: 0.95rem;
4
+ color: inherit;
5
+ }
6
+
7
+ .canopy-sub-navigation__heading {
8
+ font-weight: 600;
9
+ margin-bottom: 0.5rem;
10
+ }
11
+
12
+ .canopy-sub-navigation__list {
13
+ list-style: none;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ .canopy-sub-navigation__item {
19
+ margin: 0;
20
+ padding: 0;
21
+ }
22
+
23
+ .canopy-sub-navigation__link {
24
+ display: block;
25
+ padding: 0.35rem 0.5rem;
26
+ border-radius: 0.375rem;
27
+ color: inherit;
28
+ text-decoration: none;
29
+ transition: background-color 120ms ease, color 120ms ease;
30
+ }
31
+
32
+ .canopy-sub-navigation__link:hover {
33
+ background-color: var(--sub-nav-hover, rgba(37, 99, 235, 0.08));
34
+ color: inherit;
35
+ }
36
+
37
+ .canopy-sub-navigation__link.is-label {
38
+ cursor: default;
39
+ color: var(--color-gray-600, #52525b);
40
+ }
41
+
42
+ .canopy-sub-navigation__link.is-active {
43
+ background-color: var(--sub-nav-active, rgba(37, 99, 235, 0.16));
44
+ color: var(--color-brand-900, #1d4ed8);
45
+ font-weight: 600;
46
+ }
47
+
48
+ .canopy-sub-navigation__list--nested {
49
+ margin: 0.35rem 0 0.35rem 0.5rem;
50
+ padding-left: 0.75rem;
51
+ border-left: 1px solid var(--color-gray-200, #e4e4e7);
52
+ }
53
+
54
+ .canopy-sub-navigation__link.depth-0 {
55
+ padding-left: 0.5rem;
56
+ }
57
+
58
+ .canopy-sub-navigation__link.depth-1 {
59
+ padding-left: calc(0.5rem + var(--sub-nav-indent));
60
+ }
61
+
62
+ .canopy-sub-navigation__link.depth-2 {
63
+ padding-left: calc(0.5rem + var(--sub-nav-indent) * 2);
64
+ }
65
+
66
+ .canopy-sub-navigation__link.depth-3 {
67
+ padding-left: calc(0.5rem + var(--sub-nav-indent) * 3);
68
+ }
69
+
70
+ .canopy-sub-navigation__link.depth-4 {
71
+ padding-left: calc(0.5rem + var(--sub-nav-indent) * 4);
72
+ }
73
+
74
+ .canopy-sub-navigation__link.depth-5 {
75
+ padding-left: calc(0.5rem + var(--sub-nav-indent) * 5);
76
+ }
@@ -0,0 +1,13 @@
1
+ @use "../../variables" as *;
2
+
3
+ @layer components {
4
+ .canopy-header {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ align-items: center;
8
+ gap: 1.618rem;
9
+ padding: 0.618rem 1rem;
10
+ box-shadow: 5px 5px 19px rgba(0, 0, 0, 0.2);
11
+ background: #fff;
12
+ }
13
+ }
@@ -0,0 +1,20 @@
1
+ @use "../../variables" as *;
2
+
3
+ .canopy-logo {
4
+ display: flex;
5
+ align-items: center;
6
+ gap: 0.618rem;
7
+ font-weight: 400;
8
+ font-size: 1.618rem;
9
+ font-family: $font-serif;
10
+ color: $color-gray-default;
11
+
12
+ img {
13
+ height: 1.618rem;
14
+ margin-bottom: -1px;
15
+ }
16
+
17
+ &:hover {
18
+ text-decoration: none;
19
+ }
20
+ }
@@ -0,0 +1,15 @@
1
+ .canopy-navbar {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 1rem;
5
+ font-size: 1rem;
6
+
7
+ a {
8
+ color: var(--color-primary);
9
+ text-decoration: none;
10
+
11
+ &:hover {
12
+ text-decoration: underline;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ @use "./header";
2
+ @use "./logo";
3
+ @use "./navbar";
@@ -1,4 +1,5 @@
1
- @use './card';
2
- @use './command';
3
- @use './header';
4
- @use './hero';
1
+ @use "./card";
2
+ @use "./header";
3
+ @use "./hero";
4
+ @use "./search";
5
+ @use "./sub-navigation";
@@ -0,0 +1,265 @@
1
+ @use '../../variables' as *;
2
+
3
+ .canopy-search-filters-overlay {
4
+ position: fixed;
5
+ inset: 0;
6
+ z-index: 1050;
7
+ display: flex;
8
+ align-items: flex-start;
9
+ justify-content: center;
10
+ background: rgba(15, 23, 42, 0.5);
11
+ padding: 2rem 1rem;
12
+ overflow-y: auto;
13
+ }
14
+
15
+ .canopy-search-filters {
16
+ width: 100%;
17
+ max-width: 48rem;
18
+ overflow: hidden;
19
+ border-radius: 0.75rem;
20
+ background: #fff;
21
+ box-shadow:
22
+ 0 25px 50px -12px rgba(15, 23, 42, 0.4),
23
+ 0 10px 20px rgba(15, 23, 42, 0.12);
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 0;
27
+ }
28
+
29
+ .canopy-search-filters__header {
30
+ display: flex;
31
+ align-items: flex-start;
32
+ justify-content: space-between;
33
+ gap: 1rem;
34
+ border-bottom: 1px solid var(--color-gray-200, #e0e1e6);
35
+ padding: 1rem 1.5rem;
36
+ }
37
+
38
+ .canopy-search-filters__title {
39
+ margin: 0;
40
+ font-size: var(--font-size-lg, 1.125rem);
41
+ line-height: var(--line-height-lg, 1.75rem);
42
+ font-weight: 600;
43
+ color: var(--color-gray-900, #121418);
44
+ }
45
+
46
+ .canopy-search-filters__subtitle {
47
+ margin: 0.25rem 0 0;
48
+ font-size: var(--font-size-sm, 0.875rem);
49
+ line-height: var(--line-height-sm, 1.25rem);
50
+ color: var(--color-gray-500, #8b8d98);
51
+ }
52
+
53
+ .canopy-search-filters__close {
54
+ border-radius: 0.375rem;
55
+ border: 1px solid transparent;
56
+ background: transparent;
57
+ padding: 0.25rem 0.5rem;
58
+ font-size: var(--font-size-sm, 0.875rem);
59
+ color: var(--color-gray-600, #80838d);
60
+ transition: background-color var(--duration-fast, 150ms) var(--easing-standard, ease),
61
+ color var(--duration-fast, 150ms) var(--easing-standard, ease);
62
+
63
+ &:hover {
64
+ background: var(--color-gray-100, #f0f0f3);
65
+ color: var(--color-gray-900, #121418);
66
+ }
67
+ }
68
+
69
+ .canopy-search-filters__body {
70
+ padding: 1.5rem;
71
+ display: grid;
72
+ gap: 1rem;
73
+ }
74
+
75
+ .canopy-search-filters__facets {
76
+ display: flex;
77
+ flex-direction: column;
78
+ gap: 0.75rem;
79
+ }
80
+
81
+ .canopy-search-filters__empty {
82
+ font-size: var(--font-size-sm, 0.875rem);
83
+ line-height: var(--line-height-sm, 1.25rem);
84
+ color: var(--color-gray-500, #8b8d98);
85
+ }
86
+
87
+ .canopy-search-filters__facet {
88
+ border: 1px solid var(--color-gray-200, #e0e1e6);
89
+ border-radius: 0.75rem;
90
+ background: var(--color-gray-50, #fcfcfd);
91
+ overflow: hidden;
92
+
93
+ &[open] {
94
+ background: #fff;
95
+ }
96
+ }
97
+
98
+ .canopy-search-filters__facet-summary {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: space-between;
102
+ gap: 0.75rem;
103
+ padding: 0.75rem 1rem;
104
+ font-size: var(--font-size-sm, 0.875rem);
105
+ font-weight: 600;
106
+ color: var(--color-gray-900, #121418);
107
+ cursor: pointer;
108
+ list-style: none;
109
+ }
110
+
111
+ .canopy-search-filters__facet-summary::-webkit-details-marker {
112
+ display: none;
113
+ }
114
+
115
+ .canopy-search-filters__facet-count {
116
+ font-size: var(--font-size-xs, 0.75rem);
117
+ font-weight: 400;
118
+ color: var(--color-gray-500, #8b8d98);
119
+ }
120
+
121
+ .canopy-search-filters__facet-content {
122
+ border-top: 1px solid var(--color-gray-200, #e0e1e6);
123
+ background: #fff;
124
+ padding: 1rem;
125
+ max-height: 15rem;
126
+ overflow-y: auto;
127
+ }
128
+
129
+ .canopy-search-filters__quick {
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 0.5rem;
133
+ margin-bottom: 0.75rem;
134
+ }
135
+
136
+ .canopy-search-filters__quick-input {
137
+ flex: 1;
138
+ min-width: 0;
139
+ border-radius: 0.5rem;
140
+ border: 1px solid var(--color-gray-300, #cdced6);
141
+ padding: 0.375rem 0.75rem;
142
+ font-size: var(--font-size-sm, 0.875rem);
143
+ color: var(--color-gray-700, #60646c);
144
+ transition: border-color var(--duration-fast, 150ms) var(--easing-standard, ease),
145
+ box-shadow var(--duration-fast, 150ms) var(--easing-standard, ease);
146
+
147
+ &:focus {
148
+ outline: none;
149
+ border-color: var(--color-brand-500, #3e63dd);
150
+ box-shadow: 0 0 0 1px var(--color-brand-500, #3e63dd);
151
+ }
152
+ }
153
+
154
+ .canopy-search-filters__quick-clear {
155
+ border-radius: 0.375rem;
156
+ border: 1px solid var(--color-gray-200, #e0e1e6);
157
+ padding: 0.25rem 0.5rem;
158
+ font-size: var(--font-size-xs, 0.75rem);
159
+ color: var(--color-gray-600, #80838d);
160
+ background: #fff;
161
+ transition: background-color var(--duration-fast, 150ms) var(--easing-standard, ease),
162
+ color var(--duration-fast, 150ms) var(--easing-standard, ease);
163
+
164
+ &:hover {
165
+ background: var(--color-gray-100, #f0f0f3);
166
+ color: var(--color-gray-900, #121418);
167
+ }
168
+ }
169
+
170
+ .canopy-search-filters__facet-list {
171
+ list-style: none;
172
+ margin: 0;
173
+ padding: 0;
174
+ display: flex;
175
+ flex-direction: column;
176
+ gap: 0.5rem;
177
+ font-size: var(--font-size-sm, 0.875rem);
178
+ color: var(--color-gray-700, #60646c);
179
+ }
180
+
181
+ .canopy-search-filters__facet-item {
182
+ display: flex;
183
+ align-items: flex-start;
184
+ gap: 0.5rem;
185
+ }
186
+
187
+ .canopy-search-filters__facet-checkbox {
188
+ margin-top: 0.25rem;
189
+ width: 1rem;
190
+ height: 1rem;
191
+ border-radius: 0.375rem;
192
+ border: 1px solid var(--color-gray-300, #cdced6);
193
+ color: var(--color-brand-500, #3e63dd);
194
+ accent-color: var(--color-brand-500, #3e63dd);
195
+ }
196
+
197
+ .canopy-search-filters__facet-label {
198
+ display: flex;
199
+ flex: 1;
200
+ flex-direction: column;
201
+ gap: 0.25rem;
202
+ }
203
+
204
+ .canopy-search-filters__facet-empty,
205
+ .canopy-search-filters__facet-notice {
206
+ font-size: var(--font-size-xs, 0.75rem);
207
+ color: rgba(148, 163, 184, 0.9);
208
+ }
209
+
210
+ .canopy-search-filters__footer {
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: space-between;
214
+ gap: 1rem;
215
+ border-top: 1px solid var(--color-gray-200, #e0e1e6);
216
+ padding: 1rem 1.5rem;
217
+ font-size: var(--font-size-sm, 0.875rem);
218
+ color: var(--color-gray-500, #8b8d98);
219
+ }
220
+
221
+ .canopy-search-filters__footer-actions {
222
+ display: flex;
223
+ align-items: center;
224
+ gap: 0.5rem;
225
+ }
226
+
227
+ .canopy-search-filters__button {
228
+ border-radius: 0.5rem;
229
+ padding: 0.375rem 0.75rem;
230
+ font-size: var(--font-size-sm, 0.875rem);
231
+ font-weight: 500;
232
+ line-height: var(--line-height-sm, 1.25rem);
233
+ transition:
234
+ background-color var(--duration-fast, 150ms) var(--easing-standard, ease),
235
+ color var(--duration-fast, 150ms) var(--easing-standard, ease),
236
+ box-shadow var(--duration-fast, 150ms) var(--easing-standard, ease);
237
+ }
238
+
239
+ .canopy-search-filters__button--secondary {
240
+ border: 1px solid var(--color-gray-200, #e0e1e6);
241
+ background: #fff;
242
+ color: var(--color-gray-600, #80838d);
243
+
244
+ &:hover:not([disabled]) {
245
+ background: var(--color-gray-100, #f0f0f3);
246
+ color: var(--color-gray-900, #121418);
247
+ }
248
+
249
+ &:disabled {
250
+ cursor: not-allowed;
251
+ color: rgba(148, 163, 184, 0.8);
252
+ }
253
+ }
254
+
255
+ .canopy-search-filters__button--primary {
256
+ border: 1px solid transparent;
257
+ background: var(--color-brand-500, #3e63dd);
258
+ color: #fff;
259
+ box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
260
+
261
+ &:hover {
262
+ background: var(--color-brand-700, #2c4bbd);
263
+ box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
264
+ }
265
+ }
@@ -0,0 +1,171 @@
1
+ @use "../../variables" as *;
2
+
3
+ .canopy-search-form-shell {
4
+ --search-form-label-padding-x: 0.75rem;
5
+ --search-form-label-padding-y: 0.625rem;
6
+ position: relative;
7
+ backdrop-filter: blur(12px);
8
+ background-color: color-mix(in srgb, #fff 95%, transparent);
9
+ transition:
10
+ box-shadow var(--duration-fast, 150ms) ease,
11
+ background-color var(--duration-fast, 150ms) ease;
12
+ cursor: text;
13
+ padding-right: 0.4rem;
14
+
15
+ &::after {
16
+ content: attr(data-placeholder);
17
+ position: absolute;
18
+ left: calc(var(--search-form-label-padding-x) + 1.25rem + 0.5rem);
19
+ right: 5.5rem;
20
+ top: 50%;
21
+ transform: translateY(-50%);
22
+ color: rgba(148, 163, 184, 0.75);
23
+ opacity: 0.75;
24
+ pointer-events: none;
25
+ white-space: nowrap;
26
+ overflow: hidden;
27
+ text-overflow: ellipsis;
28
+ transition: opacity var(--duration-fast, 150ms) ease;
29
+ }
30
+
31
+ &:hover {
32
+ box-shadow: var(
33
+ --shadow-md,
34
+ 0 4px 6px rgba(0, 0, 0, 0.1),
35
+ 0 2px 4px rgba(0, 0, 0, 0.06)
36
+ );
37
+ }
38
+
39
+ &:focus-within::after,
40
+ &[data-has-value="1"]::after {
41
+ opacity: 0;
42
+ }
43
+
44
+ input[data-canopy-search-form-input] {
45
+ width: 100%;
46
+ border: 0;
47
+ outline: none;
48
+ background: transparent;
49
+ box-shadow: none;
50
+ opacity: 0;
51
+ caret-color: transparent;
52
+ transition: opacity var(--duration-fast, 150ms) ease;
53
+ }
54
+
55
+ &:focus-within input[data-canopy-search-form-input],
56
+ &[data-has-value="1"] input[data-canopy-search-form-input] {
57
+ opacity: 1;
58
+ caret-color: var(--color-gray-900, #121418);
59
+ }
60
+ }
61
+
62
+ .canopy-search-form {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: 0.5rem;
66
+ border: 1px solid var(--color-gray-300, #cdced6);
67
+ border-radius: 0.75rem;
68
+ color: var(--color-gray-700, #60646c);
69
+ box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
70
+ transition:
71
+ border-color var(--duration-fast, 150ms) var(--easing-standard, ease),
72
+ box-shadow var(--duration-fast, 150ms) var(--easing-standard, ease),
73
+ background-color var(--duration-fast, 150ms) var(--easing-standard, ease);
74
+
75
+ &:focus-within {
76
+ border-color: var(--color-brand-500, #3e63dd);
77
+ box-shadow:
78
+ 0 0 0 2px
79
+ color-mix(in srgb, var(--color-brand-500, #3e63dd) 45%, transparent),
80
+ var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
81
+
82
+ .canopy-search-form__icon {
83
+ color: var(--color-brand-500, #3e63dd);
84
+ }
85
+ }
86
+
87
+ &[data-has-value="1"] {
88
+ .canopy-search-form__icon {
89
+ color: var(--color-brand-500, #3e63dd);
90
+ }
91
+ }
92
+ }
93
+
94
+ .canopy-search-form__label {
95
+ flex: 1;
96
+ min-width: 0;
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 0.5rem;
100
+ cursor: text;
101
+ padding: var(--search-form-label-padding-y) var(--search-form-label-padding-x);
102
+ }
103
+
104
+ .canopy-search-form__icon {
105
+ width: 1.25rem;
106
+ height: 1.25rem;
107
+ flex-shrink: 0;
108
+ color: var(--color-gray-400, #b9bbc6);
109
+ pointer-events: none;
110
+ transition: color var(--duration-fast, 150ms) var(--easing-standard, ease);
111
+ }
112
+
113
+ .canopy-search-form__input {
114
+ flex: 1;
115
+ min-width: 0;
116
+ padding: 0.125rem 0;
117
+ font-size: var(--font-size-base, 1rem);
118
+ line-height: var(--line-height-base, 1.5rem);
119
+ background: transparent;
120
+ border: 0;
121
+ color: inherit;
122
+ outline: none;
123
+ transition:
124
+ opacity var(--duration-fast, 150ms) var(--easing-standard, ease),
125
+ caret-color var(--duration-fast, 150ms) var(--easing-standard, ease);
126
+
127
+ &::placeholder {
128
+ color: rgba(148, 163, 184, 0.75);
129
+ }
130
+ }
131
+
132
+ .canopy-search-form__submit {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ gap: 0.382rem;
136
+ border-radius: 0.382rem;
137
+ border: 0;
138
+ background: $color-brand-default;
139
+ color: #fff;
140
+ font-weight: 400;
141
+ font-size: 1rem;
142
+ padding: 0.382rem 0.618rem;
143
+ transition:
144
+ background-color var(--duration-fast, 150ms) var(--easing-standard, ease),
145
+ transform var(--duration-fast, 150ms) var(--easing-standard, ease);
146
+ cursor: pointer;
147
+
148
+ &:hover,
149
+ &:focus-visible {
150
+ background: $color-brand-800;
151
+ box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
152
+ }
153
+
154
+ &:focus-visible {
155
+ outline: none;
156
+ box-shadow:
157
+ 0 0 0 2px #fff,
158
+ 0 0 0 4px
159
+ color-mix(in srgb, var(--color-brand-500, #3e63dd) 65%, transparent);
160
+ }
161
+
162
+ &:active {
163
+ transform: translateY(1px);
164
+ }
165
+ }
166
+
167
+ .canopy-search-form__shortcut {
168
+ align-items: center;
169
+ color: inherit;
170
+ opacity: 0.7;
171
+ }