@nulib/canopy 0.0.0 → 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 +109 -3
  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,241 @@
1
+ @use "../buttons" as buttons;
2
+ @use "../../settings/type";
3
+
4
+ .canopy-search-tabs-wrapper {
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ }
10
+
11
+ .canopy-search-results {
12
+ padding: 1.618rem;
13
+ }
14
+
15
+ .canopy-search-tabs {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 0.5rem;
19
+ margin-bottom: 1rem;
20
+
21
+ button {
22
+ @include buttons.canopy-button-base(0.382rem, 0.618rem);
23
+ @include type.ui;
24
+ border: none;
25
+ color: var(--color-gray-muted);
26
+ transition:
27
+ background-color 0.12s ease,
28
+ color 0.12s ease;
29
+
30
+ // A fill under the pointer, the page's text on it: the accent's text step is held on
31
+ // the page, not on a tint.
32
+ &.active,
33
+ &:hover {
34
+ color: var(--color-gray-900);
35
+ background-color: var(--canopy-surface);
36
+ }
37
+ }
38
+ }
39
+
40
+ .canopy-search-form-modal {
41
+ .canopy-search-form-modal__trigger {
42
+ @include buttons.canopy-button-base(0.25rem, 0.5rem);
43
+ gap: 0.25rem;
44
+ border-color: var(--color-gray-200);
45
+ color: var(--color-gray-muted);
46
+ background: var(--color-gray-100);
47
+ }
48
+
49
+ .canopy-search-form-modal__overlay {
50
+ position: fixed;
51
+ inset: 0;
52
+ display: none;
53
+ align-items: flex-start;
54
+ justify-content: center;
55
+ background: rgba(0, 0, 0, 0.3);
56
+ z-index: 9999;
57
+ padding-top: 10vh;
58
+ }
59
+
60
+ .canopy-search-form-modal__panel {
61
+ position: relative;
62
+ background: var(--color-gray-100);
63
+ min-width: 320px;
64
+ max-width: 720px;
65
+ width: 90%;
66
+ overflow: hidden;
67
+ font-family: var(
68
+ --canopy-font-sans,
69
+ system-ui,
70
+ -apple-system,
71
+ "Segoe UI",
72
+ "Helvetica Neue",
73
+ Helvetica,
74
+ Arial,
75
+ sans-serif
76
+ );
77
+ }
78
+
79
+ .canopy-search-form-modal__close {
80
+ @include buttons.canopy-button-base(0.125rem, 0.5rem);
81
+ position: absolute;
82
+ top: 8px;
83
+ right: 8px;
84
+ border-color: var(--color-gray-200);
85
+ background: var(--color-gray-100);
86
+ padding: 2px 6px;
87
+ }
88
+
89
+ .canopy-search-form-modal__inputWrap {
90
+ padding: 10px 12px;
91
+ border-bottom: 1px solid var(--color-gray-200);
92
+ }
93
+
94
+ .canopy-search-form-modal__input {
95
+ width: 100%;
96
+ padding: 8px 10px;
97
+ border: 1px solid var(--color-gray-200);
98
+ outline: none;
99
+ }
100
+
101
+ .canopy-search-form-modal__list {
102
+ max-height: 50vh;
103
+ overflow: auto;
104
+ padding: 6px 0;
105
+ }
106
+
107
+ .canopy-search-form-modal__item {
108
+ display: flex;
109
+ align-items: center;
110
+ gap: 8px;
111
+ }
112
+
113
+ .canopy-search-form-modal__thumb {
114
+ width: 40px;
115
+ height: 40px;
116
+ object-fit: cover;
117
+ }
118
+
119
+ .canopy-search-form-modal__title {
120
+ @include type.ui-sm(bold);
121
+ color: var(--color-gray-900);
122
+ }
123
+ }
124
+
125
+ [data-canopy-search-form-panel] {
126
+ display: none;
127
+ }
128
+
129
+ // The field's suggestions under it (`search-form-runtime.js`): a raised card, its items
130
+ // rows with a fill under the pointer and the focus ring on the one in focus (2.4.7;
131
+ // ACCESSIBILITY.md C32).
132
+ .canopy-search-teaser {
133
+ position: absolute;
134
+ left: 0;
135
+ right: 0;
136
+ top: calc(100% + 0.382rem);
137
+ background: var(--canopy-surface-raised);
138
+ border-radius: var(--canopy-radius-lg);
139
+ box-shadow:
140
+ 0 0 0 1px var(--canopy-edge),
141
+ var(--canopy-shadow-lg);
142
+ z-index: 1000;
143
+ overflow: auto;
144
+ max-height: 60vh;
145
+ padding: 0.382rem 0;
146
+ display: none;
147
+ }
148
+
149
+ .canopy-search-teaser__list {
150
+ display: flex;
151
+ flex-direction: column;
152
+ gap: 0.236rem;
153
+ padding: 0.382rem 0.618rem;
154
+ }
155
+
156
+ // Each type's suggestions, a group named by its label.
157
+ .canopy-search-teaser__group {
158
+ display: flex;
159
+ flex-direction: column;
160
+ gap: 0.236rem;
161
+ }
162
+
163
+ .canopy-search-teaser__label {
164
+ padding: 0.382rem 0.618rem;
165
+ font-weight: var(--canopy-weight-bold);
166
+ font-size: var(--canopy-text-label);
167
+ color: var(--color-gray-muted);
168
+ }
169
+
170
+ .canopy-search-teaser__item {
171
+ display: flex;
172
+ align-items: center;
173
+ gap: 0.618rem;
174
+ padding: 0.382rem;
175
+ border-radius: var(--canopy-radius-md);
176
+ background: transparent;
177
+ box-shadow: none;
178
+ text-decoration: none;
179
+ color: var(--color-gray-900);
180
+ transition: background 120ms ease;
181
+
182
+ // A row, not a card: none of `.canopy-card`'s lift.
183
+ &:hover {
184
+ background: var(--canopy-surface);
185
+ box-shadow: none;
186
+ transform: none;
187
+ }
188
+
189
+ &:focus-visible {
190
+ background: var(--canopy-surface);
191
+ outline: 2px solid var(--color-accent-default);
192
+ outline-offset: -2px;
193
+ }
194
+ }
195
+
196
+ .canopy-search-teaser__thumb {
197
+ flex: 0 0 48px;
198
+ height: 48px;
199
+ overflow: hidden;
200
+ border-radius: var(--canopy-radius-sm);
201
+ background: var(--canopy-surface);
202
+ display: flex;
203
+ align-items: center;
204
+ justify-content: center;
205
+ }
206
+
207
+ .canopy-search-teaser__thumb-img {
208
+ width: 100%;
209
+ height: 100%;
210
+ object-fit: cover;
211
+ }
212
+
213
+ .canopy-search-teaser__text {
214
+ display: flex;
215
+ flex-direction: column;
216
+ gap: 0.15rem;
217
+ min-width: 0;
218
+ }
219
+
220
+ .canopy-search-teaser__title {
221
+ font-weight: var(--canopy-weight-bold);
222
+ font-size: var(--canopy-text-sm);
223
+ line-height: 1.3;
224
+ color: var(--color-gray-900);
225
+ white-space: nowrap;
226
+ overflow: hidden;
227
+ text-overflow: ellipsis;
228
+ }
229
+
230
+ .canopy-search-teaser__meta {
231
+ font-size: var(--canopy-text-label);
232
+ color: var(--color-gray-muted);
233
+ white-space: nowrap;
234
+ overflow: hidden;
235
+ text-overflow: ellipsis;
236
+ }
237
+
238
+ .relative[data-canopy-search-form-auto="1"]:focus-within
239
+ [data-canopy-search-form-panel] {
240
+ display: block;
241
+ }
@@ -0,0 +1,60 @@
1
+ @use "../buttons" as buttons;
2
+ @use "../../settings/focus";
3
+
4
+ .canopy-search-tabs {
5
+ position: relative;
6
+ display: inline-flex;
7
+ gap: 0.5rem;
8
+ border-bottom: 3px solid var(--canopy-edge);
9
+ padding-bottom: 0.25rem;
10
+ }
11
+
12
+ .canopy-search-tab {
13
+ @include buttons.canopy-button-base(0.25rem, 0.75rem);
14
+ position: relative;
15
+ border: none;
16
+ padding-bottom: 0.5rem;
17
+ font-size: var(--canopy-text-sm);
18
+ color: var(--color-gray-muted);
19
+ }
20
+
21
+ // The tab in use: the page's text, bold, and the accent's bar under it.
22
+ .canopy-search-tab.is-active {
23
+ color: var(--color-gray-900);
24
+ font-weight: var(--canopy-weight-bold);
25
+ }
26
+
27
+ .canopy-search-tab:focus-visible {
28
+ outline: 2px solid var(--color-accent-default);
29
+ outline-offset: 2px;
30
+ }
31
+
32
+ .canopy-search-tabs__highlight {
33
+ position: absolute;
34
+ bottom: -3px;
35
+ left: 0;
36
+ height: 3px; /* underline */
37
+ background: var(--color-accent-default);
38
+ pointer-events: none;
39
+ opacity: 0;
40
+ transform: translateX(0);
41
+ transition-property: transform, width, opacity;
42
+ transition-timing-function: ease-out;
43
+ }
44
+
45
+ .canopy-search-tabs__filters-button {
46
+ display: inline-flex;
47
+ align-items: center;
48
+ gap: 0.35rem;
49
+ }
50
+
51
+ .canopy-search-tabs__filters-count {
52
+ font-weight: var(--canopy-weight-bold);
53
+ opacity: 0.8;
54
+ }
55
+
56
+ // The results as the selected tab's panel (`SearchResults`): with no matches it takes
57
+ // focus itself, and shows it (2.4.7).
58
+ .canopy-search-results__panel:focus-visible {
59
+ @include focus.focus-ring;
60
+ }
@@ -0,0 +1,4 @@
1
+ @use "./form";
2
+ @use "./results";
3
+ @use "./filters";
4
+ @use "./tabs";