@garagem-ai/site-sdk 0.4.12 → 0.4.14
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 +29 -25
- package/dist/index.d.mts +8 -130
- package/dist/index.d.ts +8 -130
- package/dist/index.js +43 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -17
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +28 -2
- package/dist/react.d.ts +28 -2
- package/dist/react.js +645 -109
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +649 -114
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-B83s_fVd.d.mts → search-engine-1O4sKtKb.d.mts} +141 -1
- package/dist/{search-engine-B83s_fVd.d.ts → search-engine-1O4sKtKb.d.ts} +141 -1
- package/package.json +1 -1
- package/src/index.ts +7 -0
- package/src/listing-detail-fields.ts +59 -0
- package/src/listing-detail.ts +27 -9
- package/src/react/index.ts +5 -0
- package/src/react/listing-detail-fields.tsx +119 -0
- package/src/react/search-page.tsx +7 -0
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/react/types.ts +1 -0
- package/src/studio-contract.ts +8 -8
package/dist/react.mjs
CHANGED
|
@@ -109,7 +109,7 @@ function cn(...parts) {
|
|
|
109
109
|
import { useLayoutEffect } from "react";
|
|
110
110
|
|
|
111
111
|
// src/react/styles/search-chrome-css.generated.ts
|
|
112
|
-
var SEARCH_CHROME_CSS_VERSION = "0.4.
|
|
112
|
+
var SEARCH_CHROME_CSS_VERSION = "0.4.14";
|
|
113
113
|
var 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}}`;
|
|
114
114
|
|
|
115
115
|
// src/react/styles/search-chrome-styles.tsx
|
|
@@ -212,13 +212,341 @@ function ListingCard({
|
|
|
212
212
|
] });
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
// src/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
// src/amenity-labels.ts
|
|
216
|
+
var LISTING_AMENITY_TITLES = {
|
|
217
|
+
unit: "Comodidades",
|
|
218
|
+
building: "Comodidades do condom\xEDnio"
|
|
219
|
+
};
|
|
220
|
+
var AMENITY_FALLBACK_LABELS = {
|
|
221
|
+
// ==================== PROPERTY FEATURES ====================
|
|
222
|
+
// Amenities
|
|
223
|
+
arCondicionado: "Ar condicionado",
|
|
224
|
+
banheira: "Banheira",
|
|
225
|
+
carregadorEletrico: "Carregador el\xE9trico",
|
|
226
|
+
churrasqueira: "Churrasqueira",
|
|
227
|
+
chuveiroGas: "Chuveiro a g\xE1s",
|
|
228
|
+
chuveiroEletrico: "Chuveiro el\xE9trico",
|
|
229
|
+
energiaSolar: "Energia solar",
|
|
230
|
+
fechaduraDigital: "Fechadura digital",
|
|
231
|
+
fechaduraEletronica: "Fechadura eletr\xF4nica",
|
|
232
|
+
geradorEletrico: "Gerador el\xE9trico",
|
|
233
|
+
gesso: "Gesso",
|
|
234
|
+
hidromassagem: "Hidromassagem",
|
|
235
|
+
lareira: "Lareira",
|
|
236
|
+
ofuro: "Ofur\xF4",
|
|
237
|
+
spa: "Spa",
|
|
238
|
+
painelSolar: "Painel solar",
|
|
239
|
+
portaoEletronico: "Port\xE3o eletr\xF4nico",
|
|
240
|
+
sistemaAlarme: "Sistema de alarme",
|
|
241
|
+
homeTheater: "Home theater",
|
|
242
|
+
adega: "Adega",
|
|
243
|
+
split: "Split",
|
|
244
|
+
arCentral: "Ar central",
|
|
245
|
+
esperaSplit: "Espera para split",
|
|
246
|
+
vistaMar: "Vista para o mar",
|
|
247
|
+
vistaPanoramica: "Vista panor\xE2mica",
|
|
248
|
+
aguaQuente: "\xC1gua quente",
|
|
249
|
+
reformado: "Reformado",
|
|
250
|
+
tvCabo: "TV a cabo",
|
|
251
|
+
gradeado: "Gradeado",
|
|
252
|
+
antenaParabolica: "Antena parab\xF3lica",
|
|
253
|
+
aquecimento: "Aquecimento",
|
|
254
|
+
aquecimentoEletrico: "Aquecimento el\xE9trico",
|
|
255
|
+
aquecimentoCentral: "Aquecimento central",
|
|
256
|
+
cercaEletrica: "Cerca el\xE9trica",
|
|
257
|
+
monitoramento: "Monitoramento",
|
|
258
|
+
vigiaInterno: "Vigia interno",
|
|
259
|
+
vigiaExterno: "Vigia externo",
|
|
260
|
+
alarme: "Alarme",
|
|
261
|
+
agua: "\xC1gua",
|
|
262
|
+
redeEsgoto: "Rede de esgoto",
|
|
263
|
+
pavimentacao: "Pavimenta\xE7\xE3o",
|
|
264
|
+
energiaEletrica: "Energia el\xE9trica",
|
|
265
|
+
// Furniture
|
|
266
|
+
mobiliado: "Mobiliado",
|
|
267
|
+
armarioEmbutido: "Arm\xE1rio embutido",
|
|
268
|
+
armarioEmbutidoQuarto: "Arm\xE1rio embutido quarto",
|
|
269
|
+
armarioCozinha: "Arm\xE1rio cozinha",
|
|
270
|
+
armarioBanheiro: "Arm\xE1rio banheiro",
|
|
271
|
+
cozinhaPlanejada: "Cozinha planejada",
|
|
272
|
+
fogao: "Fog\xE3o",
|
|
273
|
+
fornoPizza: "Forno de pizza",
|
|
274
|
+
freezer: "Freezer",
|
|
275
|
+
dormitorioComArmario: "Dormit\xF3rio com arm\xE1rio",
|
|
276
|
+
semiMobiliado: "Semi mobiliado",
|
|
277
|
+
salaArmarios: "Sala com arm\xE1rios",
|
|
278
|
+
// Structure
|
|
279
|
+
piscina: "Piscina",
|
|
280
|
+
piscinaAquecida: "Piscina aquecida",
|
|
281
|
+
piscinaCoberta: "Piscina coberta",
|
|
282
|
+
poco: "Po\xE7o",
|
|
283
|
+
pocoArtesiano: "Po\xE7o artesiano",
|
|
284
|
+
bar: "Bar",
|
|
285
|
+
jardim: "Jardim",
|
|
286
|
+
lago: "Lago",
|
|
287
|
+
lavabo: "Lavabo",
|
|
288
|
+
quintal: "Quintal",
|
|
289
|
+
solarium: "Solarium",
|
|
290
|
+
quartoServico: "Quarto de servi\xE7o",
|
|
291
|
+
varanda: "Varanda",
|
|
292
|
+
varandaFechadaVidro: "Varanda fechada com vidro",
|
|
293
|
+
varandaGourmet: "Varanda gourmet",
|
|
294
|
+
banheiroServico: "Banheiro de servi\xE7o",
|
|
295
|
+
areaServico: "\xC1rea de servi\xE7o",
|
|
296
|
+
cinema: "Cinema",
|
|
297
|
+
closet: "Closet",
|
|
298
|
+
cozinhaAmericana: "Cozinha americana",
|
|
299
|
+
cozinhaGourmet: "Cozinha gourmet",
|
|
300
|
+
despensa: "Despensa",
|
|
301
|
+
escritorio: "Escrit\xF3rio",
|
|
302
|
+
edicula: "Ed\xEDcula",
|
|
303
|
+
horta: "Horta",
|
|
304
|
+
sacada: "Sacada",
|
|
305
|
+
salaJantar: "Sala de jantar",
|
|
306
|
+
cozinha: "Cozinha",
|
|
307
|
+
banheiroSocial: "Banheiro social",
|
|
308
|
+
terraco: "Terra\xE7o",
|
|
309
|
+
copa: "Copa",
|
|
310
|
+
suiteMaster: "Su\xEDte master",
|
|
311
|
+
wcEmpregada: "WC empregada",
|
|
312
|
+
dependenciaEmpregada: "Depend\xEAncia de empregada",
|
|
313
|
+
dependenciadeEmpregada: "Depend\xEAncia empregada",
|
|
314
|
+
salaTv: "Sala de TV",
|
|
315
|
+
copaCozinha: "Copa cozinha",
|
|
316
|
+
sacadaComChurrasqueira: "Sacada com churrasqueira",
|
|
317
|
+
hallPrivativo: "Hall privativo",
|
|
318
|
+
estarIntimo: "Estar \xEDntimo",
|
|
319
|
+
livingHall: "Living hall",
|
|
320
|
+
piscinaInterna: "Piscina interna",
|
|
321
|
+
deck: "Deck",
|
|
322
|
+
jardimInverno: "Jardim de inverno",
|
|
323
|
+
rouparia: "Rouparia",
|
|
324
|
+
living: "Living",
|
|
325
|
+
familyRoom: "Family room",
|
|
326
|
+
salafitness: "Sala fitness",
|
|
327
|
+
salaEstar: "Sala de estar",
|
|
328
|
+
mezanino: "Mezanino",
|
|
329
|
+
pisoElevado: "Piso elevado",
|
|
330
|
+
entradaServicoIndependente: "Entrada de servi\xE7o independente",
|
|
331
|
+
forro: "Forro",
|
|
332
|
+
vitrine: "Vitrine",
|
|
333
|
+
banheiroAuxiliar: "Banheiro auxiliar",
|
|
334
|
+
gabinete: "Gabinete",
|
|
335
|
+
quadraTenisPrivativa: "Quadra de t\xEAnis privativa",
|
|
336
|
+
porao: "Por\xE3o",
|
|
337
|
+
sotao: "S\xF3t\xE3o",
|
|
338
|
+
patio: "P\xE1tio",
|
|
339
|
+
canaletasNoRodape: "Canaletas no rodap\xE9",
|
|
340
|
+
// Accessibility
|
|
341
|
+
barraApoioVaso: "Barra de apoio vaso",
|
|
342
|
+
barraApoioChuveiro: "Barra de apoio chuveiro",
|
|
343
|
+
entradaSemDegrau: "Entrada sem degrau",
|
|
344
|
+
rampasAcesso: "Rampas de acesso",
|
|
345
|
+
vagaDeficientes: "Vaga para deficientes",
|
|
346
|
+
// Flooring
|
|
347
|
+
cimentoQueimado: "Cimento queimado",
|
|
348
|
+
madeira: "Madeira",
|
|
349
|
+
pisoFrio: "Piso frio",
|
|
350
|
+
laminado: "Laminado",
|
|
351
|
+
vinilico: "Vin\xEDlico",
|
|
352
|
+
porcelanato: "Porcelanato",
|
|
353
|
+
// ==================== BUILDING FEATURES ====================
|
|
354
|
+
// Amenities
|
|
355
|
+
elevador: "Elevador",
|
|
356
|
+
bicicletario: "Biciclet\xE1rio",
|
|
357
|
+
carregadorEletronico: "Carregador eletr\xF4nico",
|
|
358
|
+
concierge: "Concierge",
|
|
359
|
+
coworking: "Coworking",
|
|
360
|
+
deposito: "Dep\xF3sito",
|
|
361
|
+
lavanderia: "Lavanderia",
|
|
362
|
+
petPlace: "Pet place",
|
|
363
|
+
recebimentoEncomendas: "Recebimento de encomendas",
|
|
364
|
+
salaReuniao: "Sala de reuni\xE3o",
|
|
365
|
+
salaoFestas: "Sal\xE3o de festas",
|
|
366
|
+
valet: "Valet",
|
|
367
|
+
garagemCoberta: "Garagem coberta",
|
|
368
|
+
elevadorServico: "Elevador de servi\xE7o",
|
|
369
|
+
// Leisure
|
|
370
|
+
academia: "Academia",
|
|
371
|
+
campoFutebol: "Campo de futebol",
|
|
372
|
+
espacoGourmet: "Espa\xE7o gourmet",
|
|
373
|
+
piscinaInfantil: "Piscina infantil",
|
|
374
|
+
pistaCaminhada: "Pista de caminhada",
|
|
375
|
+
playground: "Playground",
|
|
376
|
+
quadraPoliesportiva: "Quadra poliesportiva",
|
|
377
|
+
quadraTenis: "Quadra de t\xEAnis",
|
|
378
|
+
salaJogos: "Sala de jogos",
|
|
379
|
+
salaVapor: "Sala de vapor",
|
|
380
|
+
sauna: "Sauna",
|
|
381
|
+
// Security
|
|
382
|
+
circuitoTv: "Circuito fechado de TV",
|
|
383
|
+
controleAcessoEletronico: "Controle de acesso eletr\xF4nico",
|
|
384
|
+
interfone: "Interfone",
|
|
385
|
+
portaria24h: "Portaria 24h",
|
|
386
|
+
porteiroFisico: "Porteiro f\xEDsico",
|
|
387
|
+
seguranca24h: "Seguran\xE7a 24h",
|
|
388
|
+
segurancaPatrimonial: "Seguran\xE7a patrimonial",
|
|
389
|
+
condominioFechado: "Condom\xEDnio fechado",
|
|
390
|
+
// Accessibility
|
|
391
|
+
banheiroAcessivel: "Banheiro acess\xEDvel",
|
|
392
|
+
elevadorAcessivel: "Elevador acess\xEDvel",
|
|
393
|
+
pisoTatil: "Piso t\xE1til",
|
|
394
|
+
// ==================== CANONICAL HAS*/IS* KEYS ====================
|
|
395
|
+
has24hConcierge: "Portaria 24h",
|
|
396
|
+
has24hSecurity: "Seguran\xE7a 24h",
|
|
397
|
+
hasAccessRamps: "Rampas de acesso",
|
|
398
|
+
hasAccessibleBathroom: "Banheiro acess\xEDvel",
|
|
399
|
+
hasAccessibleElevator: "Elevador acess\xEDvel",
|
|
400
|
+
hasAirConditioning: "Ar condicionado",
|
|
401
|
+
hasAlarmSystem: "Sistema de alarme",
|
|
402
|
+
hasBalcony: "Varanda",
|
|
403
|
+
hasBikeStorage: "Biciclet\xE1rio",
|
|
404
|
+
hasBuiltInWardrobe: "Arm\xE1rio embutido",
|
|
405
|
+
hasCCTV: "CFTV",
|
|
406
|
+
hasCloset: "Closet",
|
|
407
|
+
hasConcierge: "Portaria",
|
|
408
|
+
hasControlledAccess: "Condom\xEDnio fechado",
|
|
409
|
+
hasCoworking: "Coworking",
|
|
410
|
+
hasDisabledParking: "Vaga para deficientes",
|
|
411
|
+
hasElectricCharger: "Carregador eletr\xF4nico",
|
|
412
|
+
hasElectronicGate: "Port\xE3o eletr\xF4nico",
|
|
413
|
+
hasElevator: "Elevador",
|
|
414
|
+
hasFireplace: "Lareira",
|
|
415
|
+
hasGarden: "Jardim",
|
|
416
|
+
hasGasShower: "Chuveiro a g\xE1s",
|
|
417
|
+
hasGenerator: "Gerador",
|
|
418
|
+
hasGourmetBalcony: "Varanda gourmet",
|
|
419
|
+
hasGourmetKitchen: "Cozinha gourmet",
|
|
420
|
+
hasGrill: "Churrasqueira",
|
|
421
|
+
hasGuestParking: "Estacionamento para visitantes",
|
|
422
|
+
hasGym: "Academia",
|
|
423
|
+
hasHeating: "Aquecimento",
|
|
424
|
+
hasHomeOffice: "Home office",
|
|
425
|
+
hasIntercom: "Interfone",
|
|
426
|
+
hasJacuzzi: "Hidromassagem",
|
|
427
|
+
hasKidsPool: "Piscina infantil",
|
|
428
|
+
hasLaundry: "Lavanderia",
|
|
429
|
+
hasMeetingRoom: "Sala de reuni\xE3o",
|
|
430
|
+
hasOffice: "Escrit\xF3rio",
|
|
431
|
+
hasOpenKitchen: "Cozinha americana",
|
|
432
|
+
hasPackageReceival: "Recebimento de encomendas",
|
|
433
|
+
hasPantry: "Despensa",
|
|
434
|
+
hasParkingGarage: "Garagem coberta",
|
|
435
|
+
hasPartySaloon: "Sal\xE3o de festas",
|
|
436
|
+
hasPetArea: "Pet place",
|
|
437
|
+
hasPipedGas: "G\xE1s encanado",
|
|
438
|
+
hasPlayground: "Playground",
|
|
439
|
+
hasPowderRoom: "Lavabo",
|
|
440
|
+
hasPrivatePool: "Piscina privativa",
|
|
441
|
+
hasSauna: "Sauna",
|
|
442
|
+
hasSecurity: "Seguran\xE7a",
|
|
443
|
+
hasServiceArea: "\xC1rea de servi\xE7o",
|
|
444
|
+
hasSolarPanel: "Painel solar",
|
|
445
|
+
hasSpa: "Spa",
|
|
446
|
+
hasSportsCourt: "Quadra de esportes",
|
|
447
|
+
hasStepFreeEntrance: "Entrada sem degrau",
|
|
448
|
+
hasStorage: "Dep\xF3sito",
|
|
449
|
+
hasSwimmingPool: "Piscina",
|
|
450
|
+
hasTennisCourt: "Quadra de t\xEAnis",
|
|
451
|
+
hasValetParking: "Valet",
|
|
452
|
+
homeOffice: "Home office",
|
|
453
|
+
isPetFriendly: "Pet friendly",
|
|
454
|
+
isFurnished: "Mobiliado",
|
|
455
|
+
isPartiallyFurnished: "Semi-mobiliado",
|
|
456
|
+
petFriendly: "Pet friendly",
|
|
457
|
+
piscinaPrivativa: "Piscina privativa",
|
|
458
|
+
pisoLaminado: "Piso laminado",
|
|
459
|
+
pisoMadeira: "Piso de madeira",
|
|
460
|
+
pisoPorcelanato: "Piso porcelanato",
|
|
461
|
+
quadraEsportes: "Quadra de esportes",
|
|
462
|
+
rooftop: "Rooftop",
|
|
463
|
+
suite: "Su\xEDte",
|
|
464
|
+
triplex: "Triplex",
|
|
465
|
+
duplex: "Duplex",
|
|
466
|
+
cobertura: "Cobertura",
|
|
467
|
+
forroGesso: "Forro de gesso",
|
|
468
|
+
gerador: "Gerador",
|
|
469
|
+
armariosCozinha: "Arm\xE1rios na cozinha",
|
|
470
|
+
armariosQuarto: "Arm\xE1rios nos quartos",
|
|
471
|
+
cftv: "CFTV"
|
|
472
|
+
};
|
|
473
|
+
function lookupLabel(id, options) {
|
|
474
|
+
const fromDictionary = options?.find((option) => option.id === id)?.label;
|
|
475
|
+
if (fromDictionary?.trim()) return fromDictionary.trim();
|
|
476
|
+
return AMENITY_FALLBACK_LABELS[id];
|
|
477
|
+
}
|
|
478
|
+
function labelAmenities(ids, dictionary) {
|
|
479
|
+
if (!ids?.length) return [];
|
|
480
|
+
const labels = [];
|
|
481
|
+
const seen = /* @__PURE__ */ new Set();
|
|
482
|
+
for (const id of ids) {
|
|
483
|
+
if (!id) continue;
|
|
484
|
+
const label = lookupLabel(id, dictionary);
|
|
485
|
+
if (!label || seen.has(label)) continue;
|
|
486
|
+
seen.add(label);
|
|
487
|
+
labels.push(label);
|
|
488
|
+
}
|
|
489
|
+
return labels.sort((a, b) => a.localeCompare(b, "pt-BR"));
|
|
490
|
+
}
|
|
491
|
+
function presentIds(ids) {
|
|
492
|
+
return (ids ?? []).filter((id) => Boolean(id));
|
|
493
|
+
}
|
|
494
|
+
function buildingIdsFromMergedAmenities(listing, unitIds) {
|
|
495
|
+
if (!listing.amenities || listing.propertyFeatures == null) return [];
|
|
496
|
+
const unitCounts = /* @__PURE__ */ new Map();
|
|
497
|
+
for (const id of unitIds) {
|
|
498
|
+
unitCounts.set(id, (unitCounts.get(id) ?? 0) + 1);
|
|
499
|
+
}
|
|
500
|
+
return listing.amenities.filter((id) => {
|
|
501
|
+
if (!id) return false;
|
|
502
|
+
const count = unitCounts.get(id);
|
|
503
|
+
if (count === void 0 || count === 0) return true;
|
|
504
|
+
unitCounts.set(id, count - 1);
|
|
505
|
+
return false;
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function unitAmenityIds(listing) {
|
|
509
|
+
if (listing.propertyFeatures != null) {
|
|
510
|
+
return presentIds(listing.propertyFeatures);
|
|
511
|
+
}
|
|
512
|
+
const building = new Set(
|
|
513
|
+
listing.building?.amenities ?? listing.buildingAmenities ?? []
|
|
514
|
+
);
|
|
515
|
+
return (listing.amenities ?? []).filter((id) => id && !building.has(id));
|
|
516
|
+
}
|
|
517
|
+
function buildingAmenityIds(listing) {
|
|
518
|
+
if (listing.building != null && listing.building.amenities != null) {
|
|
519
|
+
return presentIds(listing.building.amenities);
|
|
520
|
+
}
|
|
521
|
+
if (listing.buildingAmenities != null) {
|
|
522
|
+
return presentIds(listing.buildingAmenities);
|
|
523
|
+
}
|
|
524
|
+
return buildingIdsFromMergedAmenities(listing, unitAmenityIds(listing));
|
|
525
|
+
}
|
|
526
|
+
function listingAmenityGroups(listing, dictionary) {
|
|
527
|
+
const groups = [];
|
|
528
|
+
const unitIds = unitAmenityIds(listing);
|
|
529
|
+
const unitLabels = labelAmenities(unitIds, dictionary?.propertyFeatures);
|
|
530
|
+
if (unitLabels.length > 0) {
|
|
531
|
+
groups.push({
|
|
532
|
+
key: "unit",
|
|
533
|
+
title: LISTING_AMENITY_TITLES.unit,
|
|
534
|
+
labels: unitLabels
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
const buildingLabels = labelAmenities(
|
|
538
|
+
buildingAmenityIds(listing),
|
|
539
|
+
dictionary?.buildingAmenities
|
|
540
|
+
);
|
|
541
|
+
if (buildingLabels.length > 0) {
|
|
542
|
+
groups.push({
|
|
543
|
+
key: "building",
|
|
544
|
+
title: LISTING_AMENITY_TITLES.building,
|
|
545
|
+
labels: buildingLabels
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
return groups;
|
|
549
|
+
}
|
|
222
550
|
|
|
223
551
|
// ../search-url/types.ts
|
|
224
552
|
var SEARCH_BASE_ROUTE = "imoveis";
|
|
@@ -964,8 +1292,213 @@ function paginationPages(currentPage, totalPages, padding) {
|
|
|
964
1292
|
return pages;
|
|
965
1293
|
}
|
|
966
1294
|
|
|
967
|
-
// src/
|
|
1295
|
+
// src/listing-detail.ts
|
|
1296
|
+
function finiteNumber(value) {
|
|
1297
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
1298
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
1299
|
+
const parsed = Number(value);
|
|
1300
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
1301
|
+
}
|
|
1302
|
+
return null;
|
|
1303
|
+
}
|
|
1304
|
+
function positiveCount(value) {
|
|
1305
|
+
const amount = finiteNumber(value);
|
|
1306
|
+
return amount != null && amount > 0 ? amount : null;
|
|
1307
|
+
}
|
|
1308
|
+
function formatFloorFact(value) {
|
|
1309
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1310
|
+
return value === 0 ? "T\xE9rreo" : String(value);
|
|
1311
|
+
}
|
|
1312
|
+
if (typeof value !== "string") return null;
|
|
1313
|
+
const trimmed = value.trim();
|
|
1314
|
+
if (!trimmed) return null;
|
|
1315
|
+
const parsed = Number(trimmed);
|
|
1316
|
+
if (Number.isFinite(parsed) && trimmed === String(parsed)) {
|
|
1317
|
+
return parsed === 0 ? "T\xE9rreo" : trimmed;
|
|
1318
|
+
}
|
|
1319
|
+
return trimmed;
|
|
1320
|
+
}
|
|
1321
|
+
function listingValues(listing) {
|
|
1322
|
+
const values = [
|
|
1323
|
+
{
|
|
1324
|
+
key: "price",
|
|
1325
|
+
label: "Pre\xE7o",
|
|
1326
|
+
text: listing.priceVisibility === "private" ? "Sob consulta" : formatListingPrice(listing.price)
|
|
1327
|
+
}
|
|
1328
|
+
];
|
|
1329
|
+
const condoFee = positiveCount(listing.property?.condoFee);
|
|
1330
|
+
if (condoFee != null) {
|
|
1331
|
+
values.push({
|
|
1332
|
+
key: "condoFee",
|
|
1333
|
+
label: "Condom\xEDnio",
|
|
1334
|
+
text: formatListingPrice(condoFee)
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
const propertyTax = positiveCount(listing.property?.propertyTax);
|
|
1338
|
+
if (propertyTax != null) {
|
|
1339
|
+
values.push({
|
|
1340
|
+
key: "propertyTax",
|
|
1341
|
+
label: "IPTU",
|
|
1342
|
+
text: formatListingPrice(propertyTax)
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
return values;
|
|
1346
|
+
}
|
|
1347
|
+
function listingFacts(listing) {
|
|
1348
|
+
const property = listing.property ?? {};
|
|
1349
|
+
const facts = [];
|
|
1350
|
+
const area = formatAreaM2(
|
|
1351
|
+
positiveCount(property.usableArea) ?? positiveCount(property.totalArea)
|
|
1352
|
+
);
|
|
1353
|
+
if (area) facts.push({ key: "area", label: "\xC1rea", text: area });
|
|
1354
|
+
const bedrooms = positiveCount(property.bedrooms);
|
|
1355
|
+
if (bedrooms != null) {
|
|
1356
|
+
facts.push({
|
|
1357
|
+
key: "bedrooms",
|
|
1358
|
+
label: "Dormit\xF3rios",
|
|
1359
|
+
text: String(bedrooms)
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
const suites = positiveCount(property.suites);
|
|
1363
|
+
if (suites != null) {
|
|
1364
|
+
facts.push({ key: "suites", label: "Su\xEDtes", text: String(suites) });
|
|
1365
|
+
}
|
|
1366
|
+
const parking = positiveCount(property.parkingSpaces);
|
|
1367
|
+
if (parking != null) {
|
|
1368
|
+
facts.push({ key: "parkingSpaces", label: "Vagas", text: String(parking) });
|
|
1369
|
+
}
|
|
1370
|
+
const rooms = positiveCount(property.rooms);
|
|
1371
|
+
if (rooms != null) {
|
|
1372
|
+
facts.push({ key: "rooms", label: "Salas", text: String(rooms) });
|
|
1373
|
+
}
|
|
1374
|
+
const floorText = formatFloorFact(property.floor);
|
|
1375
|
+
if (floorText) {
|
|
1376
|
+
facts.push({ key: "floor", label: "Andar", text: floorText });
|
|
1377
|
+
}
|
|
1378
|
+
return facts;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
// src/listing-detail-fields.ts
|
|
1382
|
+
function visibleText(value) {
|
|
1383
|
+
if (typeof value !== "string") return null;
|
|
1384
|
+
const trimmed = value.trim();
|
|
1385
|
+
if (!trimmed || trimmed === "undefined" || trimmed === "null") return null;
|
|
1386
|
+
return trimmed;
|
|
1387
|
+
}
|
|
1388
|
+
function visibleRows(rows) {
|
|
1389
|
+
return rows.filter((row) => {
|
|
1390
|
+
const label = visibleText(row.label);
|
|
1391
|
+
const text = visibleText(row.text);
|
|
1392
|
+
return label != null && text != null;
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
function listingDetailFieldsModel(listing, dictionary) {
|
|
1396
|
+
return {
|
|
1397
|
+
facts: visibleRows(listingFacts(listing)),
|
|
1398
|
+
values: visibleRows(listingValues(listing)),
|
|
1399
|
+
amenityGroups: listingAmenityGroups(listing, dictionary).map((group) => ({
|
|
1400
|
+
...group,
|
|
1401
|
+
labels: group.labels.map((label) => visibleText(label)).filter((label) => label != null)
|
|
1402
|
+
})).filter((group) => group.labels.length > 0)
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
// src/react/listing-detail-fields.tsx
|
|
968
1407
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1408
|
+
function ListingDetailFields({
|
|
1409
|
+
listing,
|
|
1410
|
+
dictionary,
|
|
1411
|
+
className,
|
|
1412
|
+
classNames,
|
|
1413
|
+
style
|
|
1414
|
+
}) {
|
|
1415
|
+
const model = listingDetailFieldsModel(listing, dictionary ?? void 0);
|
|
1416
|
+
if (model.facts.length === 0 && model.values.length === 0 && model.amenityGroups.length === 0) {
|
|
1417
|
+
return null;
|
|
1418
|
+
}
|
|
1419
|
+
return /* @__PURE__ */ jsxs2(
|
|
1420
|
+
"div",
|
|
1421
|
+
{
|
|
1422
|
+
"data-slot": "listing-detail-fields",
|
|
1423
|
+
className: cn(className, classNames?.root),
|
|
1424
|
+
style,
|
|
1425
|
+
children: [
|
|
1426
|
+
model.facts.length > 0 ? /* @__PURE__ */ jsx2("ul", { "data-slot": "listing-facts", className: classNames?.facts, children: model.facts.map((fact) => /* @__PURE__ */ jsxs2(
|
|
1427
|
+
"li",
|
|
1428
|
+
{
|
|
1429
|
+
"data-slot": "listing-fact",
|
|
1430
|
+
"data-key": fact.key,
|
|
1431
|
+
className: classNames?.fact,
|
|
1432
|
+
children: [
|
|
1433
|
+
/* @__PURE__ */ jsx2("span", { "data-slot": "listing-fact-label", children: fact.label }),
|
|
1434
|
+
/* @__PURE__ */ jsx2("span", { "data-slot": "listing-fact-text", children: fact.text })
|
|
1435
|
+
]
|
|
1436
|
+
},
|
|
1437
|
+
fact.key
|
|
1438
|
+
)) }) : null,
|
|
1439
|
+
model.values.length > 0 ? /* @__PURE__ */ jsx2("dl", { "data-slot": "listing-values", className: classNames?.values, children: model.values.map((value) => /* @__PURE__ */ jsxs2(
|
|
1440
|
+
"div",
|
|
1441
|
+
{
|
|
1442
|
+
"data-slot": "listing-value",
|
|
1443
|
+
"data-key": value.key,
|
|
1444
|
+
className: classNames?.value,
|
|
1445
|
+
children: [
|
|
1446
|
+
/* @__PURE__ */ jsx2("dt", { "data-slot": "listing-value-label", children: value.label }),
|
|
1447
|
+
/* @__PURE__ */ jsx2("dd", { "data-slot": "listing-value-text", children: value.text })
|
|
1448
|
+
]
|
|
1449
|
+
},
|
|
1450
|
+
value.key
|
|
1451
|
+
)) }) : null,
|
|
1452
|
+
model.amenityGroups.map((group) => /* @__PURE__ */ jsxs2(
|
|
1453
|
+
"section",
|
|
1454
|
+
{
|
|
1455
|
+
"data-slot": "listing-amenities",
|
|
1456
|
+
"data-key": group.key,
|
|
1457
|
+
className: classNames?.amenityGroup,
|
|
1458
|
+
children: [
|
|
1459
|
+
/* @__PURE__ */ jsx2(
|
|
1460
|
+
"h2",
|
|
1461
|
+
{
|
|
1462
|
+
"data-slot": "listing-amenities-title",
|
|
1463
|
+
className: classNames?.amenityTitle,
|
|
1464
|
+
children: group.title
|
|
1465
|
+
}
|
|
1466
|
+
),
|
|
1467
|
+
/* @__PURE__ */ jsx2(
|
|
1468
|
+
"ul",
|
|
1469
|
+
{
|
|
1470
|
+
"data-slot": "listing-amenities-list",
|
|
1471
|
+
className: classNames?.amenityList,
|
|
1472
|
+
children: group.labels.map((label) => /* @__PURE__ */ jsx2(
|
|
1473
|
+
"li",
|
|
1474
|
+
{
|
|
1475
|
+
"data-slot": "listing-amenity-label",
|
|
1476
|
+
className: classNames?.amenityLabel,
|
|
1477
|
+
children: label
|
|
1478
|
+
},
|
|
1479
|
+
label
|
|
1480
|
+
))
|
|
1481
|
+
}
|
|
1482
|
+
)
|
|
1483
|
+
]
|
|
1484
|
+
},
|
|
1485
|
+
group.key
|
|
1486
|
+
))
|
|
1487
|
+
]
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// src/react/search-page.tsx
|
|
1493
|
+
import {
|
|
1494
|
+
useCallback as useCallback2,
|
|
1495
|
+
useEffect as useEffect2,
|
|
1496
|
+
useRef as useRef2,
|
|
1497
|
+
useState as useState2
|
|
1498
|
+
} from "react";
|
|
1499
|
+
|
|
1500
|
+
// src/react/filter-panel.tsx
|
|
1501
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
969
1502
|
function RangeFields({
|
|
970
1503
|
filter,
|
|
971
1504
|
rangeDraft,
|
|
@@ -977,10 +1510,10 @@ function RangeFields({
|
|
|
977
1510
|
const patch = (side, raw) => {
|
|
978
1511
|
onRangePatch(filter.id, side, isPrice ? formatGroupedInteger(raw) : raw);
|
|
979
1512
|
};
|
|
980
|
-
return /* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ jsxs3("fieldset", { "data-slot": "search-filter", children: [
|
|
1514
|
+
/* @__PURE__ */ jsx3("legend", { children: filter.label }),
|
|
1515
|
+
/* @__PURE__ */ jsxs3("div", { "data-slot": "search-range-row", children: [
|
|
1516
|
+
/* @__PURE__ */ jsx3(
|
|
984
1517
|
RangeSide,
|
|
985
1518
|
{
|
|
986
1519
|
id: `${filter.id}-min`,
|
|
@@ -992,7 +1525,7 @@ function RangeFields({
|
|
|
992
1525
|
onEnter: () => onRangeCommit(filter.id, "enter")
|
|
993
1526
|
}
|
|
994
1527
|
),
|
|
995
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ jsx3(
|
|
996
1529
|
RangeSide,
|
|
997
1530
|
{
|
|
998
1531
|
id: `${filter.id}-max`,
|
|
@@ -1004,7 +1537,7 @@ function RangeFields({
|
|
|
1004
1537
|
onEnter: () => onRangeCommit(filter.id, "enter")
|
|
1005
1538
|
}
|
|
1006
1539
|
),
|
|
1007
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsx3(
|
|
1008
1541
|
"button",
|
|
1009
1542
|
{
|
|
1010
1543
|
type: "button",
|
|
@@ -1025,7 +1558,7 @@ function RangeSide({
|
|
|
1025
1558
|
onCommit,
|
|
1026
1559
|
onEnter
|
|
1027
1560
|
}) {
|
|
1028
|
-
const input = /* @__PURE__ */
|
|
1561
|
+
const input = /* @__PURE__ */ jsx3(
|
|
1029
1562
|
"input",
|
|
1030
1563
|
{
|
|
1031
1564
|
id,
|
|
@@ -1046,10 +1579,10 @@ function RangeSide({
|
|
|
1046
1579
|
"data-slot": "search-range-input"
|
|
1047
1580
|
}
|
|
1048
1581
|
);
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
isPrice ? /* @__PURE__ */
|
|
1052
|
-
/* @__PURE__ */
|
|
1582
|
+
return /* @__PURE__ */ jsxs3("label", { "data-slot": "search-range-side", htmlFor: id, children: [
|
|
1583
|
+
/* @__PURE__ */ jsx3("span", { children: label }),
|
|
1584
|
+
isPrice ? /* @__PURE__ */ jsxs3("span", { "data-slot": "search-range-affix", children: [
|
|
1585
|
+
/* @__PURE__ */ jsx3("span", { "data-slot": "search-range-prefix", children: "R$" }),
|
|
1053
1586
|
input
|
|
1054
1587
|
] }) : input
|
|
1055
1588
|
] });
|
|
@@ -1061,9 +1594,9 @@ function CountFields({
|
|
|
1061
1594
|
}) {
|
|
1062
1595
|
const selected = pathFilterValue(pathFilters, filter.id);
|
|
1063
1596
|
const choices = countFacetChoices(filter.options);
|
|
1064
|
-
return /* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1597
|
+
return /* @__PURE__ */ jsxs3("fieldset", { "data-slot": "search-filter", children: [
|
|
1598
|
+
/* @__PURE__ */ jsx3("legend", { children: filter.label }),
|
|
1599
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-count-group", role: "group", children: choices.map((choice) => /* @__PURE__ */ jsx3(
|
|
1067
1600
|
"button",
|
|
1068
1601
|
{
|
|
1069
1602
|
type: "button",
|
|
@@ -1083,10 +1616,10 @@ function EnumFields({
|
|
|
1083
1616
|
}) {
|
|
1084
1617
|
const options = filter.options || [];
|
|
1085
1618
|
const scroll = options.length > 8;
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1619
|
+
return /* @__PURE__ */ jsxs3("fieldset", { "data-slot": "search-filter", children: [
|
|
1620
|
+
/* @__PURE__ */ jsx3("legend", { children: filter.label }),
|
|
1621
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": scroll ? "search-scroll" : "search-enum-list", children: options.map((option) => /* @__PURE__ */ jsxs3("label", { "data-slot": "search-enum-option", children: [
|
|
1622
|
+
/* @__PURE__ */ jsx3(
|
|
1090
1623
|
"input",
|
|
1091
1624
|
{
|
|
1092
1625
|
type: "checkbox",
|
|
@@ -1095,7 +1628,7 @@ function EnumFields({
|
|
|
1095
1628
|
onChange: () => onChange(filter.id, option.id)
|
|
1096
1629
|
}
|
|
1097
1630
|
),
|
|
1098
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsx3("span", { children: option.label })
|
|
1099
1632
|
] }, option.id)) })
|
|
1100
1633
|
] });
|
|
1101
1634
|
}
|
|
@@ -1107,9 +1640,9 @@ function FilterPanel({
|
|
|
1107
1640
|
onRangePatch,
|
|
1108
1641
|
onRangeCommit
|
|
1109
1642
|
}) {
|
|
1110
|
-
return /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsx3("div", { "data-slot": "search-filters", children: filters.map((filter) => {
|
|
1111
1644
|
if (filter.type === "range") {
|
|
1112
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ jsx3(
|
|
1113
1646
|
RangeFields,
|
|
1114
1647
|
{
|
|
1115
1648
|
filter,
|
|
@@ -1121,7 +1654,7 @@ function FilterPanel({
|
|
|
1121
1654
|
);
|
|
1122
1655
|
}
|
|
1123
1656
|
if (filter.type === "count") {
|
|
1124
|
-
return /* @__PURE__ */
|
|
1657
|
+
return /* @__PURE__ */ jsx3(
|
|
1125
1658
|
CountFields,
|
|
1126
1659
|
{
|
|
1127
1660
|
filter,
|
|
@@ -1131,7 +1664,7 @@ function FilterPanel({
|
|
|
1131
1664
|
filter.id
|
|
1132
1665
|
);
|
|
1133
1666
|
}
|
|
1134
|
-
return /* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ jsx3(
|
|
1135
1668
|
EnumFields,
|
|
1136
1669
|
{
|
|
1137
1670
|
filter,
|
|
@@ -1158,7 +1691,7 @@ function rangeDraftFromPath(pathFilters) {
|
|
|
1158
1691
|
}
|
|
1159
1692
|
|
|
1160
1693
|
// src/react/search-chrome.tsx
|
|
1161
|
-
import { Fragment as Fragment2, jsx as
|
|
1694
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1162
1695
|
function SearchSortSelect({
|
|
1163
1696
|
value,
|
|
1164
1697
|
onChange,
|
|
@@ -1166,16 +1699,16 @@ function SearchSortSelect({
|
|
|
1166
1699
|
className
|
|
1167
1700
|
}) {
|
|
1168
1701
|
const options = searchSortOptions(sorts);
|
|
1169
|
-
return /* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ jsxs4("label", { "data-slot": "search-sort", className, children: [
|
|
1703
|
+
/* @__PURE__ */ jsx4("span", { "data-slot": "search-label", children: "Ordenar" }),
|
|
1704
|
+
/* @__PURE__ */ jsx4(
|
|
1172
1705
|
"select",
|
|
1173
1706
|
{
|
|
1174
1707
|
id: "garagem-search-sort",
|
|
1175
1708
|
"data-slot": "search-sort-trigger",
|
|
1176
1709
|
value,
|
|
1177
1710
|
onChange: (event) => onChange(event.target.value || null),
|
|
1178
|
-
children: options.map((sort) => /* @__PURE__ */
|
|
1711
|
+
children: options.map((sort) => /* @__PURE__ */ jsx4("option", { value: sort.id, children: sort.label }, sort.id || "relevance"))
|
|
1179
1712
|
}
|
|
1180
1713
|
)
|
|
1181
1714
|
] });
|
|
@@ -1183,14 +1716,14 @@ function SearchSortSelect({
|
|
|
1183
1716
|
function ResultsSkeleton({
|
|
1184
1717
|
className
|
|
1185
1718
|
}) {
|
|
1186
|
-
return /* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1192
|
-
/* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1720
|
+
/* @__PURE__ */ jsx4(SearchChromeStyles, {}),
|
|
1721
|
+
/* @__PURE__ */ jsx4("div", { "data-slot": "search-skeleton", className, children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsxs4("div", { "data-slot": "search-skeleton-card", children: [
|
|
1722
|
+
/* @__PURE__ */ jsx4("div", { "data-slot": "search-skeleton-block", "data-kind": "media" }),
|
|
1723
|
+
/* @__PURE__ */ jsxs4("div", { "data-slot": "search-skeleton-body", children: [
|
|
1724
|
+
/* @__PURE__ */ jsx4("div", { "data-slot": "search-skeleton-block", "data-kind": "line-lg" }),
|
|
1725
|
+
/* @__PURE__ */ jsx4("div", { "data-slot": "search-skeleton-block", "data-kind": "line-md" }),
|
|
1726
|
+
/* @__PURE__ */ jsx4("div", { "data-slot": "search-skeleton-block", "data-kind": "line-sm" })
|
|
1194
1727
|
] })
|
|
1195
1728
|
] }, i)) })
|
|
1196
1729
|
] });
|
|
@@ -1199,12 +1732,12 @@ function SearchPageFallback({
|
|
|
1199
1732
|
className,
|
|
1200
1733
|
as: Root = "main"
|
|
1201
1734
|
}) {
|
|
1202
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ jsx4(Root, { "data-slot": "search-page", children: /* @__PURE__ */ jsx4(ResultsSkeleton, { className }) });
|
|
1203
1736
|
}
|
|
1204
1737
|
|
|
1205
1738
|
// src/react/search-pagination.tsx
|
|
1206
1739
|
import Link2 from "next/link";
|
|
1207
|
-
import { jsx as
|
|
1740
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1208
1741
|
function NavItem({
|
|
1209
1742
|
href,
|
|
1210
1743
|
label,
|
|
@@ -1213,13 +1746,13 @@ function NavItem({
|
|
|
1213
1746
|
onNavigate
|
|
1214
1747
|
}) {
|
|
1215
1748
|
if (disabled || !href || current) {
|
|
1216
|
-
return /* @__PURE__ */
|
|
1749
|
+
return /* @__PURE__ */ jsx5(
|
|
1217
1750
|
"li",
|
|
1218
1751
|
{
|
|
1219
1752
|
"data-slot": "search-pagination-item",
|
|
1220
1753
|
"data-current": current ? "true" : void 0,
|
|
1221
1754
|
"data-disabled": disabled ? "true" : void 0,
|
|
1222
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ jsx5("span", { children: label })
|
|
1223
1756
|
}
|
|
1224
1757
|
);
|
|
1225
1758
|
}
|
|
@@ -1231,7 +1764,7 @@ function NavItem({
|
|
|
1231
1764
|
event.preventDefault();
|
|
1232
1765
|
onNavigate(href);
|
|
1233
1766
|
}
|
|
1234
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ jsx5("li", { "data-slot": "search-pagination-item", children: /* @__PURE__ */ jsx5(Link2, { href, onClick: handleClick, "aria-label": label, children: label }) });
|
|
1235
1768
|
}
|
|
1236
1769
|
function SearchPagination({
|
|
1237
1770
|
page,
|
|
@@ -1242,14 +1775,14 @@ function SearchPagination({
|
|
|
1242
1775
|
}) {
|
|
1243
1776
|
if (totalPages <= 1) return null;
|
|
1244
1777
|
const pages = paginationPages(page, totalPages, 2);
|
|
1245
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ jsx5(
|
|
1246
1779
|
"nav",
|
|
1247
1780
|
{
|
|
1248
1781
|
"data-slot": "search-pagination",
|
|
1249
1782
|
className,
|
|
1250
1783
|
"aria-label": "Pagina\xE7\xE3o",
|
|
1251
|
-
children: /* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1784
|
+
children: /* @__PURE__ */ jsxs5("ul", { children: [
|
|
1785
|
+
/* @__PURE__ */ jsx5(
|
|
1253
1786
|
NavItem,
|
|
1254
1787
|
{
|
|
1255
1788
|
href: hrefWithExplicitPage(hrefForPage(1), 1),
|
|
@@ -1258,7 +1791,7 @@ function SearchPagination({
|
|
|
1258
1791
|
onNavigate
|
|
1259
1792
|
}
|
|
1260
1793
|
),
|
|
1261
|
-
/* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ jsx5(
|
|
1262
1795
|
NavItem,
|
|
1263
1796
|
{
|
|
1264
1797
|
href: hrefWithExplicitPage(
|
|
@@ -1270,7 +1803,7 @@ function SearchPagination({
|
|
|
1270
1803
|
onNavigate
|
|
1271
1804
|
}
|
|
1272
1805
|
),
|
|
1273
|
-
pages.map((n) => /* @__PURE__ */
|
|
1806
|
+
pages.map((n) => /* @__PURE__ */ jsx5(
|
|
1274
1807
|
NavItem,
|
|
1275
1808
|
{
|
|
1276
1809
|
href: hrefWithExplicitPage(hrefForPage(n), n),
|
|
@@ -1280,7 +1813,7 @@ function SearchPagination({
|
|
|
1280
1813
|
},
|
|
1281
1814
|
n
|
|
1282
1815
|
)),
|
|
1283
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ jsx5(
|
|
1284
1817
|
NavItem,
|
|
1285
1818
|
{
|
|
1286
1819
|
href: hrefForPage(Math.min(totalPages, page + 1)),
|
|
@@ -1289,7 +1822,7 @@ function SearchPagination({
|
|
|
1289
1822
|
onNavigate
|
|
1290
1823
|
}
|
|
1291
1824
|
),
|
|
1292
|
-
/* @__PURE__ */
|
|
1825
|
+
/* @__PURE__ */ jsx5(
|
|
1293
1826
|
NavItem,
|
|
1294
1827
|
{
|
|
1295
1828
|
href: hrefForPage(totalPages),
|
|
@@ -1304,9 +1837,9 @@ function SearchPagination({
|
|
|
1304
1837
|
}
|
|
1305
1838
|
|
|
1306
1839
|
// src/react/icons.tsx
|
|
1307
|
-
import { jsx as
|
|
1840
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1308
1841
|
function Icon({ children, ...props }) {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ jsx6(
|
|
1310
1843
|
"svg",
|
|
1311
1844
|
{
|
|
1312
1845
|
viewBox: "0 0 24 24",
|
|
@@ -1323,17 +1856,17 @@ function Icon({ children, ...props }) {
|
|
|
1323
1856
|
);
|
|
1324
1857
|
}
|
|
1325
1858
|
function SearchLensIcon(props) {
|
|
1326
|
-
return /* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1859
|
+
return /* @__PURE__ */ jsxs6(Icon, { ...props, children: [
|
|
1860
|
+
/* @__PURE__ */ jsx6("circle", { cx: "11", cy: "11", r: "7" }),
|
|
1861
|
+
/* @__PURE__ */ jsx6("path", { d: "M20 20l-3.5-3.5" })
|
|
1329
1862
|
] });
|
|
1330
1863
|
}
|
|
1331
1864
|
function SearchClearIcon(props) {
|
|
1332
|
-
return /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsx6(Icon, { ...props, children: /* @__PURE__ */ jsx6("path", { d: "M6 6l12 12M18 6L6 18" }) });
|
|
1333
1866
|
}
|
|
1334
1867
|
|
|
1335
1868
|
// src/react/search-query-form.tsx
|
|
1336
|
-
import { jsx as
|
|
1869
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1337
1870
|
function SearchQueryForm({
|
|
1338
1871
|
value,
|
|
1339
1872
|
onChange,
|
|
@@ -1348,7 +1881,7 @@ function SearchQueryForm({
|
|
|
1348
1881
|
event.preventDefault();
|
|
1349
1882
|
onSubmit();
|
|
1350
1883
|
}
|
|
1351
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ jsxs7(
|
|
1352
1885
|
"form",
|
|
1353
1886
|
{
|
|
1354
1887
|
role: "search",
|
|
@@ -1356,9 +1889,9 @@ function SearchQueryForm({
|
|
|
1356
1889
|
onSubmit: handleSubmit,
|
|
1357
1890
|
className,
|
|
1358
1891
|
children: [
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1892
|
+
/* @__PURE__ */ jsx7("label", { htmlFor: "garagem-search-q", "data-slot": "search-label", children: "Busca" }),
|
|
1893
|
+
/* @__PURE__ */ jsxs7("div", { "data-slot": "search-query-field", children: [
|
|
1894
|
+
/* @__PURE__ */ jsx7(
|
|
1362
1895
|
"input",
|
|
1363
1896
|
{
|
|
1364
1897
|
id: "garagem-search-q",
|
|
@@ -1373,8 +1906,8 @@ function SearchQueryForm({
|
|
|
1373
1906
|
"data-slot": "search-query-input"
|
|
1374
1907
|
}
|
|
1375
1908
|
),
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
value ? /* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsxs7("div", { "data-slot": "search-query-actions", children: [
|
|
1910
|
+
value ? /* @__PURE__ */ jsx7(
|
|
1378
1911
|
"button",
|
|
1379
1912
|
{
|
|
1380
1913
|
type: "button",
|
|
@@ -1383,17 +1916,17 @@ function SearchQueryForm({
|
|
|
1383
1916
|
onClick: onClear,
|
|
1384
1917
|
"data-slot": "search-icon-button",
|
|
1385
1918
|
"data-kind": "clear",
|
|
1386
|
-
children: clearIcon ?? /* @__PURE__ */
|
|
1919
|
+
children: clearIcon ?? /* @__PURE__ */ jsx7(SearchClearIcon, { className: iconClassName })
|
|
1387
1920
|
}
|
|
1388
1921
|
) : null,
|
|
1389
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ jsx7(
|
|
1390
1923
|
"button",
|
|
1391
1924
|
{
|
|
1392
1925
|
type: "submit",
|
|
1393
1926
|
title: "Buscar",
|
|
1394
1927
|
"aria-label": "Buscar",
|
|
1395
1928
|
"data-slot": "search-icon-button",
|
|
1396
|
-
children: searchIcon ?? /* @__PURE__ */
|
|
1929
|
+
children: searchIcon ?? /* @__PURE__ */ jsx7(SearchLensIcon, { className: iconClassName })
|
|
1397
1930
|
}
|
|
1398
1931
|
)
|
|
1399
1932
|
] })
|
|
@@ -1733,7 +2266,8 @@ function usePublicSearch(options) {
|
|
|
1733
2266
|
}
|
|
1734
2267
|
|
|
1735
2268
|
// src/react/search-page.tsx
|
|
1736
|
-
import { Fragment as Fragment3, jsx as
|
|
2269
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2270
|
+
var SEARCH_EMPTY_COPY = "Nenhum im\xF3vel encontrado. Ajuste a busca ou os filtros.";
|
|
1737
2271
|
function ToolbarPopover({
|
|
1738
2272
|
id,
|
|
1739
2273
|
label,
|
|
@@ -1761,8 +2295,8 @@ function ToolbarPopover({
|
|
|
1761
2295
|
document.removeEventListener("keydown", onKey);
|
|
1762
2296
|
};
|
|
1763
2297
|
}, [open, onOpenChange]);
|
|
1764
|
-
return /* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */
|
|
2298
|
+
return /* @__PURE__ */ jsxs8("div", { "data-slot": "search-toolbar-item", ref: rootRef, children: [
|
|
2299
|
+
/* @__PURE__ */ jsx8(
|
|
1766
2300
|
"button",
|
|
1767
2301
|
{
|
|
1768
2302
|
type: "button",
|
|
@@ -1773,7 +2307,7 @@ function ToolbarPopover({
|
|
|
1773
2307
|
children: label
|
|
1774
2308
|
}
|
|
1775
2309
|
),
|
|
1776
|
-
open ? /* @__PURE__ */
|
|
2310
|
+
open ? /* @__PURE__ */ jsx8(
|
|
1777
2311
|
"div",
|
|
1778
2312
|
{
|
|
1779
2313
|
"data-slot": "search-popover",
|
|
@@ -1788,7 +2322,7 @@ function FiltersTrigger({
|
|
|
1788
2322
|
onClick,
|
|
1789
2323
|
className
|
|
1790
2324
|
}) {
|
|
1791
|
-
return /* @__PURE__ */
|
|
2325
|
+
return /* @__PURE__ */ jsx8(
|
|
1792
2326
|
"button",
|
|
1793
2327
|
{
|
|
1794
2328
|
type: "button",
|
|
@@ -1805,9 +2339,9 @@ function ApplyBar({
|
|
|
1805
2339
|
onApply,
|
|
1806
2340
|
className
|
|
1807
2341
|
}) {
|
|
1808
|
-
return /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ jsxs8("div", { "data-slot": "search-apply-bar", className, children: [
|
|
2343
|
+
/* @__PURE__ */ jsx8("button", { type: "button", "data-kind": "clear", onClick: onClear, children: "Limpar" }),
|
|
2344
|
+
/* @__PURE__ */ jsx8("button", { type: "button", "data-kind": "apply", onClick: onApply, children: "Ver resultados" })
|
|
1811
2345
|
] });
|
|
1812
2346
|
}
|
|
1813
2347
|
function FilterSheet({
|
|
@@ -1835,8 +2369,8 @@ function FilterSheet({
|
|
|
1835
2369
|
};
|
|
1836
2370
|
}, [open]);
|
|
1837
2371
|
if (!open) return null;
|
|
1838
|
-
return /* @__PURE__ */
|
|
1839
|
-
/* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsxs8("div", { "data-slot": "search-sheet", children: [
|
|
2373
|
+
/* @__PURE__ */ jsx8(
|
|
1840
2374
|
"button",
|
|
1841
2375
|
{
|
|
1842
2376
|
type: "button",
|
|
@@ -1846,7 +2380,7 @@ function FilterSheet({
|
|
|
1846
2380
|
onClick: onClose
|
|
1847
2381
|
}
|
|
1848
2382
|
),
|
|
1849
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsxs8(
|
|
1850
2384
|
"div",
|
|
1851
2385
|
{
|
|
1852
2386
|
"data-slot": "search-sheet-panel",
|
|
@@ -1855,9 +2389,9 @@ function FilterSheet({
|
|
|
1855
2389
|
"aria-modal": "true",
|
|
1856
2390
|
"aria-label": title,
|
|
1857
2391
|
children: [
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
1860
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx8("p", { "data-slot": "search-sheet-title", children: title }),
|
|
2393
|
+
/* @__PURE__ */ jsx8("div", { "data-slot": "search-sheet-body", children }),
|
|
2394
|
+
/* @__PURE__ */ jsx8("div", { "data-slot": "search-sheet-footer", children: footer })
|
|
1861
2395
|
]
|
|
1862
2396
|
}
|
|
1863
2397
|
)
|
|
@@ -1869,8 +2403,8 @@ function SearchHeading({
|
|
|
1869
2403
|
classNames,
|
|
1870
2404
|
loading
|
|
1871
2405
|
}) {
|
|
1872
|
-
return /* @__PURE__ */
|
|
1873
|
-
!loading ? /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ jsxs8("div", { "data-slot": "search-heading", className: classNames?.heading, children: [
|
|
2407
|
+
!loading ? /* @__PURE__ */ jsx8(
|
|
1874
2408
|
"span",
|
|
1875
2409
|
{
|
|
1876
2410
|
"data-slot": "search-heading-count",
|
|
@@ -1878,7 +2412,7 @@ function SearchHeading({
|
|
|
1878
2412
|
children: total.toLocaleString("pt-BR")
|
|
1879
2413
|
}
|
|
1880
2414
|
) : null,
|
|
1881
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ jsx8("h1", { "data-slot": "search-heading-title", className: classNames?.headingTitle, children: title })
|
|
1882
2416
|
] });
|
|
1883
2417
|
}
|
|
1884
2418
|
function SearchPage({
|
|
@@ -1953,8 +2487,8 @@ function SearchPage({
|
|
|
1953
2487
|
search.applyStaged();
|
|
1954
2488
|
closeSheet();
|
|
1955
2489
|
}
|
|
1956
|
-
const results = search.loading ? /* @__PURE__ */
|
|
1957
|
-
/* @__PURE__ */
|
|
2490
|
+
const results = search.loading ? /* @__PURE__ */ jsx8(ResultsSkeleton, { className: classNames?.skeleton ?? classNames?.grid }) : search.listings.length === 0 ? /* @__PURE__ */ jsx8("p", { "data-slot": "search-empty", className: classNames?.empty, children: SEARCH_EMPTY_COPY }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
2491
|
+
/* @__PURE__ */ jsx8("div", { "data-slot": "search-grid", className: classNames?.grid, children: search.listings.map((listing) => /* @__PURE__ */ jsx8(
|
|
1958
2492
|
Card,
|
|
1959
2493
|
{
|
|
1960
2494
|
listing,
|
|
@@ -1962,7 +2496,7 @@ function SearchPage({
|
|
|
1962
2496
|
},
|
|
1963
2497
|
listing.id
|
|
1964
2498
|
)) }),
|
|
1965
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx8(
|
|
1966
2500
|
SearchPagination,
|
|
1967
2501
|
{
|
|
1968
2502
|
page: search.page,
|
|
@@ -1973,8 +2507,8 @@ function SearchPage({
|
|
|
1973
2507
|
}
|
|
1974
2508
|
)
|
|
1975
2509
|
] });
|
|
1976
|
-
const queryAndSort = /* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
2510
|
+
const queryAndSort = /* @__PURE__ */ jsxs8("div", { "data-slot": "search-query-sort", children: [
|
|
2511
|
+
/* @__PURE__ */ jsx8(
|
|
1978
2512
|
SearchQueryForm,
|
|
1979
2513
|
{
|
|
1980
2514
|
value: search.qDraft,
|
|
@@ -1987,7 +2521,7 @@ function SearchPage({
|
|
|
1987
2521
|
clearIcon: icons?.clear
|
|
1988
2522
|
}
|
|
1989
2523
|
),
|
|
1990
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ jsx8(
|
|
1991
2525
|
SearchSortSelect,
|
|
1992
2526
|
{
|
|
1993
2527
|
value: search.applied.sort || "",
|
|
@@ -1997,7 +2531,7 @@ function SearchPage({
|
|
|
1997
2531
|
}
|
|
1998
2532
|
)
|
|
1999
2533
|
] });
|
|
2000
|
-
const header = heading ?? /* @__PURE__ */
|
|
2534
|
+
const header = heading ?? /* @__PURE__ */ jsx8(
|
|
2001
2535
|
SearchHeading,
|
|
2002
2536
|
{
|
|
2003
2537
|
total: search.total,
|
|
@@ -2006,7 +2540,7 @@ function SearchPage({
|
|
|
2006
2540
|
loading: search.loading
|
|
2007
2541
|
}
|
|
2008
2542
|
);
|
|
2009
|
-
const stagedPanel = (items) => /* @__PURE__ */
|
|
2543
|
+
const stagedPanel = (items) => /* @__PURE__ */ jsx8(
|
|
2010
2544
|
FilterPanel,
|
|
2011
2545
|
{
|
|
2012
2546
|
filters: items,
|
|
@@ -2017,7 +2551,7 @@ function SearchPage({
|
|
|
2017
2551
|
onRangeCommit: (id) => commitRange(id, false)
|
|
2018
2552
|
}
|
|
2019
2553
|
);
|
|
2020
|
-
const sheet = /* @__PURE__ */
|
|
2554
|
+
const sheet = /* @__PURE__ */ jsx8(
|
|
2021
2555
|
FilterSheet,
|
|
2022
2556
|
{
|
|
2023
2557
|
open: sheetOpen,
|
|
@@ -2025,7 +2559,7 @@ function SearchPage({
|
|
|
2025
2559
|
onClose: closeSheet,
|
|
2026
2560
|
overlayClassName: classNames?.dialogOverlay,
|
|
2027
2561
|
panelClassName: cn(classNames?.dialog, classNames?.dialogPanel),
|
|
2028
|
-
footer: /* @__PURE__ */
|
|
2562
|
+
footer: /* @__PURE__ */ jsx8(
|
|
2029
2563
|
ApplyBar,
|
|
2030
2564
|
{
|
|
2031
2565
|
onClear: clearStagedFilters,
|
|
@@ -2036,19 +2570,19 @@ function SearchPage({
|
|
|
2036
2570
|
children: stagedPanel(variant === "toolbar" ? extraFilters : filters)
|
|
2037
2571
|
}
|
|
2038
2572
|
);
|
|
2039
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ jsxs8(
|
|
2040
2574
|
Root,
|
|
2041
2575
|
{
|
|
2042
2576
|
"data-slot": "search-page",
|
|
2043
2577
|
"data-variant": variant,
|
|
2044
2578
|
className: cn(className, classNames?.root),
|
|
2045
2579
|
children: [
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx8(SearchChromeStyles, {}),
|
|
2581
|
+
/* @__PURE__ */ jsx8("div", { className: classNames?.header, children: header }),
|
|
2582
|
+
/* @__PURE__ */ jsxs8("div", { "data-slot": "search-body", children: [
|
|
2049
2583
|
queryAndSort,
|
|
2050
|
-
variant === "toolbar" ? /* @__PURE__ */
|
|
2051
|
-
toolbarFilters.map((filter) => /* @__PURE__ */
|
|
2584
|
+
variant === "toolbar" ? /* @__PURE__ */ jsxs8("div", { "data-slot": "search-toolbar", className: classNames?.toolbar, children: [
|
|
2585
|
+
toolbarFilters.map((filter) => /* @__PURE__ */ jsx8(
|
|
2052
2586
|
ToolbarPopover,
|
|
2053
2587
|
{
|
|
2054
2588
|
id: filter.id,
|
|
@@ -2057,7 +2591,7 @@ function SearchPage({
|
|
|
2057
2591
|
onOpenChange: setOpenToolbar,
|
|
2058
2592
|
triggerClassName: classNames?.toolbarTrigger,
|
|
2059
2593
|
popoverClassName: classNames?.popover,
|
|
2060
|
-
children: /* @__PURE__ */
|
|
2594
|
+
children: /* @__PURE__ */ jsx8(
|
|
2061
2595
|
FilterPanel,
|
|
2062
2596
|
{
|
|
2063
2597
|
filters: [filter],
|
|
@@ -2077,13 +2611,13 @@ function SearchPage({
|
|
|
2077
2611
|
},
|
|
2078
2612
|
filter.id
|
|
2079
2613
|
)),
|
|
2080
|
-
extraFilters.length > 0 ? /* @__PURE__ */
|
|
2614
|
+
extraFilters.length > 0 ? /* @__PURE__ */ jsx8(FiltersTrigger, { onClick: openStagedFilters }) : null
|
|
2081
2615
|
] }) : null,
|
|
2082
|
-
variant === "dialog" ? /* @__PURE__ */
|
|
2083
|
-
variant === "sidebar" ? /* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2616
|
+
variant === "dialog" ? /* @__PURE__ */ jsx8(FiltersTrigger, { onClick: openStagedFilters }) : null,
|
|
2617
|
+
variant === "sidebar" ? /* @__PURE__ */ jsxs8("div", { "data-slot": "search-layout", children: [
|
|
2618
|
+
/* @__PURE__ */ jsxs8("aside", { "data-slot": "search-sidebar", className: classNames?.sidebar, children: [
|
|
2085
2619
|
stagedPanel(filters),
|
|
2086
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ jsx8(
|
|
2087
2621
|
ApplyBar,
|
|
2088
2622
|
{
|
|
2089
2623
|
onClear: clearStagedFilters,
|
|
@@ -2092,8 +2626,8 @@ function SearchPage({
|
|
|
2092
2626
|
}
|
|
2093
2627
|
)
|
|
2094
2628
|
] }),
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
2630
|
+
/* @__PURE__ */ jsx8(FiltersTrigger, { onClick: openStagedFilters }),
|
|
2097
2631
|
results
|
|
2098
2632
|
] })
|
|
2099
2633
|
] }) : results
|
|
@@ -2106,6 +2640,7 @@ function SearchPage({
|
|
|
2106
2640
|
export {
|
|
2107
2641
|
FilterPanel,
|
|
2108
2642
|
ListingCard,
|
|
2643
|
+
ListingDetailFields,
|
|
2109
2644
|
ResultsSkeleton,
|
|
2110
2645
|
SearchChromeStyles,
|
|
2111
2646
|
SearchPage,
|