@nulib/canopy 0.0.0-stage → 2.0.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 (141) hide show
  1. package/bin/canopy.js +16 -0
  2. package/lib/AGENTS.md +107 -0
  3. package/lib/base-path.js +67 -0
  4. package/lib/build/appearance.js +76 -0
  5. package/lib/build/assets.js +30 -0
  6. package/lib/build/build.js +350 -0
  7. package/lib/build/dev.js +1355 -0
  8. package/lib/build/devtoast.config.json +6 -0
  9. package/lib/build/devtoast.css +14 -0
  10. package/lib/build/facets.js +19 -0
  11. package/lib/build/fonts.js +105 -0
  12. package/lib/build/iiif.js +2990 -0
  13. package/lib/build/log.js +31 -0
  14. package/lib/build/mdx.js +1967 -0
  15. package/lib/build/package-names.js +111 -0
  16. package/lib/build/pages.js +420 -0
  17. package/lib/build/rehype-task-list-labels.js +54 -0
  18. package/lib/build/runtimes.js +141 -0
  19. package/lib/build/search-index.js +55 -0
  20. package/lib/build/search-text.js +160 -0
  21. package/lib/build/search-workflow.js +72 -0
  22. package/lib/build/search.js +302 -0
  23. package/lib/build/sitemap.js +197 -0
  24. package/lib/build/styles.js +140 -0
  25. package/lib/build/theme-tokens.js +78 -0
  26. package/lib/build/ui-styles.js +25 -0
  27. package/lib/build/upgrade-notices.js +121 -0
  28. package/lib/cli.js +64 -0
  29. package/lib/common.js +580 -0
  30. package/lib/components/bibliography.js +197 -0
  31. package/lib/components/featured.js +237 -0
  32. package/lib/components/hero-slider-runtime.js +215 -0
  33. package/lib/components/image-story-runtime-entry.js +249 -0
  34. package/lib/components/map-runtime.js +114 -0
  35. package/lib/components/metadata-index.js +32 -0
  36. package/lib/components/nav-place.js +227 -0
  37. package/lib/components/navigation.js +381 -0
  38. package/lib/components/referenced.js +217 -0
  39. package/lib/components/slider-runtime-entry.js +106 -0
  40. package/lib/components/timeline-runtime.js +80 -0
  41. package/lib/components/viewer-runtime-entry.js +88 -0
  42. package/lib/config-path.js +78 -0
  43. package/lib/default-locale.js +113 -0
  44. package/lib/discovery/browser-loader.js +107 -0
  45. package/lib/discovery/browser.js +115 -0
  46. package/lib/discovery/config.js +25 -0
  47. package/lib/discovery/envelope.js +124 -0
  48. package/lib/discovery/export.js +226 -0
  49. package/lib/discovery/ingestion.js +62 -0
  50. package/lib/discovery/pagination.js +66 -0
  51. package/lib/discovery/provenance.js +79 -0
  52. package/lib/discovery/search.js +81 -0
  53. package/lib/discovery/tools.js +155 -0
  54. package/lib/discovery/validation.js +121 -0
  55. package/lib/head.js +154 -0
  56. package/lib/iiif/thumbnail.js +402 -0
  57. package/lib/index.js +9 -0
  58. package/lib/locale-runtime.js +69 -0
  59. package/lib/locales.js +203 -0
  60. package/lib/orchestrator.js +231 -0
  61. package/lib/page-context.js +24 -0
  62. package/lib/search/bundle.js +25 -0
  63. package/lib/search/data.js +202 -0
  64. package/lib/search/engine.js +86 -0
  65. package/lib/search/index-cache.js +95 -0
  66. package/lib/search/search-app.jsx +835 -0
  67. package/lib/search/search-engine-runtime.js +44 -0
  68. package/lib/search/search-form-runtime.js +462 -0
  69. package/lib/search/search.js +676 -0
  70. package/package.json +111 -4
  71. package/types/base-path.d.ts +4 -0
  72. package/types/orchestrator.d.ts +17 -0
  73. package/ui/dist/index.mjs +7358 -0
  74. package/ui/dist/index.mjs.map +7 -0
  75. package/ui/dist/server.mjs +12731 -0
  76. package/ui/dist/server.mjs.map +7 -0
  77. package/ui/fonts/OFL.txt +98 -0
  78. package/ui/fonts/google-sans-flex-latin-ext.woff2 +0 -0
  79. package/ui/fonts/google-sans-flex-latin.woff2 +0 -0
  80. package/ui/fonts/source-serif-4-italic-latin-ext.woff2 +0 -0
  81. package/ui/fonts/source-serif-4-italic-latin.woff2 +0 -0
  82. package/ui/fonts/source-serif-4-latin-ext.woff2 +0 -0
  83. package/ui/fonts/source-serif-4-latin.woff2 +0 -0
  84. package/ui/styles/base/_common.scss +97 -0
  85. package/ui/styles/base/_heading.scss +61 -0
  86. package/ui/styles/base/_markdown.scss +188 -0
  87. package/ui/styles/base/_type.scss +51 -0
  88. package/ui/styles/base/_utilities.scss +7 -0
  89. package/ui/styles/base/index.scss +5 -0
  90. package/ui/styles/components/_article-card.scss +108 -0
  91. package/ui/styles/components/_band.scss +104 -0
  92. package/ui/styles/components/_bibliography.scss +88 -0
  93. package/ui/styles/components/_buttons.scss +143 -0
  94. package/ui/styles/components/_card.scss +109 -0
  95. package/ui/styles/components/_diagram.scss +76 -0
  96. package/ui/styles/components/_feature.scss +66 -0
  97. package/ui/styles/components/_footer.scss +136 -0
  98. package/ui/styles/components/_gallery.scss +476 -0
  99. package/ui/styles/components/_image-story.scss +56 -0
  100. package/ui/styles/components/_interstitial-hero.scss +625 -0
  101. package/ui/styles/components/_layout.scss +83 -0
  102. package/ui/styles/components/_map.scss +296 -0
  103. package/ui/styles/components/_metadata-index.scss +68 -0
  104. package/ui/styles/components/_nav-tree.scss +80 -0
  105. package/ui/styles/components/_referenced-items.scss +69 -0
  106. package/ui/styles/components/_sub-navigation.scss +208 -0
  107. package/ui/styles/components/_swoosh.scss +50 -0
  108. package/ui/styles/components/_timeline.scss +350 -0
  109. package/ui/styles/components/_work.scss +71 -0
  110. package/ui/styles/components/header/_header.scss +294 -0
  111. package/ui/styles/components/header/_logo.scss +99 -0
  112. package/ui/styles/components/header/_navbar.scss +143 -0
  113. package/ui/styles/components/header/index.scss +3 -0
  114. package/ui/styles/components/iiif/_image.scss +32 -0
  115. package/ui/styles/components/iiif/_slider.scss +5 -0
  116. package/ui/styles/components/iiif/index.scss +2 -0
  117. package/ui/styles/components/index.scss +25 -0
  118. package/ui/styles/components/modal/_modal.scss +130 -0
  119. package/ui/styles/components/modal/index.scss +1 -0
  120. package/ui/styles/components/search/_filters.scss +259 -0
  121. package/ui/styles/components/search/_form.scss +187 -0
  122. package/ui/styles/components/search/_panel.scss +7 -0
  123. package/ui/styles/components/search/_results.scss +241 -0
  124. package/ui/styles/components/search/_tabs.scss +60 -0
  125. package/ui/styles/components/search/index.scss +4 -0
  126. package/ui/styles/index.css +5007 -0
  127. package/ui/styles/index.scss +11 -0
  128. package/ui/styles/settings/_breakpoints.scss +7 -0
  129. package/ui/styles/settings/_focus.scss +15 -0
  130. package/ui/styles/settings/_tokens.scss +170 -0
  131. package/ui/styles/settings/_type.scss +126 -0
  132. package/ui/styles/version-parity.css +116 -0
  133. package/ui/tailwind-canopy-iiif-plugin.js +39 -0
  134. package/ui/tailwind-canopy-iiif-preset.js +32 -0
  135. package/ui/tailwind-config.d.ts +29 -0
  136. package/ui/tailwind-config.js +159 -0
  137. package/ui/tailwind-default.config.mjs +4 -0
  138. package/ui/theme-color.js +130 -0
  139. package/ui/theme-palette.js +337 -0
  140. package/ui/theme.js +153 -0
  141. package/README.md +0 -3
