@netlify/spark-ui 0.0.12 → 0.0.13
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/dist/assets/KeyboardKey.css +1 -0
- package/dist/assets/SearchHeading.css +1 -0
- package/dist/assets/SearchModal.css +1 -0
- package/dist/assets/SearchToggle.css +1 -1
- package/dist/{compat.module-DWiGVdMB.js → chunks/compat.module.s9u28W-S.js} +1 -1
- package/dist/components/index.d.ts +4 -4
- package/dist/components/preact/Icon/index.js +1 -1
- package/dist/components/preact/KeyboardKey/KeyboardKey.d.ts +5 -0
- package/dist/components/preact/KeyboardKey/KeyboardKey.js +7 -0
- package/dist/components/preact/Modal/{index.js → Modal.js} +2 -2
- package/dist/components/preact/SearchModal/components/{SearchHeading.d.ts → SearchHeading/SearchHeading.d.ts} +2 -2
- package/dist/components/preact/SearchModal/components/SearchHeading/SearchHeading.js +5 -0
- package/dist/components/preact/SearchModal/components/SearchInput.d.ts +2 -3
- package/dist/components/preact/SearchModal/components/SearchInput.js +11 -11
- package/dist/components/preact/SearchModal/components/SearchLink.d.ts +1 -2
- package/dist/components/preact/SearchModal/components/SearchLink.js +10 -10
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.d.ts +7 -0
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +54 -0
- package/dist/components/preact/SearchModal/components/SearchToggle/SearchToggle.js +3 -3
- package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -2
- package/dist/components/preact/SearchModal/components/SearchWindow.js +10 -10
- package/dist/components/preact/SearchModal/hooks/index.d.ts +5 -0
- package/dist/components/preact/SearchModal/hooks/index.js +12 -0
- package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearch.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchParams.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +1 -1
- package/dist/components/preact/SearchModal/index.d.ts +6 -6
- package/dist/components/preact/SearchModal/index.js +12 -55
- package/dist/components/preact/index.d.ts +4 -4
- package/dist/components/preact/index.js +16 -14
- package/package.json +6 -6
- package/packages/components/index.ts +4 -4
- package/packages/components/preact/KeyboardKey/KeyboardKey.css +10 -12
- package/packages/components/preact/KeyboardKey/{index.tsx → KeyboardKey.tsx} +1 -3
- package/packages/components/preact/Modal/{index.tsx → Modal.tsx} +1 -1
- package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +7 -0
- package/packages/components/preact/SearchModal/components/{SearchHeading.tsx → SearchHeading/SearchHeading.tsx} +4 -2
- package/packages/components/preact/SearchModal/components/SearchInput.tsx +5 -6
- package/packages/components/preact/SearchModal/components/SearchLink.tsx +5 -6
- package/packages/{styles/search.css → components/preact/SearchModal/components/SearchModal/SearchModal.css} +59 -87
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +77 -0
- package/packages/components/preact/SearchModal/components/SearchToggle/SearchToggle.css +2 -2
- package/packages/components/preact/SearchModal/components/SearchToggle/SearchToggle.tsx +1 -1
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +6 -8
- package/packages/components/preact/SearchModal/hooks/index.ts +5 -0
- package/packages/components/preact/SearchModal/index.tsx +6 -72
- package/packages/components/preact/SearchModal/types/search.types.tsx +1 -1
- package/packages/components/preact/index.ts +4 -4
- package/dist/assets/index.css +0 -1
- package/dist/assets/index2.css +0 -1
- package/dist/components/preact/KeyboardKey/index.d.ts +0 -6
- package/dist/components/preact/KeyboardKey/index.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchFooter.d.ts +0 -6
- package/dist/components/preact/SearchModal/components/SearchFooter.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchFooterTip.d.ts +0 -6
- package/dist/components/preact/SearchModal/components/SearchFooterTip.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchHeading.js +0 -5
- package/dist/components/preact/SearchModal/components/index.d.ts +0 -7
- package/dist/components/preact/SearchModal/components/index.js +0 -16
- package/packages/components/preact/SearchModal/components/SearchFooter.tsx +0 -11
- package/packages/components/preact/SearchModal/components/SearchFooterTip.tsx +0 -11
- package/packages/components/preact/SearchModal/components/index.ts +0 -7
- /package/dist/{hooks.module-ExpuRnbo.js → chunks/hooks.module.ExpuRnbo.js} +0 -0
- /package/dist/{jsxRuntime.module-Bzuv3cXw.js → chunks/jsxRuntime.module.Bzuv3cXw.js} +0 -0
- /package/dist/components/preact/Modal/{index.d.ts → Modal.d.ts} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ComponentChildren } from 'preact';
|
|
2
|
+
|
|
3
|
+
import './SearchHeading.css';
|
|
2
4
|
|
|
3
5
|
type SearchHeadingProps = {
|
|
4
6
|
children: ComponentChildren;
|
|
5
7
|
};
|
|
6
8
|
|
|
7
9
|
const SearchHeading = ({ children }: SearchHeadingProps) => {
|
|
8
|
-
return <h2 class="search-
|
|
10
|
+
return <h2 class="n-search-heading">{children}</h2>;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export default SearchHeading;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
1
|
import { useState, useEffect } from 'preact/hooks';
|
|
3
2
|
import Icon from '../../Icon';
|
|
4
3
|
|
|
5
|
-
interface Props
|
|
4
|
+
interface Props {
|
|
6
5
|
setSearchTerm: (term: string) => void;
|
|
7
6
|
placeholder?: string;
|
|
8
7
|
initialValue?: string;
|
|
@@ -24,15 +23,15 @@ const SearchInput = (props: Props) => {
|
|
|
24
23
|
}, [props.initialValue, setValue]);
|
|
25
24
|
|
|
26
25
|
return (
|
|
27
|
-
<div class="search-input-wrapper">
|
|
28
|
-
<label class="search-label" htmlFor="search">
|
|
26
|
+
<div class="n-search-input-wrapper">
|
|
27
|
+
<label class="n-search-label" htmlFor="search">
|
|
29
28
|
<span class="visually-hidden">Search</span>
|
|
30
|
-
<div class="search-icon">
|
|
29
|
+
<div class="n-search-icon">
|
|
31
30
|
<Icon name="search" />
|
|
32
31
|
</div>
|
|
33
32
|
</label>
|
|
34
33
|
<input
|
|
35
|
-
class="search-input"
|
|
34
|
+
class="n-search-input"
|
|
36
35
|
type="text"
|
|
37
36
|
value={value}
|
|
38
37
|
placeholder={props.placeholder || 'Search...'}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
1
|
import Icon, { type IconName } from '../../Icon';
|
|
3
2
|
|
|
4
3
|
export interface Props {
|
|
@@ -9,11 +8,11 @@ export interface Props {
|
|
|
9
8
|
excerpt?: string;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
const SearchLink = ({ icon, title,
|
|
11
|
+
const SearchLink = ({ icon, title, url, excerpt }: Props) => {
|
|
13
12
|
return (
|
|
14
|
-
<a className="result-link" href={url}>
|
|
15
|
-
<div className="result-header">
|
|
16
|
-
<div className="result-title">
|
|
13
|
+
<a className="n-result-link" href={url}>
|
|
14
|
+
<div className="n-result-header">
|
|
15
|
+
<div className="n-result-title">
|
|
17
16
|
{icon && (
|
|
18
17
|
<span className="icon">
|
|
19
18
|
<Icon name={icon} />
|
|
@@ -25,7 +24,7 @@ const SearchLink = ({ icon, title, content_type, url, excerpt }: Props) => {
|
|
|
25
24
|
<Icon name="caretRight" />
|
|
26
25
|
</div>
|
|
27
26
|
</div>
|
|
28
|
-
{excerpt && <p className="result-excerpt" dangerouslySetInnerHTML={{ __html: excerpt }} />}
|
|
27
|
+
{excerpt && <p className="n-result-excerpt" dangerouslySetInnerHTML={{ __html: excerpt }} />}
|
|
29
28
|
</a>
|
|
30
29
|
);
|
|
31
30
|
};
|
|
@@ -1,106 +1,86 @@
|
|
|
1
|
-
/* Imports */
|
|
2
|
-
@import url('./tokens.css');
|
|
3
|
-
@import url('./utils.css');
|
|
4
|
-
|
|
5
1
|
/* Root Variables */
|
|
6
|
-
.search-modal {
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
2
|
+
.n-search-modal {
|
|
3
|
+
--n-search-padding-inline: .5em;
|
|
4
|
+
--n-search-color-text: var(--color-text-1, currentColor);
|
|
5
|
+
--n-search-color-text-secondary: var(--color-text-2, currentColor);
|
|
6
|
+
--n-search-color-bg: var(--color-bg-1);
|
|
7
|
+
--n-search-color-bg-2: var(--color-bg-2);
|
|
8
|
+
--n-search-color-border: var(--color-bg-3);
|
|
9
|
+
--n-search-border-radius: 8px;
|
|
10
|
+
--n-search-max-w: 600px;
|
|
11
|
+
--n-search-text-highlight: var(--color-text-accent);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.n-search-modal {
|
|
15
|
+
padding: 0;
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: var(--n-search-border-radius);
|
|
18
|
+
width: min(var(--n-search-max-w), 100%);
|
|
19
|
+
margin-inline: auto;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
/* Container Styles */
|
|
18
|
-
.search-container {
|
|
19
|
-
--mark-bg: var(--
|
|
23
|
+
.n-search-container {
|
|
24
|
+
--mark-bg: var(--n-search-text-highlight);
|
|
20
25
|
display: grid;
|
|
21
|
-
width: min(var(--
|
|
26
|
+
width: min(var(--n-search-max-w), 100%);
|
|
22
27
|
min-height: 470px;
|
|
23
|
-
background-color: var(--
|
|
24
|
-
border-radius: var(--
|
|
28
|
+
background-color: var(--n-search-color-bg);
|
|
29
|
+
border-radius: var(--n-search-border-radius);
|
|
25
30
|
overflow: hidden;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
.search-modal {
|
|
29
|
-
padding: 0;
|
|
30
|
-
border: none;
|
|
31
|
-
border-radius: var(--ntl-search-border-radius);
|
|
32
|
-
width: min(var(--ntl-search-max-w), 100%);
|
|
33
|
-
margin-inline: auto;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
33
|
/* Search Bar */
|
|
37
|
-
.search {
|
|
34
|
+
.n-search-bar {
|
|
38
35
|
display: flex;
|
|
39
36
|
flex-wrap: wrap;
|
|
40
37
|
align-items: center;
|
|
41
38
|
overflow: hidden;
|
|
42
|
-
background: var(--
|
|
43
|
-
border-bottom: 1px solid var(--
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.search > * {
|
|
47
|
-
display: inline-block;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.search-trigger {
|
|
51
|
-
width: var(--ntl-search-icon-size, 1rem);
|
|
52
|
-
height: auto;
|
|
53
|
-
border: none;
|
|
54
|
-
background: none;
|
|
55
|
-
padding: 0;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
padding-inline: var(--space-2xs);
|
|
58
|
-
color: var(--color-text-1);
|
|
59
|
-
box-sizing: content-box;
|
|
60
|
-
display: block;
|
|
39
|
+
background: var(--n-search-color-bg);
|
|
40
|
+
border-bottom: 1px solid var(--n-search-color-border);
|
|
61
41
|
}
|
|
62
42
|
|
|
63
43
|
/* Search Input */
|
|
64
|
-
.search-input-wrapper {
|
|
44
|
+
.n-search-input-wrapper {
|
|
65
45
|
all: unset;
|
|
66
46
|
display: flex;
|
|
67
47
|
width: 100%;
|
|
68
48
|
}
|
|
69
49
|
|
|
70
|
-
.search-input {
|
|
50
|
+
.n-search-input {
|
|
71
51
|
display: inline-flex;
|
|
72
52
|
box-sizing: border-box;
|
|
73
|
-
background: var(--
|
|
53
|
+
background: var(--n-search-color-bg);
|
|
74
54
|
inline-size: 100%;
|
|
75
55
|
padding-block: .75rem;
|
|
76
|
-
padding-inline: var(--
|
|
56
|
+
padding-inline: var(--n-search-padding-inline);
|
|
77
57
|
flex: 1;
|
|
78
58
|
border: none;
|
|
79
59
|
outline: none;
|
|
80
60
|
font-size: 1rem;
|
|
81
61
|
}
|
|
82
62
|
|
|
83
|
-
.search-input::placeholder {
|
|
84
|
-
color: var(--
|
|
63
|
+
.n-search-input::placeholder {
|
|
64
|
+
color: var(--n-search-color-text);
|
|
85
65
|
}
|
|
86
66
|
|
|
87
67
|
/* Search Label */
|
|
88
|
-
.search-label {
|
|
68
|
+
.n-search-label {
|
|
89
69
|
display: flex;
|
|
90
|
-
padding-inline: var(--
|
|
70
|
+
padding-inline: var(--n-search-padding-inline);
|
|
91
71
|
}
|
|
92
72
|
|
|
93
|
-
.search-label > * {
|
|
73
|
+
.n-search-label > * {
|
|
94
74
|
display: inline-block;
|
|
95
75
|
margin: 0;
|
|
96
76
|
}
|
|
97
77
|
|
|
98
78
|
/* Icons */
|
|
99
|
-
.search-icon {
|
|
79
|
+
.n-search-icon {
|
|
100
80
|
display: flex;
|
|
101
81
|
width: 1em;
|
|
102
82
|
height: auto;
|
|
103
|
-
color:
|
|
83
|
+
color: var(--n-search-color-text-secondary);
|
|
104
84
|
}
|
|
105
85
|
|
|
106
86
|
.icon {
|
|
@@ -112,70 +92,62 @@
|
|
|
112
92
|
|
|
113
93
|
.icon [data-icon="caretRight"] {
|
|
114
94
|
width: 10px;
|
|
115
|
-
color: var(--
|
|
95
|
+
color: var(--n-search-color-text-secondary);
|
|
116
96
|
}
|
|
117
97
|
|
|
118
98
|
/* Search Key & Term */
|
|
119
|
-
.search-term {
|
|
99
|
+
.n-search-term {
|
|
120
100
|
font-weight: var(--font-medium);
|
|
121
101
|
font-size: 1.1em;
|
|
122
102
|
}
|
|
123
103
|
|
|
124
104
|
/* Search Results */
|
|
125
|
-
.search-
|
|
126
|
-
padding-inline: 1rem;
|
|
127
|
-
margin-block: var(--space-xs);
|
|
128
|
-
font-size: var(--step--2);
|
|
129
|
-
font-weight: var(--font-regular);
|
|
130
|
-
color: var(--color-text-3);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.search-window {
|
|
105
|
+
.n-search-window {
|
|
134
106
|
height: 400px;
|
|
135
107
|
overflow-x: hidden;
|
|
136
108
|
overflow-y: auto;
|
|
137
109
|
overscroll-behavior: contain;
|
|
138
110
|
margin-block: 0;
|
|
139
|
-
background: var(--
|
|
111
|
+
background: var(--n-search-color-bg);
|
|
140
112
|
}
|
|
141
113
|
|
|
142
|
-
.results-list, ul[role="list"] {
|
|
114
|
+
.n-results-list, ul[role="list"] {
|
|
143
115
|
list-style: none;
|
|
144
116
|
padding: 0;
|
|
145
117
|
}
|
|
146
118
|
|
|
147
|
-
.results-list-item {
|
|
119
|
+
.n-results-list-item {
|
|
148
120
|
border-bottom: 1px solid var(--color-bg-3);
|
|
149
121
|
}
|
|
150
|
-
.results-list-item:first-of-type {
|
|
122
|
+
.n-results-list-item:first-of-type {
|
|
151
123
|
border-top: 1px solid var(--color-bg-3);
|
|
152
124
|
}
|
|
153
125
|
|
|
154
126
|
/* Result Items */
|
|
155
|
-
.result-link {
|
|
127
|
+
.n-result-link {
|
|
156
128
|
all: unset;
|
|
157
129
|
display: flex;
|
|
158
130
|
flex-wrap: wrap;
|
|
159
131
|
row-gap: var(--space-3xs);
|
|
160
|
-
padding: var(--
|
|
132
|
+
padding: var(--n-result-padding-block, 1em) var(--n-result-padding-inline, 1rem);
|
|
161
133
|
font-size: var(--step--1);
|
|
162
134
|
font-weight: var(--font-regular);
|
|
163
135
|
text-decoration: none;
|
|
164
136
|
cursor: pointer;
|
|
165
137
|
}
|
|
166
138
|
|
|
167
|
-
.result-link:is(:hover, :focus-within) {
|
|
168
|
-
background: var(--
|
|
139
|
+
.n-result-link:is(:hover, :focus-within) {
|
|
140
|
+
background: var(--n-search-color-bg-2);
|
|
169
141
|
}
|
|
170
142
|
|
|
171
|
-
.result-header {
|
|
143
|
+
.n-result-header {
|
|
172
144
|
display: flex;
|
|
173
145
|
justify-content: space-between;
|
|
174
146
|
width: 100%;
|
|
175
147
|
align-items: center;
|
|
176
148
|
}
|
|
177
149
|
|
|
178
|
-
.result-title {
|
|
150
|
+
.n-result-title {
|
|
179
151
|
display: flex;
|
|
180
152
|
align-items: center;
|
|
181
153
|
gap: var(--space-s);
|
|
@@ -183,7 +155,7 @@
|
|
|
183
155
|
color: var(--color-text-2);
|
|
184
156
|
}
|
|
185
157
|
|
|
186
|
-
.result-excerpt {
|
|
158
|
+
.n-result-excerpt {
|
|
187
159
|
color: var(--color-text-3);
|
|
188
160
|
line-height: 1.3;
|
|
189
161
|
font-size: .9em;
|
|
@@ -191,17 +163,17 @@
|
|
|
191
163
|
}
|
|
192
164
|
|
|
193
165
|
/* Footer */
|
|
194
|
-
.search-footer {
|
|
195
|
-
border-top: 1px solid var(--
|
|
166
|
+
.n-search-footer {
|
|
167
|
+
border-top: 1px solid var(--n-search-color-border);
|
|
196
168
|
padding: var(--space-2xs) var(--space-s);
|
|
197
169
|
background: var(--color-bg-2);
|
|
198
170
|
display: flex;
|
|
199
171
|
gap: var(--space-m);
|
|
200
172
|
}
|
|
201
173
|
|
|
202
|
-
.search-footer-tip {
|
|
203
|
-
--
|
|
204
|
-
color: var(--
|
|
174
|
+
.n-search-footer-tip {
|
|
175
|
+
--n-key-text-color: var(--n-search-color-text-secondary);
|
|
176
|
+
color: var(--n-search-color-text-secondary);
|
|
205
177
|
display: flex;
|
|
206
178
|
gap: var(--space-2xs);
|
|
207
179
|
align-items: center;
|
|
@@ -209,7 +181,7 @@
|
|
|
209
181
|
}
|
|
210
182
|
|
|
211
183
|
/* Animations */
|
|
212
|
-
.search-modal {
|
|
184
|
+
.n-search-modal {
|
|
213
185
|
transition: display .2s allow-discrete, overlay .2s allow-discrete;
|
|
214
186
|
animation: closeSearch .2s forwards;
|
|
215
187
|
&[open] {
|
|
@@ -242,11 +214,11 @@
|
|
|
242
214
|
}
|
|
243
215
|
}
|
|
244
216
|
|
|
245
|
-
.search-modal::backdrop {
|
|
217
|
+
.n-search-modal::backdrop {
|
|
246
218
|
animation: closeSearchBackdrop .2s forwards;
|
|
247
219
|
}
|
|
248
220
|
|
|
249
|
-
.search-modal[open]::backdrop {
|
|
221
|
+
.n-search-modal[open]::backdrop {
|
|
250
222
|
animation: openSearchBackdrop .2s forwards;
|
|
251
223
|
}
|
|
252
224
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ComponentChildren } from 'preact';
|
|
2
|
+
import { useState, useEffect, useRef } from 'preact/hooks';
|
|
3
|
+
|
|
4
|
+
import Modal from '@components/preact/Modal/Modal';
|
|
5
|
+
import KeyboardKey from '@components/preact/KeyboardKey/KeyboardKey';
|
|
6
|
+
import SearchWindow from '../../components/SearchWindow';
|
|
7
|
+
import SearchInput from '../../components/SearchInput';
|
|
8
|
+
import { useClickOutside } from '@utils/useClickOutside';
|
|
9
|
+
import {
|
|
10
|
+
useSearch,
|
|
11
|
+
useKeyboardNav,
|
|
12
|
+
useSearchHotkeys,
|
|
13
|
+
useSearchParams,
|
|
14
|
+
useSearchToggles,
|
|
15
|
+
} from '../../hooks';
|
|
16
|
+
|
|
17
|
+
import './SearchModal.css';
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
children: ComponentChildren;
|
|
21
|
+
className: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SearchModal(props: Props) {
|
|
25
|
+
const { children, className, ...rest } = props;
|
|
26
|
+
const { state, actions } = useSearch();
|
|
27
|
+
const [searchOpen, setSearchOpen] = useState(false);
|
|
28
|
+
|
|
29
|
+
const openSearch = () => setSearchOpen(true);
|
|
30
|
+
const closeSearch = () => setSearchOpen(false);
|
|
31
|
+
|
|
32
|
+
const modalRef = useRef<HTMLDialogElement>(null);
|
|
33
|
+
const containerRef = useClickOutside<HTMLDivElement>(closeSearch);
|
|
34
|
+
|
|
35
|
+
useSearchToggles(openSearch);
|
|
36
|
+
useSearchParams(actions.setSearchTerm, openSearch);
|
|
37
|
+
useSearchHotkeys(searchOpen, openSearch, closeSearch);
|
|
38
|
+
useKeyboardNav(modalRef, searchOpen, closeSearch);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!modalRef.current) return;
|
|
42
|
+
searchOpen ? modalRef.current.showModal() : modalRef.current.close();
|
|
43
|
+
}, [searchOpen]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Modal ref={modalRef} className={`${className} n-search-modal`} {...rest}>
|
|
47
|
+
<div ref={containerRef} className="n-search-container">
|
|
48
|
+
<form className="n-search-bar">
|
|
49
|
+
<SearchInput setSearchTerm={actions.setSearchTerm} initialValue={state.searchTerm} />
|
|
50
|
+
</form>
|
|
51
|
+
|
|
52
|
+
<SearchWindow
|
|
53
|
+
searchLoading={state.isLoading}
|
|
54
|
+
searchTerm={state.searchTerm}
|
|
55
|
+
results={state.results}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</SearchWindow>
|
|
59
|
+
|
|
60
|
+
<div className="n-search-footer">
|
|
61
|
+
<p className="n-search-footer-tip">
|
|
62
|
+
<KeyboardKey keyNames={['Esc']} />
|
|
63
|
+
to close
|
|
64
|
+
</p>
|
|
65
|
+
<p className="n-search-footer-tip">
|
|
66
|
+
<KeyboardKey keyNames={['Tab']} />
|
|
67
|
+
<span>or</span>
|
|
68
|
+
<KeyboardKey keyNames={['↑', '↓']} />
|
|
69
|
+
to navigate
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</Modal>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default SearchModal;
|
|
@@ -10,7 +10,7 @@ interface Props {
|
|
|
10
10
|
|
|
11
11
|
export default forwardRef(function SearchToggle(props: Props, ref: Ref<HTMLButtonElement>) {
|
|
12
12
|
return (
|
|
13
|
-
<button id={props.id} ref={ref} class="search-toggle" disabled data-ntl-search-toggle>
|
|
13
|
+
<button id={props.id} ref={ref} class="n-search-toggle" disabled data-ntl-search-toggle>
|
|
14
14
|
<span class="visually-hidden">Search</span>
|
|
15
15
|
<Icon name={props.iconName || 'search'} />
|
|
16
16
|
</button>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
|
-
|
|
3
1
|
import type { FunctionComponent } from 'preact';
|
|
4
2
|
import type { ResultProps, SearchResultsProps, SearchWindowProps } from '../types/search.types';
|
|
5
|
-
import SearchHeading from './SearchHeading';
|
|
3
|
+
import SearchHeading from './SearchHeading/SearchHeading';
|
|
6
4
|
import SearchLink from './SearchLink';
|
|
7
5
|
|
|
8
6
|
/* --- Search Results Window (for active searches) --- */
|
|
@@ -14,7 +12,7 @@ const SearchResults: FunctionComponent<SearchResultsProps> = ({
|
|
|
14
12
|
if (searchLoading) {
|
|
15
13
|
return (
|
|
16
14
|
<SearchHeading>
|
|
17
|
-
Searching for <span className="search-term">{searchTerm}</span> ...
|
|
15
|
+
Searching for <span className="n-search-term">{searchTerm}</span> ...
|
|
18
16
|
</SearchHeading>
|
|
19
17
|
);
|
|
20
18
|
}
|
|
@@ -22,15 +20,15 @@ const SearchResults: FunctionComponent<SearchResultsProps> = ({
|
|
|
22
20
|
if (!results || results.length === 0) {
|
|
23
21
|
return (
|
|
24
22
|
<SearchHeading>
|
|
25
|
-
0 results for <span className="search-term">{searchTerm}</span>
|
|
23
|
+
0 results for <span className="n-search-term">{searchTerm}</span>
|
|
26
24
|
</SearchHeading>
|
|
27
25
|
);
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
return (
|
|
31
|
-
<ul className="results-list" role="list">
|
|
29
|
+
<ul className="n-results-list" role="list">
|
|
32
30
|
{results.slice(0, 15).map((result, idx) => (
|
|
33
|
-
<li key={idx} className="results-list-item">
|
|
31
|
+
<li key={idx} className="n-results-list-item">
|
|
34
32
|
<SearchLink {...result} />
|
|
35
33
|
</li>
|
|
36
34
|
))}
|
|
@@ -52,7 +50,7 @@ export default function SearchWindow({
|
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
return (
|
|
55
|
-
<div className="search-window">
|
|
53
|
+
<div className="n-search-window">
|
|
56
54
|
<div className="search-links">
|
|
57
55
|
<SearchLink {...askNetlify} />
|
|
58
56
|
{searchTerm ? (
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useSearch } from '../hooks/useSearch';
|
|
2
|
+
export { useKeyboardNav } from '../hooks/useKeyboardNav';
|
|
3
|
+
export { useSearchHotkeys } from '../hooks/useSearchHotkeys';
|
|
4
|
+
export { useSearchParams } from '../hooks/useSearchParams';
|
|
5
|
+
export { useSearchToggles } from '../hooks/useSearchToggles';
|
|
@@ -1,72 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { useSearch } from './hooks/useSearch';
|
|
8
|
-
import { useKeyboardNav } from './hooks/useKeyboardNav';
|
|
9
|
-
import { useSearchHotkeys } from './hooks/useSearchHotkeys';
|
|
10
|
-
import { useSearchParams } from './hooks/useSearchParams';
|
|
11
|
-
import { useSearchToggles } from './hooks/useSearchToggles';
|
|
12
|
-
import { useClickOutside } from '../../../utils/useClickOutside';
|
|
13
|
-
|
|
14
|
-
import '../../../styles/search.css';
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
children: ComponentChildren;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function SearchModal({ children }: Props) {
|
|
21
|
-
const { state, actions } = useSearch();
|
|
22
|
-
const [searchOpen, setSearchOpen] = useState(false);
|
|
23
|
-
|
|
24
|
-
const openSearch = () => setSearchOpen(true);
|
|
25
|
-
const closeSearch = () => setSearchOpen(false);
|
|
26
|
-
|
|
27
|
-
const modalRef = useRef<HTMLDialogElement>(null);
|
|
28
|
-
const containerRef = useClickOutside<HTMLDivElement>(closeSearch);
|
|
29
|
-
|
|
30
|
-
useSearchToggles(openSearch);
|
|
31
|
-
useSearchParams(actions.setSearchTerm, openSearch);
|
|
32
|
-
useSearchHotkeys(searchOpen, openSearch, closeSearch);
|
|
33
|
-
useKeyboardNav(modalRef, searchOpen, closeSearch);
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (!modalRef.current) return;
|
|
37
|
-
searchOpen ? modalRef.current.showModal() : modalRef.current.close();
|
|
38
|
-
}, [searchOpen]);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Modal ref={modalRef} className="search-modal">
|
|
42
|
-
<div ref={containerRef} class="search-container">
|
|
43
|
-
<form class="search">
|
|
44
|
-
<SearchInput setSearchTerm={actions.setSearchTerm} initialValue={state.searchTerm} />
|
|
45
|
-
</form>
|
|
46
|
-
|
|
47
|
-
<SearchWindow
|
|
48
|
-
searchLoading={state.isLoading}
|
|
49
|
-
searchTerm={state.searchTerm}
|
|
50
|
-
results={state.results}
|
|
51
|
-
>
|
|
52
|
-
{children}
|
|
53
|
-
</SearchWindow>
|
|
54
|
-
|
|
55
|
-
<SearchFooter>
|
|
56
|
-
<SearchFooterTip>
|
|
57
|
-
<KeyboardKey keyNames={['Esc']} />
|
|
58
|
-
to close
|
|
59
|
-
</SearchFooterTip>
|
|
60
|
-
<SearchFooterTip>
|
|
61
|
-
<KeyboardKey keyNames={['Tab']} />
|
|
62
|
-
<span>or</span>
|
|
63
|
-
<KeyboardKey keyNames={['↑', '↓']} />
|
|
64
|
-
to navigate
|
|
65
|
-
</SearchFooterTip>
|
|
66
|
-
</SearchFooter>
|
|
67
|
-
</div>
|
|
68
|
-
</Modal>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export default SearchModal;
|
|
1
|
+
export { default as SearchHeading } from './components/SearchHeading/SearchHeading';
|
|
2
|
+
export { default as SearchInput } from './components/SearchInput';
|
|
3
|
+
export { default as SearchLink } from './components/SearchLink';
|
|
4
|
+
export { default as SearchToggle } from './components/SearchToggle/SearchToggle';
|
|
5
|
+
export { default as SearchWindow } from './components/SearchWindow';
|
|
6
|
+
export { default as SearchModal } from './components/SearchModal/SearchModal';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { default as KeyboardKey } from './KeyboardKey';
|
|
2
|
-
export { default as Modal } from './Modal';
|
|
1
|
+
export { default as KeyboardKey } from './KeyboardKey/KeyboardKey';
|
|
2
|
+
export { default as Modal } from './Modal/Modal';
|
|
3
3
|
export { default as Icon } from './Icon';
|
|
4
4
|
export { default as SearchLink } from './SearchModal/components/SearchLink';
|
|
5
|
-
export { default as SearchHeading } from './SearchModal/components/SearchHeading';
|
|
5
|
+
export { default as SearchHeading } from './SearchModal/components/SearchHeading/SearchHeading';
|
|
6
6
|
export { default as SearchToggle } from './SearchModal/components/SearchToggle/SearchToggle';
|
|
7
|
-
export {
|
|
7
|
+
export { SearchModal } from './SearchModal';
|
|
8
8
|
|
|
9
9
|
export { type IconName } from './Icon';
|
package/dist/assets/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--ntl-key-text-size: .8em;--ntl-key-border-radius: 6px;--ntl-key-text-color: var(--neutral-300);--ntl-key-bg-color: transparent}.keyboard-key{display:flex;gap:calc(var(--space-3xs) * .5);font-size:var(--ntl-key-text-size);color:var(--ntl-key-text-color);background:var(--ntl-key-bg-color);border:1px solid currentColor;border-radius:var(--ntl-key-border-radius);padding:var(--ntl-key-padding-block, .05em) var(--ntl-key-padding-inline, .3em)}
|
package/dist/assets/index2.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--blue-000: color(srgb .9294117647058824 .9568627450980393 1);--blue-100: color(srgb .803921568627451 .8862745098039215 1);--blue-200: color(srgb .7098039215686275 .8235294117647058 .984313725490196);--blue-300: color(srgb .611764705882353 .7450980392156863 .9647058823529412);--blue-400: color(srgb .5019607843137255 .6705882352941176 .9803921568627451);--blue-500: color(srgb .36470588235294116 .5529411764705883 .9607843137254902);--blue-600: color(srgb .19215686274509805 .4196078431372549 .9568627450980393);--blue-700: color(srgb .1803921568627451 .3176470588235294 .9294117647058824);--blue-800: color(srgb .12549019607843137 .21176470588235294 .6313725490196078);--blue-900: color(srgb .10588235294117647 .12549019607843137 .3568627450980392);--color-bg-1: var(--neutral-000);--color-bg-2: var(--neutral-100);--color-bg-3: var(--neutral-200);--color-brand: var(--blue-700);--color-disabled-bg: var(--neutral-200);--color-disabled-border: var(--neutral-400);--color-disabled-text: var(--neutral-400);--color-invalid-bg: var(--red-100);--color-invalid-border: var(--red-600);--color-invalid-text: var(--red-600);--color-link: var(--neutral-800);--color-success-bg: var(--green-100);--color-success-border: var(--green-300);--color-success-text: var(--green-800);--color-text-1: var(--neutral-800);--color-text-2: var(--neutral-600);--color-text-3: var(--neutral-400);--color-text-accent: var(--teal-000);--color-warning-bg: var(--gold-100);--color-warning-border: var(--gold-300);--color-warning-text: var(--gold-800);--font-bold: 800;--font-light: 300;--font-medium: 500;--font-monospace: ui-monospace, "Cascadia Code", "Source Code Pro", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;--font-primary: "Mulish", system-ui, "Helvetica", sans-serif;--font-regular: 400;--font-secondary: "Pacaembu", system-ui, "Helvetica", sans-serif;--font-semibold: 680;--font-semilight: 350;--gold-000: color(srgb .9921568627450981 .9607843137254902 .8470588235294118);--gold-100: color(srgb .9647058823529412 .8784313725490196 .6470588235294118);--gold-200: color(srgb .9803921568627451 .803921568627451 .43529411764705883);--gold-300: color(srgb .984313725490196 .6941176470588235 .23921568627450981);--gold-400: color(srgb .9764705882352941 .5568627450980392 .12941176470588237);--gold-500: color(srgb .8352941176470589 .4666666666666667 .10196078431372549);--gold-600: color(srgb .6588235294117647 .36470588235294116 .07450980392156863);--gold-700: color(srgb .5490196078431373 .2980392156862745 .050980392156862744);--gold-800: color(srgb .3764705882352941 .20392156862745098 .03137254901960784);--gold-900: color(srgb .2 .13333333333333333 .07450980392156863);--green-000: color(srgb .9058823529411765 .9882352941176471 .9137254901960784);--green-100: color(srgb .7450980392156863 .9764705882352941 .7764705882352941);--green-200: color(srgb .5764705882352941 .9607843137254902 .6470588235294118);--green-300: color(srgb .39215686274509803 .8470588235294118 .4980392156862745);--green-400: color(srgb .22745098039215686 .7647058823529411 .39215686274509803);--green-500: color(srgb .19215686274509805 .6588235294117647 .3333333333333333);--green-600: color(srgb .13333333333333333 .5098039215686274 .25098039215686274);--green-700: color(srgb .10196078431372549 .4196078431372549 .20392156862745098);--green-800: color(srgb .058823529411764705 .2901960784313726 .12941176470588237);--green-900: color(srgb .08235294117647059 .16470588235294117 .09803921568627451);--line-height-heading: 1.2;--line-height-none: 1;--line-height-prose: 1.5;--neutral-000: color(srgb 1 1 1);--neutral-100: color(srgb .9647058823529412 .9647058823529412 .9686274509803922);--neutral-200: color(srgb .9137254901960784 .9215686274509803 .9294117647058824);--neutral-300: color(srgb .8196078431372549 .8352941176470589 .8549019607843137);--neutral-400: color(srgb .615686274509804 .6549019607843137 .6980392156862745);--neutral-500: color(srgb .4666666666666667 .5019607843137255 .5372549019607843);--neutral-600: color(srgb .32941176470588235 .35294117647058826 .3803921568627451);--neutral-700: color(srgb .20784313725490197 .22745098039215686 .24313725490196078);--neutral-800: color(srgb .09411764705882353 .10196078431372549 .10980392156862745);--neutral-900: color(srgb .023529411764705882 .043137254901960784 .06274509803921569);--pink-000: color(srgb .9882352941176471 .9411764705882353 .984313725490196);--pink-100: color(srgb .9647058823529412 .8235294117647058 .9490196078431372);--pink-200: color(srgb .9686274509803922 .7372549019607844 .9529411764705882);--pink-300: color(srgb .9529411764705882 .6588235294117647 .9333333333333333);--pink-400: color(srgb .9372549019607843 .4980392156862745 .9215686274509803);--pink-500: color(srgb .8745098039215686 .35294117647058826 .8627450980392157);--pink-600: color(srgb .7254901960784313 .2196078431372549 .7215686274509804);--pink-700: color(srgb .6039215686274509 .17647058823529413 .6);--pink-800: color(srgb .4235294117647059 .11372549019607843 .4196078431372549);--pink-900: color(srgb .2196078431372549 .10588235294117647 .21568627450980393);--purple-000: color(srgb .9607843137254902 .9490196078431372 .9882352941176471);--purple-100: color(srgb .8862745098039215 .8509803921568627 .9686274509803922);--purple-200: color(srgb .8470588235294118 .7803921568627451 1);--purple-300: color(srgb .792156862745098 .7254901960784313 .9568627450980393);--purple-400: color(srgb .7058823529411765 .615686274509804 .9450980392156862);--purple-500: color(srgb .6078431372549019 .5019607843137255 .9294117647058824);--purple-600: color(srgb .4666666666666667 .3607843137254902 .9058823529411765);--purple-700: color(srgb .3803921568627451 .2901960784313726 .792156862745098);--purple-800: color(srgb .2196078431372549 .16470588235294117 .6431372549019608);--purple-900: color(srgb .1607843137254902 .12941176470588237 .25882352941176473);--red-000: color(srgb .984313725490196 .9333333333333333 .9294117647058824);--red-100: color(srgb .984313725490196 .8274509803921568 .8156862745098039);--red-200: color(srgb 1 .7411764705882353 .7294117647058823);--red-300: color(srgb 1 .6784313725490196 .6627450980392157);--red-400: color(srgb .996078431372549 .5137254901960784 .5098039215686274);--red-500: color(srgb .996078431372549 .3058823529411765 .3607843137254902);--red-600: color(srgb .8392156862745098 .15294117647058825 .25098039215686274);--red-700: color(srgb .6862745098039216 .1450980392156863 .21176470588235294);--red-800: color(srgb .5019607843137255 .0392156862745098 .12549019607843137);--red-900: color(srgb .23921568627450981 .10980392156862745 .10588235294117647);--shadow-deep: 0 16px 24px 0 color(srgb 0 0 0 / .07), 0 6px 30px 0 color(srgb 0 0 0 / .06), 0 8px 10px 0 color(srgb 0 0 0 / .1);--shadow-heavy: -10px 10px 80px 0 color(srgb 0 0 0 / .1);--shadow-hover: 0 4px 12px 0 color(srgb 0 0 0 / .25);--shadow-light: 0 2px 4px 0 color(srgb .2 .21568627450980393 .23137254901960785 / .08), 0 1px 10px 0 color(srgb .2 .21568627450980393 .23137254901960785 / .06);--space-2xl: 4rem;--space-2xs: .5rem;--space-3xl: 6rem;--space-3xs: .25rem;--space-4xl: 10rem;--space-l: 2rem;--space-m: 1.5rem;--space-s: 1rem;--space-xl: 3rem;--space-xs: .75rem;--teal-000: color(srgb .8705882352941177 1 .996078431372549);--teal-100: color(srgb .5568627450980392 .984313725490196 .9686274509803922);--teal-200: color(srgb .19607843137254902 .9019607843137255 .8862745098039215);--teal-300: color(srgb .0784313725490196 .8470588235294118 .8313725490196079);--teal-400: color(srgb .0196078431372549 .7411764705882353 .7294117647058823);--teal-500: color(srgb .01568627450980392 .6352941176470588 .6235294117647059);--teal-600: color(srgb .00784313725490196 .5019607843137255 .49019607843137253);--teal-700: color(srgb .00392156862745098 .4117647058823529 .40784313725490196);--teal-800: color(srgb .00392156862745098 .2823529411764706 .2784313725490196);--teal-900: color(srgb .047058823529411764 .16470588235294117 .16470588235294117);--text-2xl: 1.74rem;--text-3xl: 2.3rem;--text-4xl: 3.04rem;--text-5xl: 4.01rem;--text-base: 1rem;--text-lg: 1.125rem;--text-sm: .875rem;--text-xl: 1.32rem;--text-xs: .8125rem}@media (prefers-color-scheme: light){:root{--color-bg-1: var(--neutral-000);--color-bg-2: var(--neutral-100);--color-bg-3: var(--neutral-200);--color-brand: var(--blue-700);--color-disabled-bg: var(--neutral-200);--color-disabled-border: var(--neutral-400);--color-disabled-text: var(--neutral-400);--color-invalid-bg: var(--red-100);--color-invalid-border: var(--red-600);--color-invalid-text: var(--red-600);--color-link: var(--neutral-800);--color-success-bg: var(--green-100);--color-success-border: var(--green-300);--color-success-text: var(--green-800);--color-text-1: var(--neutral-800);--color-text-2: var(--neutral-600);--color-text-3: var(--neutral-400);--color-text-accent: var(--teal-000);--color-warning-bg: var(--gold-100);--color-warning-border: var(--gold-300);--color-warning-text: var(--gold-800);--neutral-000: color(srgb 1 1 1);--neutral-100: color(srgb .9647058823529412 .9647058823529412 .9686274509803922);--neutral-200: color(srgb .9137254901960784 .9215686274509803 .9294117647058824);--neutral-300: color(srgb .8196078431372549 .8352941176470589 .8549019607843137);--neutral-400: color(srgb .615686274509804 .6549019607843137 .6980392156862745);--neutral-500: color(srgb .4666666666666667 .5019607843137255 .5372549019607843);--neutral-600: color(srgb .32941176470588235 .35294117647058826 .3803921568627451);--neutral-700: color(srgb .20784313725490197 .22745098039215686 .24313725490196078);--neutral-800: color(srgb .09411764705882353 .10196078431372549 .10980392156862745)}}[data-mode=light]{--color-bg-1: var(--neutral-000);--color-bg-2: var(--neutral-100);--color-bg-3: var(--neutral-200);--color-brand: var(--blue-700);--color-disabled-bg: var(--neutral-200);--color-disabled-border: var(--neutral-400);--color-disabled-text: var(--neutral-400);--color-invalid-bg: var(--red-100);--color-invalid-border: var(--red-600);--color-invalid-text: var(--red-600);--color-link: var(--neutral-800);--color-success-bg: var(--green-100);--color-success-border: var(--green-300);--color-success-text: var(--green-800);--color-text-1: var(--neutral-800);--color-text-2: var(--neutral-600);--color-text-3: var(--neutral-400);--color-text-accent: var(--teal-000);--color-warning-bg: var(--gold-100);--color-warning-border: var(--gold-300);--color-warning-text: var(--gold-800);--neutral-000: color(srgb 1 1 1);--neutral-100: color(srgb .9647058823529412 .9647058823529412 .9686274509803922);--neutral-200: color(srgb .9137254901960784 .9215686274509803 .9294117647058824);--neutral-300: color(srgb .8196078431372549 .8352941176470589 .8549019607843137);--neutral-400: color(srgb .615686274509804 .6549019607843137 .6980392156862745);--neutral-500: color(srgb .4666666666666667 .5019607843137255 .5372549019607843);--neutral-600: color(srgb .32941176470588235 .35294117647058826 .3803921568627451);--neutral-700: color(srgb .20784313725490197 .22745098039215686 .24313725490196078);--neutral-800: color(srgb .09411764705882353 .10196078431372549 .10980392156862745)}@media (prefers-color-scheme: dark){:root{--color-bg-1: var(--neutral-800);--color-bg-2: var(--neutral-700);--color-bg-3: var(--neutral-600);--color-brand: var(--teal-200);--color-disabled-bg: var(--neutral-600);--color-disabled-border: var(--neutral-400);--color-disabled-text: var(--neutral-400);--color-invalid-bg: var(--red-200);--color-invalid-border: var(--red-700);--color-invalid-text: var(--red-700);--color-link: var(--neutral-100);--color-success-bg: var(--green-200);--color-success-border: var(--green-400);--color-success-text: var(--green-900);--color-text-1: var(--neutral-100);--color-text-2: var(--neutral-300);--color-text-3: var(--neutral-500);--color-text-accent: var(--teal-600);--color-warning-bg: var(--gold-200);--color-warning-border: var(--gold-400);--color-warning-text: var(--gold-900);--neutral-100: color(srgb .9019607843137255 .9254901960784314 .9490196078431372);--neutral-200: color(srgb .6705882352941176 .7098039215686275 .7490196078431373);--neutral-300: color(srgb .49411764705882355 .5294117647058824 .5725490196078431);--neutral-400: color(srgb .30196078431372547 .33725490196078434 .37254901960784315);--neutral-500: color(srgb .23137254901960785 .2627450980392157 .2980392156862745);--neutral-600: color(srgb .15294117647058825 .1843137254901961 .2196078431372549);--neutral-700: color(srgb .11764705882352941 .1411764705882353 .17254901960784313);--neutral-800: color(srgb .07058823529411765 .09411764705882353 .12156862745098039);--neutral-900: color(srgb .023529411764705882 .043137254901960784 .06274509803921569)}}[data-mode=dark]{--color-bg-1: var(--neutral-800);--color-bg-2: var(--neutral-700);--color-bg-3: var(--neutral-600);--color-brand: var(--teal-200);--color-disabled-bg: var(--neutral-600);--color-disabled-border: var(--neutral-400);--color-disabled-text: var(--neutral-400);--color-invalid-bg: var(--red-200);--color-invalid-border: var(--red-700);--color-invalid-text: var(--red-700);--color-link: var(--neutral-100);--color-success-bg: var(--green-200);--color-success-border: var(--green-400);--color-success-text: var(--green-900);--color-text-1: var(--neutral-100);--color-text-2: var(--neutral-300);--color-text-3: var(--neutral-500);--color-text-accent: var(--teal-600);--color-warning-bg: var(--gold-200);--color-warning-border: var(--gold-400);--color-warning-text: var(--gold-900);--neutral-100: color(srgb .9019607843137255 .9254901960784314 .9490196078431372);--neutral-200: color(srgb .6705882352941176 .7098039215686275 .7490196078431373);--neutral-300: color(srgb .49411764705882355 .5294117647058824 .5725490196078431);--neutral-400: color(srgb .30196078431372547 .33725490196078434 .37254901960784315);--neutral-500: color(srgb .23137254901960785 .2627450980392157 .2980392156862745);--neutral-600: color(srgb .15294117647058825 .1843137254901961 .2196078431372549);--neutral-700: color(srgb .11764705882352941 .1411764705882353 .17254901960784313);--neutral-800: color(srgb .07058823529411765 .09411764705882353 .12156862745098039);--neutral-900: color(srgb .023529411764705882 .043137254901960784 .06274509803921569)}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.search-modal{--ntl-search-padding-inline: .5em;--ntl-search-color-text: var(--color-text-2);--ntl-search-color-bg: var(--color-bg-1);--ntl-search-color-border: var(--color-bg-3);--ntl-search-border-radius: 8px;--ntl-search-max-w: 600px;--ntl-search-text-highlight: var(--color-text-accent);--ntl-search-footer-key-color-text: var(--color-text-2)}.search-container{--mark-bg: var(--ntl-search-text-highlight);display:grid;width:min(var(--ntl-search-max-w),100%);min-height:470px;background-color:var(--ntl-search-color-bg);border-radius:var(--ntl-search-border-radius);overflow:hidden}.search-modal{padding:0;border:none;border-radius:var(--ntl-search-border-radius);width:min(var(--ntl-search-max-w),100%);margin-inline:auto}.search{display:flex;flex-wrap:wrap;align-items:center;overflow:hidden;background:var(--ntl-search-color-bg);border-bottom:1px solid var(--ntl-search-color-border)}.search>*{display:inline-block}.search-trigger{width:var(--ntl-search-icon-size, 1rem);height:auto;border:none;background:none;padding:0;cursor:pointer;padding-inline:var(--space-2xs);color:var(--color-text-1);box-sizing:content-box;display:block}.search-input-wrapper{all:unset;display:flex;width:100%}.search-input{display:inline-flex;box-sizing:border-box;background:var(--ntl-search-color-bg);inline-size:100%;padding-block:.75rem;padding-inline:var(--ntl-search-padding-inline);flex:1;border:none;outline:none;font-size:1rem}.search-input::placeholder{color:var(--ntl-search-color-text)}.search-label{display:flex;padding-inline:var(--ntl-search-padding-inline)}.search-label>*{display:inline-block;margin:0}.search-icon{display:flex;width:1em;height:auto;color:#d3d3d3}.icon{display:flex;width:1em;height:auto;height:1em}.icon [data-icon=caretRight]{width:10px;color:var(--neutral-300)}.search-term{font-weight:var(--font-medium);font-size:1.1em}.search-results-heading{padding-inline:1rem;margin-block:var(--space-xs);font-size:var(--step--2);font-weight:var(--font-regular);color:var(--color-text-3)}.search-window{height:400px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;margin-block:0;background:var(--ntl-search-color-bg)}.results-list,ul[role=list]{list-style:none;padding:0}.results-list-item{border-bottom:1px solid var(--color-bg-3)}.results-list-item:first-of-type{border-top:1px solid var(--color-bg-3)}.result-link{all:unset;display:flex;flex-wrap:wrap;row-gap:var(--space-3xs);padding:var(--ntl-result-padding-block, 1em) var(--ntl-result-padding-inline, 1rem);font-size:var(--step--1);font-weight:var(--font-regular);text-decoration:none;cursor:pointer}.result-link:is(:hover,:focus-within){background:var(--neutral-100)}.result-header{display:flex;justify-content:space-between;width:100%;align-items:center}.result-title{display:flex;align-items:center;gap:var(--space-s);font-weight:var(--font-semibold);color:var(--color-text-2)}.result-excerpt{color:var(--color-text-3);line-height:1.3;font-size:.9em;padding-inline-start:var(--space-l)}.search-footer{border-top:1px solid var(--ntl-search-color-border);padding:var(--space-2xs) var(--space-s);background:var(--color-bg-2);display:flex;gap:var(--space-m)}.search-footer-tip{--ntl-key-text-color: var(--ntl-search-footer-key-color-text);color:var(--ntl-search-footer-key-color-text);display:flex;gap:var(--space-2xs);align-items:center;font-size:var(--step--1)}.search-modal{transition:display .2s allow-discrete,overlay .2s allow-discrete;animation:closeSearch .2s forwards}.search-modal[open]{animation:openSearch .2s forwards}@keyframes openSearch{0%{opacity:0;transform:translateY(20px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes closeSearch{0%{opacity:1;transform:translateY(0) scale(1)}50%{opacity:.3}to{opacity:0;transform:translateY(20px) scale(.9)}}.search-modal::backdrop{animation:closeSearchBackdrop .2s forwards}.search-modal[open]::backdrop{animation:openSearchBackdrop .2s forwards}@keyframes openSearchBackdrop{0%{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}to{opacity:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}}@keyframes closeSearchBackdrop{0%{opacity:1;-webkit-backdrop-filter:blur(1.5px);backdrop-filter:blur(1.5px)}50%{opacity:.3}to{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}}
|