@garagem-ai/site-sdk 0.4.13 → 0.5.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/README.md +20 -32
- package/dist/index.d.mts +20 -17
- package/dist/index.d.ts +20 -17
- package/dist/index.js +91 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -18
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -98
- package/dist/react.d.ts +2 -98
- package/dist/react.js +11 -957
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +11 -955
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-1O4sKtKb.d.mts → search-engine-4ocM0UPk.d.mts} +16 -1
- package/dist/{search-engine-1O4sKtKb.d.ts → search-engine-4ocM0UPk.d.ts} +16 -1
- package/package.json +2 -2
- package/src/index.ts +5 -0
- package/src/react/index.ts +1 -13
- package/src/react/search-chrome.tsx +0 -48
- package/src/react/search.css +2 -499
- package/src/react/styles/search-chrome-css.generated.ts +2 -2
- package/src/react/types.ts +0 -32
- package/src/search-engine.ts +47 -1
- package/src/studio-contract.ts +57 -20
- package/src/react/filter-panel.tsx +0 -248
- package/src/react/icons.tsx +0 -46
- package/src/react/search-page.tsx +0 -475
- package/src/react/search-pagination.tsx +0 -120
- package/src/react/search-query-form.tsx +0 -81
package/src/react/search.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Card + skeleton CSS for published Studio sites.
|
|
3
3
|
* Layout does not depend on the app Tailwind scan of node_modules.
|
|
4
4
|
* Brand color/radius come from the site theme (`--background`, `--primary`, …).
|
|
5
|
-
*
|
|
5
|
+
* Search chrome (query, toolbar, sort, filters, pagination) is app-owned.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
:root {
|
|
@@ -10,154 +10,9 @@
|
|
|
10
10
|
--garagem-listing-card-gap: 1.5rem;
|
|
11
11
|
--garagem-listing-price-size: 1.125rem;
|
|
12
12
|
--garagem-listing-media-ratio: 4 / 3;
|
|
13
|
-
--garagem-search-control-height: 2.75rem;
|
|
14
|
-
--garagem-search-icon-size: 1.25rem;
|
|
15
|
-
--garagem-search-radius: var(--radius, 0.75rem);
|
|
16
13
|
--garagem-skeleton: var(--muted, #e7e5e4);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
[data-slot="search-heading"] {
|
|
20
|
-
display: flex;
|
|
21
|
-
min-width: 0;
|
|
22
|
-
align-items: baseline;
|
|
23
|
-
gap: 0.375rem;
|
|
24
|
-
font-size: 1.25rem;
|
|
25
|
-
font-weight: 600;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[data-slot="search-heading-count"] {
|
|
29
|
-
flex-shrink: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[data-slot="search-heading-title"] {
|
|
33
|
-
min-width: 0;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
text-overflow: ellipsis;
|
|
36
|
-
white-space: nowrap;
|
|
37
|
-
font-size: inherit;
|
|
38
|
-
font-weight: inherit;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
[data-slot="search-query-sort"] {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
gap: 1rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@media (min-width: 1024px) {
|
|
48
|
-
[data-slot="search-query-sort"] {
|
|
49
|
-
flex-direction: row;
|
|
50
|
-
align-items: flex-end;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
[data-slot="search-query"] {
|
|
55
|
-
flex: 1;
|
|
56
|
-
min-width: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
[data-slot="search-query-input"],
|
|
60
|
-
[data-slot="search-sort-trigger"],
|
|
61
|
-
[data-slot="search-toolbar-trigger"],
|
|
62
|
-
[data-slot="search-filters-trigger"] {
|
|
63
|
-
min-height: var(--garagem-search-control-height);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
[data-slot="search-query-field"] {
|
|
67
|
-
position: relative;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
[data-slot="search-query-input"] {
|
|
71
|
-
width: 100%;
|
|
72
|
-
border-radius: var(--garagem-search-radius);
|
|
73
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
74
|
-
background: var(--background, #fff);
|
|
75
|
-
padding: 0.5rem 5.5rem 0.5rem 1rem;
|
|
76
|
-
outline: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[data-slot="search-query-actions"] {
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: 50%;
|
|
82
|
-
right: 0.35rem;
|
|
83
|
-
display: flex;
|
|
84
|
-
transform: translateY(-50%);
|
|
85
|
-
align-items: center;
|
|
86
|
-
gap: 0.15rem;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[data-slot="search-icon-button"] {
|
|
90
|
-
display: inline-flex;
|
|
91
|
-
height: 2.25rem;
|
|
92
|
-
width: 2.25rem;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
align-items: center;
|
|
95
|
-
justify-content: center;
|
|
96
|
-
border: 0;
|
|
97
|
-
border-radius: 999px;
|
|
98
|
-
background: var(--primary, #111);
|
|
99
|
-
color: var(--primary-foreground, #fff);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[data-slot="search-icon-button"][data-kind="clear"] {
|
|
103
|
-
background: transparent;
|
|
104
|
-
color: var(--muted-foreground, #737373);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[data-slot="search-icon"] {
|
|
108
|
-
width: var(--garagem-search-icon-size);
|
|
109
|
-
height: var(--garagem-search-icon-size);
|
|
110
|
-
display: block;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
[data-slot="search-sort"] {
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
gap: 0.25rem;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
[data-slot="search-sort-trigger"] {
|
|
120
|
-
appearance: none;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
border-radius: var(--garagem-search-radius);
|
|
123
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
124
|
-
background: var(--background, #fff);
|
|
125
|
-
padding: 0.5rem 2.25rem 0.5rem 0.75rem;
|
|
126
|
-
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23737373' stroke-width='2' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6'/></svg>");
|
|
127
|
-
background-repeat: no-repeat;
|
|
128
|
-
background-position: right 0.65rem center;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[data-slot="search-toolbar"] {
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-wrap: wrap;
|
|
134
|
-
align-items: flex-end;
|
|
135
|
-
gap: 0.5rem;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
[data-slot="search-toolbar-trigger"],
|
|
139
|
-
[data-slot="search-filters-trigger"] {
|
|
140
|
-
cursor: pointer;
|
|
141
|
-
border-radius: var(--garagem-search-radius);
|
|
142
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
143
|
-
background: var(--background, #fff);
|
|
144
|
-
padding: 0.5rem 0.75rem;
|
|
145
|
-
font-size: 0.875rem;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
[data-slot="search-popover"] {
|
|
149
|
-
position: absolute;
|
|
150
|
-
z-index: 30;
|
|
151
|
-
margin-top: 0.5rem;
|
|
152
|
-
width: 18rem;
|
|
153
|
-
border-radius: 0.75rem;
|
|
154
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
155
|
-
background: var(--background, #fff);
|
|
156
|
-
padding: 1rem;
|
|
157
|
-
box-shadow: 0 10px 30px rgb(0 0 0 / 0.12);
|
|
158
|
-
animation: garagem-search-in 140ms ease-out;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
16
|
[data-slot="search-grid"],
|
|
162
17
|
[data-slot="search-skeleton"] {
|
|
163
18
|
display: grid;
|
|
@@ -202,225 +57,6 @@
|
|
|
202
57
|
color: var(--muted-foreground, #737373);
|
|
203
58
|
}
|
|
204
59
|
|
|
205
|
-
[data-slot="search-checkbox"] {
|
|
206
|
-
appearance: none;
|
|
207
|
-
width: 1.15rem;
|
|
208
|
-
height: 1.15rem;
|
|
209
|
-
flex-shrink: 0;
|
|
210
|
-
cursor: pointer;
|
|
211
|
-
border: 1px solid var(--primary, #111);
|
|
212
|
-
border-radius: 0.25rem;
|
|
213
|
-
background: var(--background, #fff);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
[data-slot="search-checkbox"]:checked {
|
|
217
|
-
background-color: var(--primary, #111);
|
|
218
|
-
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'><path d='M5 12l5 5L20 7'/></svg>");
|
|
219
|
-
background-repeat: no-repeat;
|
|
220
|
-
background-position: center;
|
|
221
|
-
background-size: 0.8rem;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
[data-slot="search-scroll"] {
|
|
225
|
-
max-height: 12rem;
|
|
226
|
-
overflow: auto;
|
|
227
|
-
scrollbar-width: thin;
|
|
228
|
-
scrollbar-color: var(--muted-foreground, #a1a1aa) transparent;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
[data-slot="search-range-apply"] {
|
|
232
|
-
display: inline-flex;
|
|
233
|
-
min-height: 2.5rem;
|
|
234
|
-
cursor: pointer;
|
|
235
|
-
align-items: center;
|
|
236
|
-
justify-content: center;
|
|
237
|
-
border: 0;
|
|
238
|
-
border-radius: var(--garagem-search-radius);
|
|
239
|
-
background: var(--primary, #111);
|
|
240
|
-
color: var(--primary-foreground, #fff);
|
|
241
|
-
padding: 0 0.75rem;
|
|
242
|
-
font-size: 0.75rem;
|
|
243
|
-
font-weight: 600;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
[data-slot="search-sheet"] {
|
|
247
|
-
position: fixed;
|
|
248
|
-
inset: 0;
|
|
249
|
-
z-index: 40;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
[data-slot="search-sheet-overlay"] {
|
|
253
|
-
position: absolute;
|
|
254
|
-
inset: 0;
|
|
255
|
-
border: 0;
|
|
256
|
-
cursor: pointer;
|
|
257
|
-
background: rgb(0 0 0 / 0.4);
|
|
258
|
-
animation: garagem-search-fade 160ms ease-out;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
[data-slot="search-sheet-panel"] {
|
|
262
|
-
position: absolute;
|
|
263
|
-
top: 0;
|
|
264
|
-
right: 0;
|
|
265
|
-
display: flex;
|
|
266
|
-
height: 100dvh;
|
|
267
|
-
width: min(22rem, 100%);
|
|
268
|
-
flex-direction: column;
|
|
269
|
-
background: var(--background, #fff);
|
|
270
|
-
animation: garagem-search-sheet 180ms ease-out;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
[data-slot="search-sheet-body"] {
|
|
274
|
-
min-height: 0;
|
|
275
|
-
flex: 1;
|
|
276
|
-
overflow: auto;
|
|
277
|
-
padding: 1.5rem 1.5rem 0;
|
|
278
|
-
scrollbar-width: thin;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
[data-slot="search-sheet-footer"] {
|
|
282
|
-
display: flex;
|
|
283
|
-
gap: 0.5rem;
|
|
284
|
-
border-top: 1px solid var(--border, #e4e4e7);
|
|
285
|
-
padding: 1rem 1.5rem;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
[data-slot="search-apply-bar"] {
|
|
289
|
-
display: flex;
|
|
290
|
-
width: 100%;
|
|
291
|
-
gap: 0.5rem;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
[data-slot="search-apply-bar"] > button {
|
|
295
|
-
min-height: 2.5rem;
|
|
296
|
-
flex: 1;
|
|
297
|
-
cursor: pointer;
|
|
298
|
-
border-radius: var(--garagem-search-radius);
|
|
299
|
-
padding: 0 1rem;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
[data-slot="search-apply-bar"] > button[data-kind="clear"] {
|
|
303
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
304
|
-
background: transparent;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
[data-slot="search-apply-bar"] > button[data-kind="apply"] {
|
|
308
|
-
border: 0;
|
|
309
|
-
background: var(--primary, #111);
|
|
310
|
-
color: var(--primary-foreground, #fff);
|
|
311
|
-
font-weight: 600;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
[data-slot="search-pagination"] {
|
|
315
|
-
margin-top: 2.5rem;
|
|
316
|
-
display: flex;
|
|
317
|
-
justify-content: center;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
[data-slot="search-pagination"] ul {
|
|
321
|
-
display: flex;
|
|
322
|
-
flex-wrap: wrap;
|
|
323
|
-
justify-content: center;
|
|
324
|
-
gap: 0.25rem;
|
|
325
|
-
padding: 0;
|
|
326
|
-
margin: 0;
|
|
327
|
-
list-style: none;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
[data-slot="search-pagination-item"] {
|
|
331
|
-
display: inline-flex;
|
|
332
|
-
width: 2.25rem;
|
|
333
|
-
height: 2.25rem;
|
|
334
|
-
align-items: center;
|
|
335
|
-
justify-content: center;
|
|
336
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
337
|
-
border-radius: 0.375rem;
|
|
338
|
-
font-size: 0.75rem;
|
|
339
|
-
font-weight: 500;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
@media (min-width: 768px) {
|
|
343
|
-
[data-slot="search-pagination-item"] {
|
|
344
|
-
width: 2.5rem;
|
|
345
|
-
height: 2.5rem;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
[data-slot="search-pagination-item"] a,
|
|
350
|
-
[data-slot="search-pagination-item"] span {
|
|
351
|
-
display: flex;
|
|
352
|
-
width: 100%;
|
|
353
|
-
height: 100%;
|
|
354
|
-
align-items: center;
|
|
355
|
-
justify-content: center;
|
|
356
|
-
color: inherit;
|
|
357
|
-
text-decoration: none;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
[data-slot="search-pagination-item"][data-current="true"] {
|
|
361
|
-
background: var(--primary, #111);
|
|
362
|
-
color: var(--primary-foreground, #fff);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
[data-slot="search-pagination-item"][data-disabled="true"] {
|
|
366
|
-
cursor: not-allowed;
|
|
367
|
-
color: var(--muted-foreground, #737373);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
[data-slot="search-toolbar-item"] {
|
|
371
|
-
position: relative;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
[data-slot="search-body"] {
|
|
375
|
-
margin-top: 2rem;
|
|
376
|
-
display: flex;
|
|
377
|
-
flex-direction: column;
|
|
378
|
-
gap: 1.5rem;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
[data-slot="search-label"] {
|
|
382
|
-
margin-bottom: 0.25rem;
|
|
383
|
-
display: block;
|
|
384
|
-
font-size: 0.875rem;
|
|
385
|
-
color: var(--muted-foreground, #737373);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
[data-slot="search-sheet-title"] {
|
|
389
|
-
padding: 1.5rem 1.5rem 0;
|
|
390
|
-
font-size: 1.125rem;
|
|
391
|
-
font-weight: 600;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
[data-slot="search-layout"] {
|
|
395
|
-
display: grid;
|
|
396
|
-
gap: 2rem;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
[data-slot="search-sidebar"] {
|
|
400
|
-
display: none;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
[data-slot="search-layout"] > div > [data-slot="search-filters-trigger"] {
|
|
404
|
-
margin-bottom: 1rem;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
@media (min-width: 1024px) {
|
|
408
|
-
[data-slot="search-layout"] {
|
|
409
|
-
grid-template-columns: 280px minmax(0, 1fr);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
[data-slot="search-sidebar"] {
|
|
413
|
-
display: block;
|
|
414
|
-
position: sticky;
|
|
415
|
-
top: 1.5rem;
|
|
416
|
-
align-self: start;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
[data-slot="search-layout"] > div > [data-slot="search-filters-trigger"] {
|
|
420
|
-
display: none;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
60
|
[data-slot="listing-card-link"] {
|
|
425
61
|
display: block;
|
|
426
62
|
color: inherit;
|
|
@@ -471,107 +107,6 @@
|
|
|
471
107
|
margin-top: 0.75rem;
|
|
472
108
|
}
|
|
473
109
|
|
|
474
|
-
[data-slot="search-filters"] {
|
|
475
|
-
display: flex;
|
|
476
|
-
flex-direction: column;
|
|
477
|
-
gap: 1.25rem;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
[data-slot="search-filter"] {
|
|
481
|
-
margin: 0;
|
|
482
|
-
padding: 0;
|
|
483
|
-
border: 0;
|
|
484
|
-
font-size: 0.875rem;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
[data-slot="search-filter"] legend {
|
|
488
|
-
margin-bottom: 0.5rem;
|
|
489
|
-
padding: 0;
|
|
490
|
-
color: var(--muted-foreground, #737373);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
[data-slot="search-range-row"] {
|
|
494
|
-
display: flex;
|
|
495
|
-
align-items: flex-end;
|
|
496
|
-
gap: 0.5rem;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
[data-slot="search-range-side"] {
|
|
500
|
-
min-width: 0;
|
|
501
|
-
flex: 1;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
[data-slot="search-range-side"] > span:first-child {
|
|
505
|
-
margin-bottom: 0.25rem;
|
|
506
|
-
display: block;
|
|
507
|
-
font-size: 0.75rem;
|
|
508
|
-
color: var(--muted-foreground, #737373);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
[data-slot="search-range-affix"] {
|
|
512
|
-
position: relative;
|
|
513
|
-
display: block;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
[data-slot="search-range-prefix"] {
|
|
517
|
-
pointer-events: none;
|
|
518
|
-
position: absolute;
|
|
519
|
-
inset-block: 0;
|
|
520
|
-
left: 0;
|
|
521
|
-
display: flex;
|
|
522
|
-
align-items: center;
|
|
523
|
-
padding-left: 0.75rem;
|
|
524
|
-
color: var(--muted-foreground, #737373);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
[data-slot="search-range-input"] {
|
|
528
|
-
min-height: 2.5rem;
|
|
529
|
-
width: 100%;
|
|
530
|
-
border-radius: var(--garagem-search-radius);
|
|
531
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
532
|
-
background: var(--background, #fff);
|
|
533
|
-
padding: 0 0.75rem;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
[data-slot="search-range-affix"] [data-slot="search-range-input"] {
|
|
537
|
-
padding-left: 2.5rem;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
[data-slot="search-count-group"] {
|
|
541
|
-
display: flex;
|
|
542
|
-
flex-wrap: wrap;
|
|
543
|
-
gap: 0.375rem;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
[data-slot="search-count-choice"] {
|
|
547
|
-
min-height: 2.5rem;
|
|
548
|
-
cursor: pointer;
|
|
549
|
-
border-radius: var(--garagem-search-radius);
|
|
550
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
551
|
-
background: var(--background, #fff);
|
|
552
|
-
padding: 0 0.75rem;
|
|
553
|
-
font-size: 0.875rem;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
[data-slot="search-count-choice"][data-selected="true"] {
|
|
557
|
-
border-color: var(--primary, #111);
|
|
558
|
-
background: color-mix(in srgb, var(--primary, #111) 10%, transparent);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
[data-slot="search-enum-list"],
|
|
562
|
-
[data-slot="search-scroll"] {
|
|
563
|
-
display: flex;
|
|
564
|
-
flex-direction: column;
|
|
565
|
-
gap: 0.375rem;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
[data-slot="search-enum-option"] {
|
|
569
|
-
display: flex;
|
|
570
|
-
cursor: pointer;
|
|
571
|
-
align-items: center;
|
|
572
|
-
gap: 0.5rem;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
110
|
[data-slot="listing-card-badge"] {
|
|
576
111
|
position: absolute;
|
|
577
112
|
left: 0.75rem;
|
|
@@ -667,43 +202,11 @@
|
|
|
667
202
|
}
|
|
668
203
|
|
|
669
204
|
@media (prefers-reduced-motion: reduce) {
|
|
670
|
-
[data-slot="search-popover"],
|
|
671
|
-
[data-slot="search-sheet-overlay"],
|
|
672
|
-
[data-slot="search-sheet-panel"],
|
|
673
205
|
[data-slot="search-skeleton-block"] {
|
|
674
206
|
animation: none;
|
|
675
207
|
}
|
|
676
208
|
}
|
|
677
209
|
|
|
678
|
-
@keyframes garagem-search-in {
|
|
679
|
-
from {
|
|
680
|
-
opacity: 0;
|
|
681
|
-
transform: translateY(-4px) scale(0.98);
|
|
682
|
-
}
|
|
683
|
-
to {
|
|
684
|
-
opacity: 1;
|
|
685
|
-
transform: none;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
@keyframes garagem-search-fade {
|
|
690
|
-
from {
|
|
691
|
-
opacity: 0;
|
|
692
|
-
}
|
|
693
|
-
to {
|
|
694
|
-
opacity: 1;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
@keyframes garagem-search-sheet {
|
|
699
|
-
from {
|
|
700
|
-
transform: translateX(100%);
|
|
701
|
-
}
|
|
702
|
-
to {
|
|
703
|
-
transform: none;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
210
|
@keyframes garagem-search-pulse {
|
|
708
211
|
50% {
|
|
709
212
|
opacity: 0.55;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Generated by scripts/build-search-chrome-css.mjs — do not edit. */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/* prettier-ignore */
|
|
4
|
-
export const SEARCH_CHROME_CSS_VERSION = "0.
|
|
5
|
-
export const SEARCH_CHROME_CSS = ":root{--garagem-listing-card-radius:0.75rem;--garagem-listing-card-gap:1.5rem;--garagem-listing-price-size:1.125rem;--garagem-listing-media-ratio:4 / 3;--garagem-search-control-height:2.75rem;--garagem-search-icon-size:1.25rem;--garagem-search-radius:var(--radius,0.75rem);--garagem-skeleton:var(--muted,#e7e5e4)}[data-slot=\"search-heading\"]{display:flex;min-width:0;align-items:baseline;gap:0.375rem;font-size:1.25rem;font-weight:600}[data-slot=\"search-heading-count\"]{flex-shrink:0}[data-slot=\"search-heading-title\"]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit;font-weight:inherit}[data-slot=\"search-query-sort\"]{display:flex;flex-direction:column;gap:1rem}@media (min-width:1024px){[data-slot=\"search-query-sort\"]{flex-direction:row;align-items:flex-end}}[data-slot=\"search-query\"]{flex:1;min-width:0}[data-slot=\"search-query-input\"],[data-slot=\"search-sort-trigger\"],[data-slot=\"search-toolbar-trigger\"],[data-slot=\"search-filters-trigger\"]{min-height:var(--garagem-search-control-height)}[data-slot=\"search-query-field\"]{position:relative}[data-slot=\"search-query-input\"]{width:100%;border-radius:var(--garagem-search-radius);border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:0.5rem 5.5rem 0.5rem 1rem;outline:none}[data-slot=\"search-query-actions\"]{position:absolute;top:50%;right:0.35rem;display:flex;transform:translateY(-50%);align-items:center;gap:0.15rem}[data-slot=\"search-icon-button\"]{display:inline-flex;height:2.25rem;width:2.25rem;cursor:pointer;align-items:center;justify-content:center;border:0;border-radius:999px;background:var(--primary,#111);color:var(--primary-foreground,#fff)}[data-slot=\"search-icon-button\"][data-kind=\"clear\"]{background:transparent;color:var(--muted-foreground,#737373)}[data-slot=\"search-icon\"]{width:var(--garagem-search-icon-size);height:var(--garagem-search-icon-size);display:block}[data-slot=\"search-sort\"]{display:flex;flex-direction:column;gap:0.25rem}[data-slot=\"search-sort-trigger\"]{appearance:none;cursor:pointer;border-radius:var(--garagem-search-radius);border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:0.5rem 2.25rem 0.5rem 0.75rem;background-image:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23737373' stroke-width='2' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6'/></svg>\");background-repeat:no-repeat;background-position:right 0.65rem center}[data-slot=\"search-toolbar\"]{display:flex;flex-wrap:wrap;align-items:flex-end;gap:0.5rem}[data-slot=\"search-toolbar-trigger\"],[data-slot=\"search-filters-trigger\"]{cursor:pointer;border-radius:var(--garagem-search-radius);border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:0.5rem 0.75rem;font-size:0.875rem}[data-slot=\"search-popover\"]{position:absolute;z-index:30;margin-top:0.5rem;width:18rem;border-radius:0.75rem;border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:1rem;box-shadow:0 10px 30px rgb(0 0 0 / 0.12);animation:garagem-search-in 140ms ease-out}[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{display:grid;grid-template-columns:1fr;gap:var(--garagem-listing-card-gap)}@media (min-width:640px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(3,minmax(0,1fr))}}[data-slot=\"listing-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7);background:var(--card,var(--background,#fff))}[data-slot=\"listing-card-price-row\"]{display:inline-flex;align-items:baseline;gap:0.25rem}[data-slot=\"listing-card-price\"]{font-size:var(--garagem-listing-price-size);font-weight:600}[data-slot=\"listing-card-period\"]{font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-checkbox\"]{appearance:none;width:1.15rem;height:1.15rem;flex-shrink:0;cursor:pointer;border:1px solid var(--primary,#111);border-radius:0.25rem;background:var(--background,#fff)}[data-slot=\"search-checkbox\"]:checked{background-color:var(--primary,#111);background-image:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'><path d='M5 12l5 5L20 7'/></svg>\");background-repeat:no-repeat;background-position:center;background-size:0.8rem}[data-slot=\"search-scroll\"]{max-height:12rem;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--muted-foreground,#a1a1aa) transparent}[data-slot=\"search-range-apply\"]{display:inline-flex;min-height:2.5rem;cursor:pointer;align-items:center;justify-content:center;border:0;border-radius:var(--garagem-search-radius);background:var(--primary,#111);color:var(--primary-foreground,#fff);padding:0 0.75rem;font-size:0.75rem;font-weight:600}[data-slot=\"search-sheet\"]{position:fixed;inset:0;z-index:40}[data-slot=\"search-sheet-overlay\"]{position:absolute;inset:0;border:0;cursor:pointer;background:rgb(0 0 0 / 0.4);animation:garagem-search-fade 160ms ease-out}[data-slot=\"search-sheet-panel\"]{position:absolute;top:0;right:0;display:flex;height:100dvh;width:min(22rem,100%);flex-direction:column;background:var(--background,#fff);animation:garagem-search-sheet 180ms ease-out}[data-slot=\"search-sheet-body\"]{min-height:0;flex:1;overflow:auto;padding:1.5rem 1.5rem 0;scrollbar-width:thin}[data-slot=\"search-sheet-footer\"]{display:flex;gap:0.5rem;border-top:1px solid var(--border,#e4e4e7);padding:1rem 1.5rem}[data-slot=\"search-apply-bar\"]{display:flex;width:100%;gap:0.5rem}[data-slot=\"search-apply-bar\"] > button{min-height:2.5rem;flex:1;cursor:pointer;border-radius:var(--garagem-search-radius);padding:0 1rem}[data-slot=\"search-apply-bar\"] > button[data-kind=\"clear\"]{border:1px solid var(--border,#e4e4e7);background:transparent}[data-slot=\"search-apply-bar\"] > button[data-kind=\"apply\"]{border:0;background:var(--primary,#111);color:var(--primary-foreground,#fff);font-weight:600}[data-slot=\"search-pagination\"]{margin-top:2.5rem;display:flex;justify-content:center}[data-slot=\"search-pagination\"] ul{display:flex;flex-wrap:wrap;justify-content:center;gap:0.25rem;padding:0;margin:0;list-style:none}[data-slot=\"search-pagination-item\"]{display:inline-flex;width:2.25rem;height:2.25rem;align-items:center;justify-content:center;border:1px solid var(--border,#e4e4e7);border-radius:0.375rem;font-size:0.75rem;font-weight:500}@media (min-width:768px){[data-slot=\"search-pagination-item\"]{width:2.5rem;height:2.5rem}}[data-slot=\"search-pagination-item\"] a,[data-slot=\"search-pagination-item\"] span{display:flex;width:100%;height:100%;align-items:center;justify-content:center;color:inherit;text-decoration:none}[data-slot=\"search-pagination-item\"][data-current=\"true\"]{background:var(--primary,#111);color:var(--primary-foreground,#fff)}[data-slot=\"search-pagination-item\"][data-disabled=\"true\"]{cursor:not-allowed;color:var(--muted-foreground,#737373)}[data-slot=\"search-toolbar-item\"]{position:relative}[data-slot=\"search-body\"]{margin-top:2rem;display:flex;flex-direction:column;gap:1.5rem}[data-slot=\"search-label\"]{margin-bottom:0.25rem;display:block;font-size:0.875rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-sheet-title\"]{padding:1.5rem 1.5rem 0;font-size:1.125rem;font-weight:600}[data-slot=\"search-layout\"]{display:grid;gap:2rem}[data-slot=\"search-sidebar\"]{display:none}[data-slot=\"search-layout\"] > div > [data-slot=\"search-filters-trigger\"]{margin-bottom:1rem}@media (min-width:1024px){[data-slot=\"search-layout\"]{grid-template-columns:280px minmax(0,1fr)}[data-slot=\"search-sidebar\"]{display:block;position:sticky;top:1.5rem;align-self:start}[data-slot=\"search-layout\"] > div > [data-slot=\"search-filters-trigger\"]{display:none}}[data-slot=\"listing-card-link\"]{display:block;color:inherit;text-decoration:none;cursor:pointer}[data-slot=\"listing-card-media\"]{position:relative;width:100%;overflow:hidden;background:var(--muted,#f5f5f4);aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"listing-card-media\"] img{height:100%;width:100%;object-fit:cover;transition:transform 0.3s}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:scale(1.05)}@media (prefers-reduced-motion:reduce){[data-slot=\"listing-card-media\"] img{transition:none}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:none}}[data-slot=\"listing-card-empty\"]{display:flex;height:100%;width:100%;align-items:center;justify-content:center;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-cta\"]{margin-top:0.75rem}[data-slot=\"search-filters\"]{display:flex;flex-direction:column;gap:1.25rem}[data-slot=\"search-filter\"]{margin:0;padding:0;border:0;font-size:0.875rem}[data-slot=\"search-filter\"] legend{margin-bottom:0.5rem;padding:0;color:var(--muted-foreground,#737373)}[data-slot=\"search-range-row\"]{display:flex;align-items:flex-end;gap:0.5rem}[data-slot=\"search-range-side\"]{min-width:0;flex:1}[data-slot=\"search-range-side\"] > span:first-child{margin-bottom:0.25rem;display:block;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-range-affix\"]{position:relative;display:block}[data-slot=\"search-range-prefix\"]{pointer-events:none;position:absolute;inset-block:0;left:0;display:flex;align-items:center;padding-left:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-range-input\"]{min-height:2.5rem;width:100%;border-radius:var(--garagem-search-radius);border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:0 0.75rem}[data-slot=\"search-range-affix\"] [data-slot=\"search-range-input\"]{padding-left:2.5rem}[data-slot=\"search-count-group\"]{display:flex;flex-wrap:wrap;gap:0.375rem}[data-slot=\"search-count-choice\"]{min-height:2.5rem;cursor:pointer;border-radius:var(--garagem-search-radius);border:1px solid var(--border,#e4e4e7);background:var(--background,#fff);padding:0 0.75rem;font-size:0.875rem}[data-slot=\"search-count-choice\"][data-selected=\"true\"]{border-color:var(--primary,#111);background:color-mix(in srgb,var(--primary,#111) 10%,transparent)}[data-slot=\"search-enum-list\"],[data-slot=\"search-scroll\"]{display:flex;flex-direction:column;gap:0.375rem}[data-slot=\"search-enum-option\"]{display:flex;cursor:pointer;align-items:center;gap:0.5rem}[data-slot=\"listing-card-badge\"]{position:absolute;left:0.75rem;top:0.75rem;border-radius:999px;background:color-mix(in srgb,var(--background,#fff) 90%,transparent);padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500}[data-slot=\"listing-card-body\"]{padding:1rem}[data-slot=\"listing-card-title\"]{display:-webkit-box;margin-top:0.25rem;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;font-size:0.875rem;font-weight:500}[data-slot=\"listing-card-location\"]{margin-top:0.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-features\"]{display:flex;flex-wrap:wrap;margin-top:0.75rem;gap:0.25rem 1rem;padding:0;list-style:none;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-skeleton-block\"]{animation:garagem-search-pulse 1.2s ease-in-out infinite;background:var(--garagem-skeleton);border-radius:0.375rem}[data-slot=\"search-skeleton-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7)}[data-slot=\"search-skeleton-body\"]{display:flex;flex-direction:column;gap:0.5rem;padding:1rem}[data-slot=\"search-skeleton-block\"][data-kind=\"media\"]{aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"search-skeleton-block\"][data-kind=\"line-lg\"]{height:1.25rem;width:50%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-md\"]{height:1rem;width:75%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-sm\"]{height:0.75rem;width:66.666667%}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-media\"]{max-width:45rem;aspect-ratio:4 / 3}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-title\"]{width:66.666667%;height:2rem;margin-top:1.5rem}@media (prefers-reduced-motion:reduce){[data-slot=\"search-popover\"],[data-slot=\"search-sheet-overlay\"],[data-slot=\"search-sheet-panel\"],[data-slot=\"search-skeleton-block\"]{animation:none}}@keyframes garagem-search-in{from{opacity:0;transform:translateY(-4px) scale(0.98)}to{opacity:1;transform:none}}@keyframes garagem-search-fade{from{opacity:0}to{opacity:1}}@keyframes garagem-search-sheet{from{transform:translateX(100%)}to{transform:none}}@keyframes garagem-search-pulse{50%{opacity:0.55}}";
|
|
4
|
+
export const SEARCH_CHROME_CSS_VERSION = "0.5.0";
|
|
5
|
+
export const SEARCH_CHROME_CSS = ":root{--garagem-listing-card-radius:0.75rem;--garagem-listing-card-gap:1.5rem;--garagem-listing-price-size:1.125rem;--garagem-listing-media-ratio:4 / 3;--garagem-skeleton:var(--muted,#e7e5e4)}[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{display:grid;grid-template-columns:1fr;gap:var(--garagem-listing-card-gap)}@media (min-width:640px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(3,minmax(0,1fr))}}[data-slot=\"listing-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7);background:var(--card,var(--background,#fff))}[data-slot=\"listing-card-price-row\"]{display:inline-flex;align-items:baseline;gap:0.25rem}[data-slot=\"listing-card-price\"]{font-size:var(--garagem-listing-price-size);font-weight:600}[data-slot=\"listing-card-period\"]{font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-link\"]{display:block;color:inherit;text-decoration:none;cursor:pointer}[data-slot=\"listing-card-media\"]{position:relative;width:100%;overflow:hidden;background:var(--muted,#f5f5f4);aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"listing-card-media\"] img{height:100%;width:100%;object-fit:cover;transition:transform 0.3s}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:scale(1.05)}@media (prefers-reduced-motion:reduce){[data-slot=\"listing-card-media\"] img{transition:none}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:none}}[data-slot=\"listing-card-empty\"]{display:flex;height:100%;width:100%;align-items:center;justify-content:center;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-cta\"]{margin-top:0.75rem}[data-slot=\"listing-card-badge\"]{position:absolute;left:0.75rem;top:0.75rem;border-radius:999px;background:color-mix(in srgb,var(--background,#fff) 90%,transparent);padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500}[data-slot=\"listing-card-body\"]{padding:1rem}[data-slot=\"listing-card-title\"]{display:-webkit-box;margin-top:0.25rem;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;font-size:0.875rem;font-weight:500}[data-slot=\"listing-card-location\"]{margin-top:0.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-features\"]{display:flex;flex-wrap:wrap;margin-top:0.75rem;gap:0.25rem 1rem;padding:0;list-style:none;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-skeleton-block\"]{animation:garagem-search-pulse 1.2s ease-in-out infinite;background:var(--garagem-skeleton);border-radius:0.375rem}[data-slot=\"search-skeleton-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7)}[data-slot=\"search-skeleton-body\"]{display:flex;flex-direction:column;gap:0.5rem;padding:1rem}[data-slot=\"search-skeleton-block\"][data-kind=\"media\"]{aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"search-skeleton-block\"][data-kind=\"line-lg\"]{height:1.25rem;width:50%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-md\"]{height:1rem;width:75%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-sm\"]{height:0.75rem;width:66.666667%}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-media\"]{max-width:45rem;aspect-ratio:4 / 3}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-title\"]{width:66.666667%;height:2rem;margin-top:1.5rem}@media (prefers-reduced-motion:reduce){[data-slot=\"search-skeleton-block\"]{animation:none}}@keyframes garagem-search-pulse{50%{opacity:0.55}}";
|
package/src/react/types.ts
CHANGED
|
@@ -9,38 +9,6 @@ import type {
|
|
|
9
9
|
import type { ListingCardModel } from "../listing-card-model";
|
|
10
10
|
import type { LocationNameTables } from "../search-engine";
|
|
11
11
|
|
|
12
|
-
export type SearchPageVariant = "toolbar" | "dialog" | "sidebar";
|
|
13
|
-
|
|
14
|
-
export type SearchPageClassNames = {
|
|
15
|
-
root?: string;
|
|
16
|
-
header?: string;
|
|
17
|
-
heading?: string;
|
|
18
|
-
headingCount?: string;
|
|
19
|
-
headingTitle?: string;
|
|
20
|
-
toolbar?: string;
|
|
21
|
-
toolbarTrigger?: string;
|
|
22
|
-
popover?: string;
|
|
23
|
-
query?: string;
|
|
24
|
-
sort?: string;
|
|
25
|
-
icon?: string;
|
|
26
|
-
sidebar?: string;
|
|
27
|
-
dialog?: string;
|
|
28
|
-
dialogOverlay?: string;
|
|
29
|
-
dialogPanel?: string;
|
|
30
|
-
grid?: string;
|
|
31
|
-
card?: string;
|
|
32
|
-
pagination?: string;
|
|
33
|
-
applyBar?: string;
|
|
34
|
-
skeleton?: string;
|
|
35
|
-
empty?: string;
|
|
36
|
-
checkbox?: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type SearchPageIcons = {
|
|
40
|
-
search?: ReactNode;
|
|
41
|
-
clear?: ReactNode;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
12
|
export type ListingCardClassNames = {
|
|
45
13
|
root?: string;
|
|
46
14
|
media?: string;
|
package/src/search-engine.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseSearchPublicPath,
|
|
10
10
|
pathFiltersToQueryFilters,
|
|
11
11
|
} from "./path";
|
|
12
|
-
import { parseGroupedInteger } from "./presentation";
|
|
12
|
+
import { formatGroupedInteger, parseGroupedInteger } from "./presentation";
|
|
13
13
|
import type {
|
|
14
14
|
AppliedSearchChange,
|
|
15
15
|
AppliedSearchQuery,
|
|
@@ -481,3 +481,49 @@ export function paginationPages(
|
|
|
481
481
|
for (let i = start; i <= end; i += 1) pages.push(i);
|
|
482
482
|
return pages;
|
|
483
483
|
}
|
|
484
|
+
|
|
485
|
+
export const SEARCH_EMPTY_COPY =
|
|
486
|
+
"Nenhum imóvel encontrado. Ajuste a busca ou os filtros.";
|
|
487
|
+
|
|
488
|
+
export function rangeDraftFromPath(
|
|
489
|
+
pathFilters: SearchPathFilters
|
|
490
|
+
): Record<string, { min: string; max: string }> {
|
|
491
|
+
const price = pathFilters.price || {};
|
|
492
|
+
const area = pathFilters.area || {};
|
|
493
|
+
return {
|
|
494
|
+
price: {
|
|
495
|
+
min: price.min != null ? formatGroupedInteger(price.min) : "",
|
|
496
|
+
max: price.max != null ? formatGroupedInteger(price.max) : "",
|
|
497
|
+
},
|
|
498
|
+
property_area_total: {
|
|
499
|
+
min: area.min != null ? String(area.min) : "",
|
|
500
|
+
max: area.max != null ? String(area.max) : "",
|
|
501
|
+
},
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export type SearchChromeModel = {
|
|
506
|
+
headingTitle: string;
|
|
507
|
+
toolbarFilters: SearchUiFilter[];
|
|
508
|
+
extraFilters: SearchUiFilter[];
|
|
509
|
+
sortOptions: Array<{ id: string; label: string }>;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
export function searchChromeModel(
|
|
513
|
+
schema: SearchUi | null,
|
|
514
|
+
pathFilters: SearchPathFilters,
|
|
515
|
+
locationNames?: LocationNameTables | null
|
|
516
|
+
): SearchChromeModel {
|
|
517
|
+
const filters = visibleSearchFilters(schema);
|
|
518
|
+
const toolbarIds = new Set(toolbarFilterIds(schema));
|
|
519
|
+
return {
|
|
520
|
+
headingTitle: searchResultsHeading(
|
|
521
|
+
pathFilters,
|
|
522
|
+
schema?.dictionary,
|
|
523
|
+
locationNames
|
|
524
|
+
),
|
|
525
|
+
toolbarFilters: filters.filter((filter) => toolbarIds.has(filter.id)),
|
|
526
|
+
extraFilters: filters.filter((filter) => !toolbarIds.has(filter.id)),
|
|
527
|
+
sortOptions: searchSortOptions(schema?.sorts),
|
|
528
|
+
};
|
|
529
|
+
}
|