@@ -0,0 +1,50 @@
1
+ // `<Swoosh>`: the brush stroke under its words, after Clover's homepage. An SVG shape
2
+ // (`--canopy-swoosh`) used as a mask over the accent's solid step, faint where the pen
3
+ // comes down and full where it lifts, so it takes the site's accent whatever it is. It
4
+ // sits behind the letters, at their foot, so they read over it, and it rises a little to
5
+ // the right. Drawn in once from the left as the page loads; at once where motion is
6
+ // reduced. An inline block, so a phrase wider than the line wraps inside it rather than
7
+ // push the page sideways (1.4.10), the stroke under its last line.
8
+ @layer components {
9
+ .canopy-swoosh {
10
+ display: inline-block;
11
+ max-width: 100%;
12
+ position: relative;
13
+ isolation: isolate;
14
+ z-index: 0;
15
+ }
16
+
17
+ .canopy-swoosh::after {
18
+ content: "";
19
+ position: absolute;
20
+ bottom: -0.1em;
21
+ left: -0.04em;
22
+ right: -0.06em;
23
+ height: 0.42em;
24
+ rotate: 1.5deg;
25
+ z-index: -1;
26
+ background: linear-gradient(
27
+ to right,
28
+ color-mix(in srgb, var(--color-accent-600) 30%, transparent),
29
+ var(--color-accent-600)
30
+ );
31
+ mask: var(--canopy-swoosh) center / 100% 100% no-repeat;
32
+ pointer-events: none;
33
+ }
34
+
35
+ @media (prefers-reduced-motion: no-preference) {
36
+ .canopy-swoosh::after {
37
+ animation: canopy-swoosh-draw 700ms var(--canopy-ease) 300ms both;
38
+ }
39
+ }
40
+
41
+ @keyframes canopy-swoosh-draw {
42
+ from {
43
+ clip-path: inset(0 100% 0 0);
44
+ }
45
+
46
+ to {
47
+ clip-path: inset(0 0 0 0);
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,350 @@
1
+ @use "./buttons" as buttons;
2
+ @use "../settings/type";
3
+
4
+ .canopy-timeline {
5
+ @include type.ui;
6
+ color: var(--color-gray-900);
7
+ display: flex;
8
+ flex-direction: column;
9
+ margin: 2.618rem 0;
10
+ text-align: center;
11
+ --canopy-timeline-spine-width: 1rem;
12
+ --canopy-timeline-connector-length: clamp(2.618rem, 6vw, 2.618rem);
13
+ --canopy-timeline-spine-left: 50%;
14
+ --canopy-timeline-spine-translate: -50%;
15
+ --canopy-timeline-point-offset-left: 50%;
16
+ --canopy-timeline-point-offset-right: 50%;
17
+ --canopy-timeline-spine-center-offset: calc(
18
+ var(--canopy-timeline-spine-width) / 2
19
+ );
20
+ }
21
+
22
+ .canopy-timeline__title {
23
+ @include type.h3;
24
+ margin: 0;
25
+ }
26
+
27
+ .canopy-timeline__description {
28
+ @include type.ui-sm;
29
+ margin: 0;
30
+ color: var(--color-gray-muted);
31
+ }
32
+
33
+ .canopy-timeline__range {
34
+ @include type.h3;
35
+ margin: 0;
36
+ color: var(--color-accent-default);
37
+ }
38
+
39
+ .canopy-timeline__body {
40
+ position: relative;
41
+ padding: 2.618rem;
42
+ }
43
+
44
+ .canopy-timeline__list {
45
+ position: relative;
46
+ min-height: 400px;
47
+ }
48
+
49
+ .canopy-timeline__spine {
50
+ position: absolute;
51
+ top: 0;
52
+ bottom: 0;
53
+ left: var(--canopy-timeline-spine-left);
54
+ transform: translateX(var(--canopy-timeline-spine-translate));
55
+ width: var(--canopy-timeline-spine-width);
56
+ background: var(--color-accent-400);
57
+ z-index: 0;
58
+
59
+ // mask background to create top and bottom fade effect
60
+ -webkit-mask-image: linear-gradient(
61
+ to bottom,
62
+ transparent,
63
+ black 10%,
64
+ black 90%,
65
+ transparent
66
+ );
67
+ mask-image: linear-gradient(
68
+ to bottom,
69
+ transparent,
70
+ black 10%,
71
+ black 90%,
72
+ transparent
73
+ );
74
+ }
75
+
76
+ .canopy-timeline__step {
77
+ position: absolute;
78
+ left: calc(var(--canopy-timeline-spine-left) - 0.75rem);
79
+ margin-top: -1px;
80
+ display: flex;
81
+ pointer-events: none;
82
+ z-index: 1;
83
+
84
+ &--start .canopy-timeline__step-line {
85
+ }
86
+
87
+ &--end .canopy-timeline__step-line {
88
+ }
89
+ }
90
+
91
+ .canopy-timeline__step-line {
92
+ width: 1.5rem;
93
+ height: 0.125rem;
94
+ background: var(--color-gray-50);
95
+ }
96
+
97
+ .canopy-timeline__step-label {
98
+ @include type.ui-sm;
99
+ color: var(--color-gray-muted);
100
+ transform: translateX(0.5rem);
101
+ margin-top: -0.618rem;
102
+ margin-left: -0.382rem;
103
+ }
104
+
105
+ .canopy-timeline__point-wrapper {
106
+ position: absolute;
107
+ width: 50%;
108
+ display: flex;
109
+ align-items: center;
110
+ transform: translateY(-50%);
111
+ }
112
+
113
+ .canopy-timeline__point-wrapper--left {
114
+ right: var(--canopy-timeline-point-offset-right);
115
+ justify-content: flex-end;
116
+ padding-right: 0.2rem;
117
+ text-align: right;
118
+ }
119
+
120
+ .canopy-timeline__point-wrapper--right {
121
+ left: var(--canopy-timeline-point-offset-left);
122
+ justify-content: flex-start;
123
+ padding-left: 0.2rem;
124
+ text-align: left;
125
+ }
126
+
127
+ .canopy-timeline__point,
128
+ .canopy-timeline__group {
129
+ width: min(100%, 28rem);
130
+ padding: 1rem;
131
+ transition: border-color 150ms ease;
132
+ display: flex;
133
+ flex-direction: column;
134
+ }
135
+
136
+ .canopy-timeline__point-date,
137
+ .canopy-timeline__group-point-date {
138
+ @include type.label;
139
+ margin-bottom: 0.382rem;
140
+ }
141
+
142
+ .canopy-timeline__point-title,
143
+ .canopy-timeline__group-point-title {
144
+ @include type.ui(bold);
145
+ display: block;
146
+ color: var(--color-gray-900);
147
+ margin-top: 0.382rem 0;
148
+ }
149
+
150
+ .canopy-timeline__point-summary,
151
+ .canopy-timeline__group-count {
152
+ @include type.ui-sm;
153
+ color: var(--color-gray-muted);
154
+ }
155
+
156
+ .canopy-timeline__connector {
157
+ display: inline-flex;
158
+ align-items: center;
159
+ flex-shrink: 0;
160
+ --canopy-timeline-point-color: var(--color-accent-default);
161
+ }
162
+
163
+ .canopy-timeline__connector-line {
164
+ width: var(--canopy-timeline-connector-length);
165
+ height: 0.125rem;
166
+ background: var(--canopy-timeline-point-color);
167
+ }
168
+
169
+ .canopy-timeline__connector-dot {
170
+ width: 0.618rem;
171
+ height: 0.618rem;
172
+ background: var(--canopy-timeline-point-color);
173
+ border: 2px solid var(--canopy-timeline-point-color);
174
+ }
175
+
176
+ .canopy-timeline__connector-dot.is-active {
177
+ width: 1rem;
178
+ height: 1rem;
179
+ background: var(--canopy-timeline-point-color);
180
+ border-color: var(--canopy-timeline-point-color);
181
+ }
182
+
183
+ .canopy-timeline__key {
184
+ margin-top: 1rem;
185
+ display: flex;
186
+ justify-content: center;
187
+ }
188
+
189
+ .canopy-timeline__key-list {
190
+ list-style: none;
191
+ margin: 0;
192
+ padding: 0;
193
+ display: flex;
194
+ flex-wrap: wrap;
195
+ gap: 0.5rem 1.25rem;
196
+ justify-content: center;
197
+ }
198
+
199
+ .canopy-timeline__key-item {
200
+ display: inline-flex;
201
+ align-items: center;
202
+ gap: 0.382rem;
203
+ @include type.ui-sm;
204
+ color: var(--color-gray-800);
205
+ }
206
+
207
+ .canopy-timeline__key-dot {
208
+ width: 0.618rem;
209
+ height: 0.618rem;
210
+ background: var(--color-accent-default);
211
+ }
212
+
213
+ .canopy-timeline__key-label {
214
+ font-weight: var(--canopy-weight-bold);
215
+ }
216
+
217
+ .canopy-timeline__resources {
218
+ margin-top: 1rem;
219
+ }
220
+
221
+ .canopy-timeline__resources-list {
222
+ list-style: none;
223
+ margin: 0;
224
+ padding: 0;
225
+ display: flex;
226
+ flex-direction: column;
227
+ gap: 0.75rem;
228
+ }
229
+
230
+ .canopy-teaser-card {
231
+ width: 100%;
232
+ }
233
+
234
+ .canopy-timeline__group-header {
235
+ display: flex;
236
+ justify-content: space-between;
237
+ gap: 0.75rem;
238
+ align-items: center;
239
+ }
240
+
241
+ .canopy-timeline__group-summary {
242
+ display: flex;
243
+ flex-direction: column;
244
+ }
245
+
246
+ .canopy-timeline__group-toggle {
247
+ @include buttons.canopy-button-base(0.25rem, 0.5rem);
248
+ @include type.ui(bold);
249
+ border: none;
250
+ color: var(--color-accent-default);
251
+ }
252
+
253
+ .canopy-timeline__group-points {
254
+ margin-top: 0.75rem;
255
+ display: flex;
256
+ flex-direction: column;
257
+ gap: 0.5rem;
258
+ }
259
+
260
+ .canopy-timeline__group-point {
261
+ @include buttons.canopy-button-base(0.75rem, 1rem);
262
+ width: 100%;
263
+ border-color: var(--color-gray-200);
264
+ background: var(--color-gray-50);
265
+ text-align: left;
266
+ }
267
+
268
+ .canopy-timeline__group-point.is-active {
269
+ border-color: var(--color-accent-400);
270
+ }
271
+
272
+ .canopy-timeline--align-left {
273
+ text-align: left;
274
+ --canopy-timeline-spine-left: 0%;
275
+ --canopy-timeline-spine-translate: 0;
276
+ --canopy-timeline-point-offset-left: var(
277
+ --canopy-timeline-spine-center-offset
278
+ );
279
+ --canopy-timeline-point-offset-right: 0%;
280
+ }
281
+
282
+ .canopy-timeline--align-left .canopy-timeline__point-wrapper {
283
+ width: calc(100% - var(--canopy-timeline-point-offset-left));
284
+ max-width: 100%;
285
+ }
286
+
287
+ .canopy-timeline--align-right {
288
+ text-align: right;
289
+ --canopy-timeline-spine-left: 100%;
290
+ --canopy-timeline-spine-translate: -100%;
291
+ --canopy-timeline-point-offset-left: 0%;
292
+ --canopy-timeline-point-offset-right: var(
293
+ --canopy-timeline-spine-center-offset
294
+ );
295
+ }
296
+
297
+ .canopy-timeline--align-right .canopy-timeline__point-wrapper {
298
+ width: calc(100% - var(--canopy-timeline-point-offset-right));
299
+ max-width: 100%;
300
+ }
301
+
302
+ @media (max-width: 900px) {
303
+ .canopy-timeline__list {
304
+ height: unset;
305
+ min-height: unset !important;
306
+ }
307
+
308
+ .canopy-timeline__point-wrapper {
309
+ position: static;
310
+ width: 100%;
311
+ padding: 0 !important;
312
+ margin-bottom: 1rem;
313
+ transform: none;
314
+ }
315
+
316
+ .canopy-timeline--align-left .canopy-timeline__point-wrapper,
317
+ .canopy-timeline--align-right .canopy-timeline__point-wrapper {
318
+ width: 100%;
319
+ }
320
+
321
+ .canopy-timeline__point-wrapper--left {
322
+ justify-content: flex-start;
323
+ text-align: left;
324
+ }
325
+
326
+ .canopy-timeline__list {
327
+ min-height: auto;
328
+ }
329
+
330
+ .canopy-timeline__spine {
331
+ left: -1.5rem;
332
+ transform: none;
333
+ width: 0.35rem;
334
+ display: none;
335
+ }
336
+
337
+ .canopy-timeline__step,
338
+ .canopy-timeline__connector {
339
+ display: none;
340
+ }
341
+
342
+ .canopy-timeline__point,
343
+ .canopy-timeline__group {
344
+ width: 100%;
345
+ }
346
+
347
+ .canopy-timeline__body {
348
+ padding: 1rem 0 0;
349
+ }
350
+ }
@@ -0,0 +1,71 @@
1
+ @use "../settings/type";
2
+ @layer components {
3
+ .canopy-work--layout {
4
+ --canopy-work-gap: clamp(1.5rem, 3vw, 2.75rem);
5
+ display: flex;
6
+ gap: var(--canopy-work-gap);
7
+ align-items: flex-start;
8
+ flex-wrap: nowrap;
9
+ }
10
+
11
+ .canopy-work--layout > * {
12
+ flex: 1 1 50%;
13
+ min-width: 0;
14
+ }
15
+
16
+ .canopy-work--primary,
17
+ .canopy-work--secondary {
18
+ flex: 1 1 50%;
19
+ }
20
+
21
+ // The Viewer lifted off the page, as a card is: a hairline edge and a soft shadow, its
22
+ // corners `--canopy-radius-xl`.
23
+ .canopy-work--primary > [data-canopy-viewer] {
24
+ overflow: hidden;
25
+ border-radius: var(--canopy-radius-xl);
26
+ background-color: var(--canopy-surface-raised);
27
+ box-shadow: var(--canopy-card-shadow);
28
+ }
29
+
30
+ @media (max-width: 960px) {
31
+ .canopy-work--layout {
32
+ flex-direction: column;
33
+ }
34
+
35
+ .canopy-work--primary,
36
+ .canopy-work--secondary {
37
+ flex-basis: 100%;
38
+ width: 100%;
39
+ }
40
+ }
41
+
42
+ body.canopy-type-work {
43
+ main {
44
+ h1 {
45
+ @include type.title;
46
+ margin: 1.618rem 0 1rem;
47
+ }
48
+
49
+ dl {
50
+ padding: 0;
51
+ }
52
+
53
+ dl > div {
54
+ display: grid;
55
+ gap: 0.2rem;
56
+ padding: 0.85rem 0;
57
+ }
58
+
59
+ dt {
60
+ @include type.label;
61
+ margin: 0;
62
+ }
63
+
64
+ dd {
65
+ @include type.ui;
66
+ margin: 0;
67
+ color: var(--color-gray-900);
68
+ }
69
+ }
70
+ }
71
+ }