@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.
- package/bin/canopy.js +16 -0
- package/lib/AGENTS.md +107 -0
- package/lib/base-path.js +67 -0
- package/lib/build/appearance.js +76 -0
- package/lib/build/assets.js +30 -0
- package/lib/build/build.js +350 -0
- package/lib/build/dev.js +1355 -0
- package/lib/build/devtoast.config.json +6 -0
- package/lib/build/devtoast.css +14 -0
- package/lib/build/facets.js +19 -0
- package/lib/build/fonts.js +105 -0
- package/lib/build/iiif.js +2990 -0
- package/lib/build/log.js +31 -0
- package/lib/build/mdx.js +1967 -0
- package/lib/build/package-names.js +111 -0
- package/lib/build/pages.js +420 -0
- package/lib/build/rehype-task-list-labels.js +54 -0
- package/lib/build/runtimes.js +141 -0
- package/lib/build/search-index.js +55 -0
- package/lib/build/search-text.js +160 -0
- package/lib/build/search-workflow.js +72 -0
- package/lib/build/search.js +302 -0
- package/lib/build/sitemap.js +197 -0
- package/lib/build/styles.js +140 -0
- package/lib/build/theme-tokens.js +78 -0
- package/lib/build/ui-styles.js +25 -0
- package/lib/build/upgrade-notices.js +121 -0
- package/lib/cli.js +64 -0
- package/lib/common.js +580 -0
- package/lib/components/bibliography.js +197 -0
- package/lib/components/featured.js +237 -0
- package/lib/components/hero-slider-runtime.js +215 -0
- package/lib/components/image-story-runtime-entry.js +249 -0
- package/lib/components/map-runtime.js +114 -0
- package/lib/components/metadata-index.js +32 -0
- package/lib/components/nav-place.js +227 -0
- package/lib/components/navigation.js +381 -0
- package/lib/components/referenced.js +217 -0
- package/lib/components/slider-runtime-entry.js +106 -0
- package/lib/components/timeline-runtime.js +80 -0
- package/lib/components/viewer-runtime-entry.js +88 -0
- package/lib/config-path.js +78 -0
- package/lib/default-locale.js +113 -0
- package/lib/discovery/browser-loader.js +107 -0
- package/lib/discovery/browser.js +115 -0
- package/lib/discovery/config.js +25 -0
- package/lib/discovery/envelope.js +124 -0
- package/lib/discovery/export.js +226 -0
- package/lib/discovery/ingestion.js +62 -0
- package/lib/discovery/pagination.js +66 -0
- package/lib/discovery/provenance.js +79 -0
- package/lib/discovery/search.js +81 -0
- package/lib/discovery/tools.js +155 -0
- package/lib/discovery/validation.js +121 -0
- package/lib/head.js +154 -0
- package/lib/iiif/thumbnail.js +402 -0
- package/lib/index.js +9 -0
- package/lib/locale-runtime.js +69 -0
- package/lib/locales.js +203 -0
- package/lib/orchestrator.js +231 -0
- package/lib/page-context.js +24 -0
- package/lib/search/bundle.js +25 -0
- package/lib/search/data.js +202 -0
- package/lib/search/engine.js +86 -0
- package/lib/search/index-cache.js +95 -0
- package/lib/search/search-app.jsx +835 -0
- package/lib/search/search-engine-runtime.js +44 -0
- package/lib/search/search-form-runtime.js +462 -0
- package/lib/search/search.js +676 -0
- package/package.json +109 -3
- package/types/base-path.d.ts +4 -0
- package/types/orchestrator.d.ts +17 -0
- package/ui/dist/index.mjs +7358 -0
- package/ui/dist/index.mjs.map +7 -0
- package/ui/dist/server.mjs +12731 -0
- package/ui/dist/server.mjs.map +7 -0
- package/ui/fonts/OFL.txt +98 -0
- package/ui/fonts/google-sans-flex-latin-ext.woff2 +0 -0
- package/ui/fonts/google-sans-flex-latin.woff2 +0 -0
- package/ui/fonts/source-serif-4-italic-latin-ext.woff2 +0 -0
- package/ui/fonts/source-serif-4-italic-latin.woff2 +0 -0
- package/ui/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/ui/fonts/source-serif-4-latin.woff2 +0 -0
- package/ui/styles/base/_common.scss +97 -0
- package/ui/styles/base/_heading.scss +61 -0
- package/ui/styles/base/_markdown.scss +188 -0
- package/ui/styles/base/_type.scss +51 -0
- package/ui/styles/base/_utilities.scss +7 -0
- package/ui/styles/base/index.scss +5 -0
- package/ui/styles/components/_article-card.scss +108 -0
- package/ui/styles/components/_band.scss +104 -0
- package/ui/styles/components/_bibliography.scss +88 -0
- package/ui/styles/components/_buttons.scss +143 -0
- package/ui/styles/components/_card.scss +109 -0
- package/ui/styles/components/_diagram.scss +76 -0
- package/ui/styles/components/_feature.scss +66 -0
- package/ui/styles/components/_footer.scss +136 -0
- package/ui/styles/components/_gallery.scss +476 -0
- package/ui/styles/components/_image-story.scss +56 -0
- package/ui/styles/components/_interstitial-hero.scss +625 -0
- package/ui/styles/components/_layout.scss +83 -0
- package/ui/styles/components/_map.scss +296 -0
- package/ui/styles/components/_metadata-index.scss +68 -0
- package/ui/styles/components/_nav-tree.scss +80 -0
- package/ui/styles/components/_referenced-items.scss +69 -0
- package/ui/styles/components/_sub-navigation.scss +208 -0
- package/ui/styles/components/_swoosh.scss +50 -0
- package/ui/styles/components/_timeline.scss +350 -0
- package/ui/styles/components/_work.scss +71 -0
- package/ui/styles/components/header/_header.scss +294 -0
- package/ui/styles/components/header/_logo.scss +99 -0
- package/ui/styles/components/header/_navbar.scss +143 -0
- package/ui/styles/components/header/index.scss +3 -0
- package/ui/styles/components/iiif/_image.scss +32 -0
- package/ui/styles/components/iiif/_slider.scss +5 -0
- package/ui/styles/components/iiif/index.scss +2 -0
- package/ui/styles/components/index.scss +25 -0
- package/ui/styles/components/modal/_modal.scss +130 -0
- package/ui/styles/components/modal/index.scss +1 -0
- package/ui/styles/components/search/_filters.scss +259 -0
- package/ui/styles/components/search/_form.scss +187 -0
- package/ui/styles/components/search/_panel.scss +7 -0
- package/ui/styles/components/search/_results.scss +241 -0
- package/ui/styles/components/search/_tabs.scss +60 -0
- package/ui/styles/components/search/index.scss +4 -0
- package/ui/styles/index.css +5007 -0
- package/ui/styles/index.scss +11 -0
- package/ui/styles/settings/_breakpoints.scss +7 -0
- package/ui/styles/settings/_focus.scss +15 -0
- package/ui/styles/settings/_tokens.scss +170 -0
- package/ui/styles/settings/_type.scss +126 -0
- package/ui/styles/version-parity.css +116 -0
- package/ui/tailwind-canopy-iiif-plugin.js +39 -0
- package/ui/tailwind-canopy-iiif-preset.js +32 -0
- package/ui/tailwind-config.d.ts +29 -0
- package/ui/tailwind-config.js +159 -0
- package/ui/tailwind-default.config.mjs +4 -0
- package/ui/theme-color.js +130 -0
- package/ui/theme-palette.js +337 -0
- package/ui/theme.js +153 -0
- package/README.md +0 -3
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@use "../buttons" as buttons;
|
|
2
|
+
@use "../../settings/focus" as focus;
|
|
3
|
+
@use "../../settings/type";
|
|
4
|
+
|
|
5
|
+
@layer components {
|
|
6
|
+
.canopy-modal {
|
|
7
|
+
position: fixed;
|
|
8
|
+
inset: 0;
|
|
9
|
+
z-index: 50;
|
|
10
|
+
display: none;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
background: #0006;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
padding: clamp(1.25rem, 4vw, 2.5rem);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.canopy-modal[data-open="true"] {
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.canopy-modal__panel {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
width: 400px;
|
|
28
|
+
max-width: 400px;
|
|
29
|
+
max-height: min(90vh, 640px);
|
|
30
|
+
border-radius: var(--canopy-radius-xl);
|
|
31
|
+
background: var(--color-gray-50);
|
|
32
|
+
box-shadow:
|
|
33
|
+
0 0 0 1px var(--canopy-edge),
|
|
34
|
+
var(--canopy-shadow-lg);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
margin: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.canopy-modal__body {
|
|
40
|
+
flex: 1 1 auto;
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.canopy-modal__body--padded {
|
|
45
|
+
padding: 1.618rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.canopy-modal__brand {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 0.75rem;
|
|
52
|
+
margin-bottom: 1.25rem;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
padding-right: 3rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.canopy-modal__brand .canopy-logo {
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.canopy-modal__brand-link {
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.canopy-modal__title {
|
|
68
|
+
@include type.h3;
|
|
69
|
+
margin: 0 0 1rem;
|
|
70
|
+
color: var(--color-gray-900);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.canopy-modal__close {
|
|
74
|
+
@include buttons.canopy-button-base(0.25rem, 0.75rem);
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0.75rem;
|
|
77
|
+
right: 0.75rem;
|
|
78
|
+
width: 2.5rem;
|
|
79
|
+
height: 2.5rem;
|
|
80
|
+
padding: 0;
|
|
81
|
+
color: var(--color-gray-900);
|
|
82
|
+
border: none;
|
|
83
|
+
border-radius: var(--canopy-radius-pill);
|
|
84
|
+
background: var(--color-gray-50);
|
|
85
|
+
|
|
86
|
+
svg path {
|
|
87
|
+
stroke-width: 2.618px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.canopy-modal__close:hover {
|
|
92
|
+
background: var(--canopy-surface);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// The focus ring, inside the panel that clips (2.4.7; ACCESSIBILITY.md C36).
|
|
96
|
+
.canopy-modal__close:focus-visible {
|
|
97
|
+
@include focus.focus-ring($inset: true);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.canopy-modal__close-icon {
|
|
101
|
+
width: 1.25rem;
|
|
102
|
+
height: 1.25rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (max-width: 48rem) {
|
|
106
|
+
.canopy-modal {
|
|
107
|
+
align-items: stretch;
|
|
108
|
+
justify-content: stretch;
|
|
109
|
+
padding: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.canopy-modal__panel {
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
max-height: none;
|
|
116
|
+
margin: 0;
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
box-shadow: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.canopy-modal__close {
|
|
122
|
+
top: 1rem;
|
|
123
|
+
right: 1rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.canopy-modal__brand {
|
|
127
|
+
margin-bottom: 1rem;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "./modal";
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
@use "../buttons" as buttons;
|
|
2
|
+
@use "../../settings/focus" as focus;
|
|
3
|
+
@use "../../settings/type";
|
|
4
|
+
|
|
5
|
+
@layer components {
|
|
6
|
+
.canopy-modal--filters {
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
justify-content: stretch;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.canopy-modal--filters .canopy-modal__panel {
|
|
13
|
+
width: min(100%, 48rem);
|
|
14
|
+
height: 100%;
|
|
15
|
+
max-height: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.canopy-modal--filters .canopy-modal__body--filters {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 1.5rem;
|
|
23
|
+
padding: 1.5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.canopy-search-filters__subtitle {
|
|
27
|
+
@include type.ui-sm;
|
|
28
|
+
margin: 0 0 0.75rem;
|
|
29
|
+
color: var(--color-gray-muted);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.canopy-search-filters__body {
|
|
33
|
+
display: grid;
|
|
34
|
+
gap: 1rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.canopy-search-filters__facets {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 0.75rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.canopy-search-filters__empty {
|
|
44
|
+
@include type.ui-sm;
|
|
45
|
+
color: var(--color-gray-muted);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Each facet a panel: a solid fill, rounded, no outline around it.
|
|
49
|
+
.canopy-search-filters__facet {
|
|
50
|
+
border-radius: var(--canopy-radius-lg);
|
|
51
|
+
background: var(--canopy-surface);
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.canopy-search-filters__facet-summary {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: space-between;
|
|
59
|
+
gap: 0.75rem;
|
|
60
|
+
padding: 0.75rem 1rem;
|
|
61
|
+
@include type.ui-sm(bold);
|
|
62
|
+
color: var(--color-gray-900);
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
list-style: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Inside, as the facet clips what stands outside it.
|
|
68
|
+
.canopy-search-filters__facet-summary:focus-visible {
|
|
69
|
+
@include focus.focus-ring($inset: true);
|
|
70
|
+
border-radius: var(--canopy-radius-lg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.canopy-search-filters__facet-summary::-webkit-details-marker {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.canopy-search-filters__facet-count {
|
|
78
|
+
@include type.ui-sm;
|
|
79
|
+
color: var(--color-gray-muted);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.canopy-search-filters__facet-content {
|
|
83
|
+
border-top: 1px solid var(--canopy-edge);
|
|
84
|
+
padding: 1rem;
|
|
85
|
+
max-height: 15rem;
|
|
86
|
+
overflow-y: auto;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.canopy-search-filters__quick {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 0.5rem;
|
|
93
|
+
margin-bottom: 0.75rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Its edge 3:1 against the panel (1.4.11; ACCESSIBILITY.md C35) and its placeholder
|
|
97
|
+
// the muted text (1.4.3; C31).
|
|
98
|
+
.canopy-search-filters__quick-input {
|
|
99
|
+
flex: 1;
|
|
100
|
+
min-width: 0;
|
|
101
|
+
border: 1px solid var(--canopy-control-edge);
|
|
102
|
+
border-radius: var(--canopy-radius-md);
|
|
103
|
+
background-color: var(--color-gray-50);
|
|
104
|
+
padding: 0.375rem 0.75rem;
|
|
105
|
+
@include type.ui-sm;
|
|
106
|
+
color: var(--color-gray-muted);
|
|
107
|
+
transition: border-color 120ms ease;
|
|
108
|
+
|
|
109
|
+
// Drawn inside, over the edge, where the filters' panel would clip a ring outside.
|
|
110
|
+
&::placeholder {
|
|
111
|
+
color: var(--color-gray-muted);
|
|
112
|
+
opacity: 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:focus {
|
|
116
|
+
outline: 2px solid var(--color-accent-default);
|
|
117
|
+
outline-offset: -1px;
|
|
118
|
+
border-color: var(--color-accent-default);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.canopy-search-filters__quick-clear {
|
|
123
|
+
border: 1px solid var(--canopy-control-edge);
|
|
124
|
+
border-radius: var(--canopy-radius-md);
|
|
125
|
+
min-height: 24px;
|
|
126
|
+
padding: 0.25rem 0.5rem;
|
|
127
|
+
@include type.ui-sm;
|
|
128
|
+
color: var(--color-gray-muted);
|
|
129
|
+
background: var(--color-gray-100);
|
|
130
|
+
transition:
|
|
131
|
+
background-color 120ms ease,
|
|
132
|
+
color 120ms ease;
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
background: var(--color-gray-100);
|
|
136
|
+
color: var(--color-gray-900);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.canopy-search-filters__facet-list {
|
|
141
|
+
list-style: none;
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0;
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
gap: 0.5rem;
|
|
147
|
+
@include type.ui-sm;
|
|
148
|
+
color: var(--color-gray-muted);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.canopy-search-filters__facet-item {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: flex-start;
|
|
154
|
+
gap: 0.5rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.canopy-search-filters__facet-checkbox {
|
|
158
|
+
margin-top: 0.25rem;
|
|
159
|
+
width: 1rem;
|
|
160
|
+
height: 1rem;
|
|
161
|
+
border: 1px solid var(--color-gray-300);
|
|
162
|
+
// The accent's text step, so the checked box holds 3:1 on the page (1.4.11).
|
|
163
|
+
color: var(--color-accent-default);
|
|
164
|
+
accent-color: var(--color-accent-default);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.canopy-search-filters__facet-label {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex: 1;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 0.25rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.canopy-search-filters__facet-empty {
|
|
175
|
+
@include type.ui-sm;
|
|
176
|
+
color: var(--color-gray-muted);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.canopy-search-filters__footer {
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-wrap: wrap;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
gap: 0.75rem;
|
|
185
|
+
border-top: 1px solid var(--canopy-edge);
|
|
186
|
+
padding-top: 1.25rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.canopy-search-filters__footer-actions {
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
gap: 0.75rem;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.canopy-search-filters__button {
|
|
196
|
+
@include buttons.canopy-button-base(0.5rem, 1.25rem);
|
|
197
|
+
min-height: 2.5rem;
|
|
198
|
+
border-radius: var(--canopy-radius-lg);
|
|
199
|
+
@include type.ui-sm;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.canopy-search-filters__button--secondary {
|
|
203
|
+
border: 1px solid var(--canopy-control-edge);
|
|
204
|
+
color: var(--color-gray-900);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.canopy-search-filters__button--secondary:hover,
|
|
208
|
+
.canopy-search-filters__button--secondary:focus-visible {
|
|
209
|
+
background: var(--color-gray-100);
|
|
210
|
+
color: var(--color-gray-900);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Nothing to clear: in place and focusable, its words muted.
|
|
214
|
+
.canopy-search-filters__button--secondary[aria-disabled="true"] {
|
|
215
|
+
color: var(--color-gray-muted);
|
|
216
|
+
cursor: not-allowed;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// A primary button as `.canopy-button--primary` draws one: its label on the accent's
|
|
220
|
+
// text step, and darker (lighter, in dark mode) under the pointer, both at 4.5:1.
|
|
221
|
+
.canopy-search-filters__button--primary {
|
|
222
|
+
border: none;
|
|
223
|
+
background: var(--color-accent-default);
|
|
224
|
+
color: var(--color-accent-50);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.canopy-search-filters__button--primary:hover,
|
|
228
|
+
.canopy-search-filters__button--primary:focus-visible {
|
|
229
|
+
background: var(--color-accent-hover);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.canopy-search-filters__button:focus-visible {
|
|
233
|
+
@include focus.focus-ring;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (max-width: 48rem) {
|
|
237
|
+
.canopy-modal--filters .canopy-modal__body--filters {
|
|
238
|
+
padding: 1.5rem 1.25rem 2rem 1.25rem;
|
|
239
|
+
gap: 1.25rem;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.canopy-search-filters__subtitle {
|
|
243
|
+
margin-bottom: 0.5rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.canopy-search-filters__facet-content {
|
|
247
|
+
max-height: 40vh;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.canopy-search-filters__footer {
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
align-items: stretch;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.canopy-search-filters__footer-actions {
|
|
256
|
+
justify-content: flex-end;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
@use "../buttons" as buttons;
|
|
2
|
+
@use "../../settings/type";
|
|
3
|
+
|
|
4
|
+
// The search field (`SearchPanelForm`, in the header and the search dialog): a pill on
|
|
5
|
+
// the page's ground, its edge 3:1 against it (`--canopy-control-edge`, 1.4.11), the icon
|
|
6
|
+
// and the query at its start, the shortcut's hint and the submit at its end. Focused, its
|
|
7
|
+
// edge is the accent's text step, twice as thick: the input itself draws no outline.
|
|
8
|
+
.canopy-search-form-shell {
|
|
9
|
+
--search-form-label-padding-x: 0.75rem;
|
|
10
|
+
--search-form-label-padding-y: 0.382rem;
|
|
11
|
+
position: relative;
|
|
12
|
+
background-color: var(--color-gray-50);
|
|
13
|
+
cursor: text;
|
|
14
|
+
|
|
15
|
+
svg {
|
|
16
|
+
width: 1.25rem;
|
|
17
|
+
height: 1.25rem;
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
fill: currentColor;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
input[data-canopy-search-form-input] {
|
|
24
|
+
width: 100%;
|
|
25
|
+
border: 0;
|
|
26
|
+
outline: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.canopy-search-form {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 0.25rem;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
min-height: 2.75rem;
|
|
36
|
+
padding: 0.236rem;
|
|
37
|
+
border: 1px solid var(--canopy-control-edge);
|
|
38
|
+
border-radius: var(--canopy-radius-pill);
|
|
39
|
+
color: var(--color-gray-muted);
|
|
40
|
+
transition:
|
|
41
|
+
border-color 120ms ease,
|
|
42
|
+
box-shadow 120ms ease;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
border-color: var(--color-gray-muted);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus-within {
|
|
49
|
+
border-color: var(--color-accent-default);
|
|
50
|
+
box-shadow: inset 0 0 0 1px var(--color-accent-default);
|
|
51
|
+
|
|
52
|
+
.canopy-search-form__icon {
|
|
53
|
+
color: var(--color-accent-default);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-has-value="1"] {
|
|
58
|
+
.canopy-search-form__icon {
|
|
59
|
+
color: var(--color-accent-default);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.canopy-search-form__label {
|
|
65
|
+
flex: 1;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 0.5rem;
|
|
70
|
+
cursor: text;
|
|
71
|
+
padding: var(--search-form-label-padding-y) 0.25rem var(--search-form-label-padding-y)
|
|
72
|
+
var(--search-form-label-padding-x);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.canopy-search-form__clear {
|
|
76
|
+
@include buttons.canopy-button-base(0, 0);
|
|
77
|
+
flex: none;
|
|
78
|
+
width: 1.75rem;
|
|
79
|
+
height: 1.75rem;
|
|
80
|
+
border: none;
|
|
81
|
+
border-radius: var(--canopy-radius-pill);
|
|
82
|
+
background: none;
|
|
83
|
+
color: var(--color-gray-muted);
|
|
84
|
+
font-size: var(--canopy-text-xl);
|
|
85
|
+
line-height: 1;
|
|
86
|
+
|
|
87
|
+
&:hover {
|
|
88
|
+
background-color: var(--canopy-surface);
|
|
89
|
+
color: var(--color-gray-900);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:focus-visible {
|
|
93
|
+
outline: 2px solid var(--color-accent-default);
|
|
94
|
+
outline-offset: 0;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The query and its placeholder: the page's text, and the muted text, 4.5:1 on the field
|
|
99
|
+
// (1.4.3; ACCESSIBILITY.md C31). Browsers draw a placeholder paler than its color
|
|
100
|
+
// otherwise (Firefox at half opacity).
|
|
101
|
+
.canopy-search-form__input {
|
|
102
|
+
flex: 1;
|
|
103
|
+
min-width: 0;
|
|
104
|
+
padding: 0.125rem 0;
|
|
105
|
+
@include type.ui;
|
|
106
|
+
border: 0;
|
|
107
|
+
background: transparent;
|
|
108
|
+
color: var(--color-gray-900);
|
|
109
|
+
outline: none;
|
|
110
|
+
|
|
111
|
+
&::placeholder {
|
|
112
|
+
color: var(--color-gray-muted);
|
|
113
|
+
opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// The shortcut that focuses the field (⌘K, or Ctrl K), filled in and shown by the search
|
|
118
|
+
// runtime, which knows the platform; spoken through the input's `aria-keyshortcuts`
|
|
119
|
+
// instead. Out of the way while the field is in use, and on screens with no keyboard.
|
|
120
|
+
.canopy-search-form__hotkey {
|
|
121
|
+
flex: none;
|
|
122
|
+
padding: 0.0625rem 0.382rem;
|
|
123
|
+
border: 1px solid var(--canopy-edge);
|
|
124
|
+
border-radius: var(--canopy-radius-sm);
|
|
125
|
+
background-color: var(--canopy-surface);
|
|
126
|
+
@include type.ui-sm;
|
|
127
|
+
color: var(--color-gray-muted);
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
|
|
130
|
+
&[hidden] {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.canopy-search-form:is(:focus-within, [data-has-value="1"]) .canopy-search-form__hotkey {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media (hover: none) {
|
|
140
|
+
.canopy-search-form__hotkey {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// The submit: a filled pill inside the field, its label 4.5:1 on the fill and under the
|
|
146
|
+
// pointer (`--color-accent-hover`). Its focus is drawn inside, as the field's edge sits
|
|
147
|
+
// right against it.
|
|
148
|
+
.canopy-search-form__submit {
|
|
149
|
+
@include buttons.canopy-button-base(0.236rem, 1rem);
|
|
150
|
+
flex: none;
|
|
151
|
+
min-height: 2.25rem;
|
|
152
|
+
border-color: var(--color-accent-default);
|
|
153
|
+
border-radius: var(--canopy-radius-pill);
|
|
154
|
+
background: var(--color-accent-default);
|
|
155
|
+
color: var(--color-accent-50);
|
|
156
|
+
@include type.ui-sm;
|
|
157
|
+
gap: 0.382rem;
|
|
158
|
+
transition:
|
|
159
|
+
background-color 120ms ease,
|
|
160
|
+
transform 120ms ease;
|
|
161
|
+
|
|
162
|
+
&:hover,
|
|
163
|
+
&:focus-visible {
|
|
164
|
+
border-color: var(--color-accent-hover);
|
|
165
|
+
background: var(--color-accent-hover);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:focus-visible {
|
|
169
|
+
outline: 2px solid var(--color-accent-50);
|
|
170
|
+
outline-offset: -4px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&:active {
|
|
174
|
+
transform: translateY(1px);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@media (prefers-reduced-motion: reduce) {
|
|
179
|
+
.canopy-search-form,
|
|
180
|
+
.canopy-search-form__submit {
|
|
181
|
+
transition: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.canopy-search-form__submit:active {
|
|
185
|
+
transform: none;
|
|
186
|
+
}
|
|
187
|
+
}
|