@garagem-ai/site-sdk 0.4.11 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -25
- package/dist/index.d.mts +9 -129
- package/dist/index.d.ts +9 -129
- package/dist/index.js +44 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -15
- 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 -5
- 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 +9 -10
package/dist/react.js
CHANGED
|
@@ -33,6 +33,7 @@ var react_exports = {};
|
|
|
33
33
|
__export(react_exports, {
|
|
34
34
|
FilterPanel: () => FilterPanel,
|
|
35
35
|
ListingCard: () => ListingCard,
|
|
36
|
+
ListingDetailFields: () => ListingDetailFields,
|
|
36
37
|
ResultsSkeleton: () => ResultsSkeleton,
|
|
37
38
|
SearchChromeStyles: () => SearchChromeStyles,
|
|
38
39
|
SearchPage: () => SearchPage,
|
|
@@ -154,7 +155,7 @@ function cn(...parts) {
|
|
|
154
155
|
var import_react = require("react");
|
|
155
156
|
|
|
156
157
|
// src/react/styles/search-chrome-css.generated.ts
|
|
157
|
-
var SEARCH_CHROME_CSS_VERSION = "0.4.
|
|
158
|
+
var SEARCH_CHROME_CSS_VERSION = "0.4.13";
|
|
158
159
|
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}}`;
|
|
159
160
|
|
|
160
161
|
// src/react/styles/search-chrome-styles.tsx
|
|
@@ -257,8 +258,341 @@ function ListingCard({
|
|
|
257
258
|
] });
|
|
258
259
|
}
|
|
259
260
|
|
|
260
|
-
// src/
|
|
261
|
-
var
|
|
261
|
+
// src/amenity-labels.ts
|
|
262
|
+
var LISTING_AMENITY_TITLES = {
|
|
263
|
+
unit: "Comodidades",
|
|
264
|
+
building: "Comodidades do condom\xEDnio"
|
|
265
|
+
};
|
|
266
|
+
var AMENITY_FALLBACK_LABELS = {
|
|
267
|
+
// ==================== PROPERTY FEATURES ====================
|
|
268
|
+
// Amenities
|
|
269
|
+
arCondicionado: "Ar condicionado",
|
|
270
|
+
banheira: "Banheira",
|
|
271
|
+
carregadorEletrico: "Carregador el\xE9trico",
|
|
272
|
+
churrasqueira: "Churrasqueira",
|
|
273
|
+
chuveiroGas: "Chuveiro a g\xE1s",
|
|
274
|
+
chuveiroEletrico: "Chuveiro el\xE9trico",
|
|
275
|
+
energiaSolar: "Energia solar",
|
|
276
|
+
fechaduraDigital: "Fechadura digital",
|
|
277
|
+
fechaduraEletronica: "Fechadura eletr\xF4nica",
|
|
278
|
+
geradorEletrico: "Gerador el\xE9trico",
|
|
279
|
+
gesso: "Gesso",
|
|
280
|
+
hidromassagem: "Hidromassagem",
|
|
281
|
+
lareira: "Lareira",
|
|
282
|
+
ofuro: "Ofur\xF4",
|
|
283
|
+
spa: "Spa",
|
|
284
|
+
painelSolar: "Painel solar",
|
|
285
|
+
portaoEletronico: "Port\xE3o eletr\xF4nico",
|
|
286
|
+
sistemaAlarme: "Sistema de alarme",
|
|
287
|
+
homeTheater: "Home theater",
|
|
288
|
+
adega: "Adega",
|
|
289
|
+
split: "Split",
|
|
290
|
+
arCentral: "Ar central",
|
|
291
|
+
esperaSplit: "Espera para split",
|
|
292
|
+
vistaMar: "Vista para o mar",
|
|
293
|
+
vistaPanoramica: "Vista panor\xE2mica",
|
|
294
|
+
aguaQuente: "\xC1gua quente",
|
|
295
|
+
reformado: "Reformado",
|
|
296
|
+
tvCabo: "TV a cabo",
|
|
297
|
+
gradeado: "Gradeado",
|
|
298
|
+
antenaParabolica: "Antena parab\xF3lica",
|
|
299
|
+
aquecimento: "Aquecimento",
|
|
300
|
+
aquecimentoEletrico: "Aquecimento el\xE9trico",
|
|
301
|
+
aquecimentoCentral: "Aquecimento central",
|
|
302
|
+
cercaEletrica: "Cerca el\xE9trica",
|
|
303
|
+
monitoramento: "Monitoramento",
|
|
304
|
+
vigiaInterno: "Vigia interno",
|
|
305
|
+
vigiaExterno: "Vigia externo",
|
|
306
|
+
alarme: "Alarme",
|
|
307
|
+
agua: "\xC1gua",
|
|
308
|
+
redeEsgoto: "Rede de esgoto",
|
|
309
|
+
pavimentacao: "Pavimenta\xE7\xE3o",
|
|
310
|
+
energiaEletrica: "Energia el\xE9trica",
|
|
311
|
+
// Furniture
|
|
312
|
+
mobiliado: "Mobiliado",
|
|
313
|
+
armarioEmbutido: "Arm\xE1rio embutido",
|
|
314
|
+
armarioEmbutidoQuarto: "Arm\xE1rio embutido quarto",
|
|
315
|
+
armarioCozinha: "Arm\xE1rio cozinha",
|
|
316
|
+
armarioBanheiro: "Arm\xE1rio banheiro",
|
|
317
|
+
cozinhaPlanejada: "Cozinha planejada",
|
|
318
|
+
fogao: "Fog\xE3o",
|
|
319
|
+
fornoPizza: "Forno de pizza",
|
|
320
|
+
freezer: "Freezer",
|
|
321
|
+
dormitorioComArmario: "Dormit\xF3rio com arm\xE1rio",
|
|
322
|
+
semiMobiliado: "Semi mobiliado",
|
|
323
|
+
salaArmarios: "Sala com arm\xE1rios",
|
|
324
|
+
// Structure
|
|
325
|
+
piscina: "Piscina",
|
|
326
|
+
piscinaAquecida: "Piscina aquecida",
|
|
327
|
+
piscinaCoberta: "Piscina coberta",
|
|
328
|
+
poco: "Po\xE7o",
|
|
329
|
+
pocoArtesiano: "Po\xE7o artesiano",
|
|
330
|
+
bar: "Bar",
|
|
331
|
+
jardim: "Jardim",
|
|
332
|
+
lago: "Lago",
|
|
333
|
+
lavabo: "Lavabo",
|
|
334
|
+
quintal: "Quintal",
|
|
335
|
+
solarium: "Solarium",
|
|
336
|
+
quartoServico: "Quarto de servi\xE7o",
|
|
337
|
+
varanda: "Varanda",
|
|
338
|
+
varandaFechadaVidro: "Varanda fechada com vidro",
|
|
339
|
+
varandaGourmet: "Varanda gourmet",
|
|
340
|
+
banheiroServico: "Banheiro de servi\xE7o",
|
|
341
|
+
areaServico: "\xC1rea de servi\xE7o",
|
|
342
|
+
cinema: "Cinema",
|
|
343
|
+
closet: "Closet",
|
|
344
|
+
cozinhaAmericana: "Cozinha americana",
|
|
345
|
+
cozinhaGourmet: "Cozinha gourmet",
|
|
346
|
+
despensa: "Despensa",
|
|
347
|
+
escritorio: "Escrit\xF3rio",
|
|
348
|
+
edicula: "Ed\xEDcula",
|
|
349
|
+
horta: "Horta",
|
|
350
|
+
sacada: "Sacada",
|
|
351
|
+
salaJantar: "Sala de jantar",
|
|
352
|
+
cozinha: "Cozinha",
|
|
353
|
+
banheiroSocial: "Banheiro social",
|
|
354
|
+
terraco: "Terra\xE7o",
|
|
355
|
+
copa: "Copa",
|
|
356
|
+
suiteMaster: "Su\xEDte master",
|
|
357
|
+
wcEmpregada: "WC empregada",
|
|
358
|
+
dependenciaEmpregada: "Depend\xEAncia de empregada",
|
|
359
|
+
dependenciadeEmpregada: "Depend\xEAncia empregada",
|
|
360
|
+
salaTv: "Sala de TV",
|
|
361
|
+
copaCozinha: "Copa cozinha",
|
|
362
|
+
sacadaComChurrasqueira: "Sacada com churrasqueira",
|
|
363
|
+
hallPrivativo: "Hall privativo",
|
|
364
|
+
estarIntimo: "Estar \xEDntimo",
|
|
365
|
+
livingHall: "Living hall",
|
|
366
|
+
piscinaInterna: "Piscina interna",
|
|
367
|
+
deck: "Deck",
|
|
368
|
+
jardimInverno: "Jardim de inverno",
|
|
369
|
+
rouparia: "Rouparia",
|
|
370
|
+
living: "Living",
|
|
371
|
+
familyRoom: "Family room",
|
|
372
|
+
salafitness: "Sala fitness",
|
|
373
|
+
salaEstar: "Sala de estar",
|
|
374
|
+
mezanino: "Mezanino",
|
|
375
|
+
pisoElevado: "Piso elevado",
|
|
376
|
+
entradaServicoIndependente: "Entrada de servi\xE7o independente",
|
|
377
|
+
forro: "Forro",
|
|
378
|
+
vitrine: "Vitrine",
|
|
379
|
+
banheiroAuxiliar: "Banheiro auxiliar",
|
|
380
|
+
gabinete: "Gabinete",
|
|
381
|
+
quadraTenisPrivativa: "Quadra de t\xEAnis privativa",
|
|
382
|
+
porao: "Por\xE3o",
|
|
383
|
+
sotao: "S\xF3t\xE3o",
|
|
384
|
+
patio: "P\xE1tio",
|
|
385
|
+
canaletasNoRodape: "Canaletas no rodap\xE9",
|
|
386
|
+
// Accessibility
|
|
387
|
+
barraApoioVaso: "Barra de apoio vaso",
|
|
388
|
+
barraApoioChuveiro: "Barra de apoio chuveiro",
|
|
389
|
+
entradaSemDegrau: "Entrada sem degrau",
|
|
390
|
+
rampasAcesso: "Rampas de acesso",
|
|
391
|
+
vagaDeficientes: "Vaga para deficientes",
|
|
392
|
+
// Flooring
|
|
393
|
+
cimentoQueimado: "Cimento queimado",
|
|
394
|
+
madeira: "Madeira",
|
|
395
|
+
pisoFrio: "Piso frio",
|
|
396
|
+
laminado: "Laminado",
|
|
397
|
+
vinilico: "Vin\xEDlico",
|
|
398
|
+
porcelanato: "Porcelanato",
|
|
399
|
+
// ==================== BUILDING FEATURES ====================
|
|
400
|
+
// Amenities
|
|
401
|
+
elevador: "Elevador",
|
|
402
|
+
bicicletario: "Biciclet\xE1rio",
|
|
403
|
+
carregadorEletronico: "Carregador eletr\xF4nico",
|
|
404
|
+
concierge: "Concierge",
|
|
405
|
+
coworking: "Coworking",
|
|
406
|
+
deposito: "Dep\xF3sito",
|
|
407
|
+
lavanderia: "Lavanderia",
|
|
408
|
+
petPlace: "Pet place",
|
|
409
|
+
recebimentoEncomendas: "Recebimento de encomendas",
|
|
410
|
+
salaReuniao: "Sala de reuni\xE3o",
|
|
411
|
+
salaoFestas: "Sal\xE3o de festas",
|
|
412
|
+
valet: "Valet",
|
|
413
|
+
garagemCoberta: "Garagem coberta",
|
|
414
|
+
elevadorServico: "Elevador de servi\xE7o",
|
|
415
|
+
// Leisure
|
|
416
|
+
academia: "Academia",
|
|
417
|
+
campoFutebol: "Campo de futebol",
|
|
418
|
+
espacoGourmet: "Espa\xE7o gourmet",
|
|
419
|
+
piscinaInfantil: "Piscina infantil",
|
|
420
|
+
pistaCaminhada: "Pista de caminhada",
|
|
421
|
+
playground: "Playground",
|
|
422
|
+
quadraPoliesportiva: "Quadra poliesportiva",
|
|
423
|
+
quadraTenis: "Quadra de t\xEAnis",
|
|
424
|
+
salaJogos: "Sala de jogos",
|
|
425
|
+
salaVapor: "Sala de vapor",
|
|
426
|
+
sauna: "Sauna",
|
|
427
|
+
// Security
|
|
428
|
+
circuitoTv: "Circuito fechado de TV",
|
|
429
|
+
controleAcessoEletronico: "Controle de acesso eletr\xF4nico",
|
|
430
|
+
interfone: "Interfone",
|
|
431
|
+
portaria24h: "Portaria 24h",
|
|
432
|
+
porteiroFisico: "Porteiro f\xEDsico",
|
|
433
|
+
seguranca24h: "Seguran\xE7a 24h",
|
|
434
|
+
segurancaPatrimonial: "Seguran\xE7a patrimonial",
|
|
435
|
+
condominioFechado: "Condom\xEDnio fechado",
|
|
436
|
+
// Accessibility
|
|
437
|
+
banheiroAcessivel: "Banheiro acess\xEDvel",
|
|
438
|
+
elevadorAcessivel: "Elevador acess\xEDvel",
|
|
439
|
+
pisoTatil: "Piso t\xE1til",
|
|
440
|
+
// ==================== CANONICAL HAS*/IS* KEYS ====================
|
|
441
|
+
has24hConcierge: "Portaria 24h",
|
|
442
|
+
has24hSecurity: "Seguran\xE7a 24h",
|
|
443
|
+
hasAccessRamps: "Rampas de acesso",
|
|
444
|
+
hasAccessibleBathroom: "Banheiro acess\xEDvel",
|
|
445
|
+
hasAccessibleElevator: "Elevador acess\xEDvel",
|
|
446
|
+
hasAirConditioning: "Ar condicionado",
|
|
447
|
+
hasAlarmSystem: "Sistema de alarme",
|
|
448
|
+
hasBalcony: "Varanda",
|
|
449
|
+
hasBikeStorage: "Biciclet\xE1rio",
|
|
450
|
+
hasBuiltInWardrobe: "Arm\xE1rio embutido",
|
|
451
|
+
hasCCTV: "CFTV",
|
|
452
|
+
hasCloset: "Closet",
|
|
453
|
+
hasConcierge: "Portaria",
|
|
454
|
+
hasControlledAccess: "Condom\xEDnio fechado",
|
|
455
|
+
hasCoworking: "Coworking",
|
|
456
|
+
hasDisabledParking: "Vaga para deficientes",
|
|
457
|
+
hasElectricCharger: "Carregador eletr\xF4nico",
|
|
458
|
+
hasElectronicGate: "Port\xE3o eletr\xF4nico",
|
|
459
|
+
hasElevator: "Elevador",
|
|
460
|
+
hasFireplace: "Lareira",
|
|
461
|
+
hasGarden: "Jardim",
|
|
462
|
+
hasGasShower: "Chuveiro a g\xE1s",
|
|
463
|
+
hasGenerator: "Gerador",
|
|
464
|
+
hasGourmetBalcony: "Varanda gourmet",
|
|
465
|
+
hasGourmetKitchen: "Cozinha gourmet",
|
|
466
|
+
hasGrill: "Churrasqueira",
|
|
467
|
+
hasGuestParking: "Estacionamento para visitantes",
|
|
468
|
+
hasGym: "Academia",
|
|
469
|
+
hasHeating: "Aquecimento",
|
|
470
|
+
hasHomeOffice: "Home office",
|
|
471
|
+
hasIntercom: "Interfone",
|
|
472
|
+
hasJacuzzi: "Hidromassagem",
|
|
473
|
+
hasKidsPool: "Piscina infantil",
|
|
474
|
+
hasLaundry: "Lavanderia",
|
|
475
|
+
hasMeetingRoom: "Sala de reuni\xE3o",
|
|
476
|
+
hasOffice: "Escrit\xF3rio",
|
|
477
|
+
hasOpenKitchen: "Cozinha americana",
|
|
478
|
+
hasPackageReceival: "Recebimento de encomendas",
|
|
479
|
+
hasPantry: "Despensa",
|
|
480
|
+
hasParkingGarage: "Garagem coberta",
|
|
481
|
+
hasPartySaloon: "Sal\xE3o de festas",
|
|
482
|
+
hasPetArea: "Pet place",
|
|
483
|
+
hasPipedGas: "G\xE1s encanado",
|
|
484
|
+
hasPlayground: "Playground",
|
|
485
|
+
hasPowderRoom: "Lavabo",
|
|
486
|
+
hasPrivatePool: "Piscina privativa",
|
|
487
|
+
hasSauna: "Sauna",
|
|
488
|
+
hasSecurity: "Seguran\xE7a",
|
|
489
|
+
hasServiceArea: "\xC1rea de servi\xE7o",
|
|
490
|
+
hasSolarPanel: "Painel solar",
|
|
491
|
+
hasSpa: "Spa",
|
|
492
|
+
hasSportsCourt: "Quadra de esportes",
|
|
493
|
+
hasStepFreeEntrance: "Entrada sem degrau",
|
|
494
|
+
hasStorage: "Dep\xF3sito",
|
|
495
|
+
hasSwimmingPool: "Piscina",
|
|
496
|
+
hasTennisCourt: "Quadra de t\xEAnis",
|
|
497
|
+
hasValetParking: "Valet",
|
|
498
|
+
homeOffice: "Home office",
|
|
499
|
+
isPetFriendly: "Pet friendly",
|
|
500
|
+
isFurnished: "Mobiliado",
|
|
501
|
+
isPartiallyFurnished: "Semi-mobiliado",
|
|
502
|
+
petFriendly: "Pet friendly",
|
|
503
|
+
piscinaPrivativa: "Piscina privativa",
|
|
504
|
+
pisoLaminado: "Piso laminado",
|
|
505
|
+
pisoMadeira: "Piso de madeira",
|
|
506
|
+
pisoPorcelanato: "Piso porcelanato",
|
|
507
|
+
quadraEsportes: "Quadra de esportes",
|
|
508
|
+
rooftop: "Rooftop",
|
|
509
|
+
suite: "Su\xEDte",
|
|
510
|
+
triplex: "Triplex",
|
|
511
|
+
duplex: "Duplex",
|
|
512
|
+
cobertura: "Cobertura",
|
|
513
|
+
forroGesso: "Forro de gesso",
|
|
514
|
+
gerador: "Gerador",
|
|
515
|
+
armariosCozinha: "Arm\xE1rios na cozinha",
|
|
516
|
+
armariosQuarto: "Arm\xE1rios nos quartos",
|
|
517
|
+
cftv: "CFTV"
|
|
518
|
+
};
|
|
519
|
+
function lookupLabel(id, options) {
|
|
520
|
+
const fromDictionary = options?.find((option) => option.id === id)?.label;
|
|
521
|
+
if (fromDictionary?.trim()) return fromDictionary.trim();
|
|
522
|
+
return AMENITY_FALLBACK_LABELS[id];
|
|
523
|
+
}
|
|
524
|
+
function labelAmenities(ids, dictionary) {
|
|
525
|
+
if (!ids?.length) return [];
|
|
526
|
+
const labels = [];
|
|
527
|
+
const seen = /* @__PURE__ */ new Set();
|
|
528
|
+
for (const id of ids) {
|
|
529
|
+
if (!id) continue;
|
|
530
|
+
const label = lookupLabel(id, dictionary);
|
|
531
|
+
if (!label || seen.has(label)) continue;
|
|
532
|
+
seen.add(label);
|
|
533
|
+
labels.push(label);
|
|
534
|
+
}
|
|
535
|
+
return labels.sort((a, b) => a.localeCompare(b, "pt-BR"));
|
|
536
|
+
}
|
|
537
|
+
function presentIds(ids) {
|
|
538
|
+
return (ids ?? []).filter((id) => Boolean(id));
|
|
539
|
+
}
|
|
540
|
+
function buildingIdsFromMergedAmenities(listing, unitIds) {
|
|
541
|
+
if (!listing.amenities || listing.propertyFeatures == null) return [];
|
|
542
|
+
const unitCounts = /* @__PURE__ */ new Map();
|
|
543
|
+
for (const id of unitIds) {
|
|
544
|
+
unitCounts.set(id, (unitCounts.get(id) ?? 0) + 1);
|
|
545
|
+
}
|
|
546
|
+
return listing.amenities.filter((id) => {
|
|
547
|
+
if (!id) return false;
|
|
548
|
+
const count = unitCounts.get(id);
|
|
549
|
+
if (count === void 0 || count === 0) return true;
|
|
550
|
+
unitCounts.set(id, count - 1);
|
|
551
|
+
return false;
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function unitAmenityIds(listing) {
|
|
555
|
+
if (listing.propertyFeatures != null) {
|
|
556
|
+
return presentIds(listing.propertyFeatures);
|
|
557
|
+
}
|
|
558
|
+
const building = new Set(
|
|
559
|
+
listing.building?.amenities ?? listing.buildingAmenities ?? []
|
|
560
|
+
);
|
|
561
|
+
return (listing.amenities ?? []).filter((id) => id && !building.has(id));
|
|
562
|
+
}
|
|
563
|
+
function buildingAmenityIds(listing) {
|
|
564
|
+
if (listing.building != null && listing.building.amenities != null) {
|
|
565
|
+
return presentIds(listing.building.amenities);
|
|
566
|
+
}
|
|
567
|
+
if (listing.buildingAmenities != null) {
|
|
568
|
+
return presentIds(listing.buildingAmenities);
|
|
569
|
+
}
|
|
570
|
+
return buildingIdsFromMergedAmenities(listing, unitAmenityIds(listing));
|
|
571
|
+
}
|
|
572
|
+
function listingAmenityGroups(listing, dictionary) {
|
|
573
|
+
const groups = [];
|
|
574
|
+
const unitIds = unitAmenityIds(listing);
|
|
575
|
+
const unitLabels = labelAmenities(unitIds, dictionary?.propertyFeatures);
|
|
576
|
+
if (unitLabels.length > 0) {
|
|
577
|
+
groups.push({
|
|
578
|
+
key: "unit",
|
|
579
|
+
title: LISTING_AMENITY_TITLES.unit,
|
|
580
|
+
labels: unitLabels
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
const buildingLabels = labelAmenities(
|
|
584
|
+
buildingAmenityIds(listing),
|
|
585
|
+
dictionary?.buildingAmenities
|
|
586
|
+
);
|
|
587
|
+
if (buildingLabels.length > 0) {
|
|
588
|
+
groups.push({
|
|
589
|
+
key: "building",
|
|
590
|
+
title: LISTING_AMENITY_TITLES.building,
|
|
591
|
+
labels: buildingLabels
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
return groups;
|
|
595
|
+
}
|
|
262
596
|
|
|
263
597
|
// ../search-url/types.ts
|
|
264
598
|
var SEARCH_BASE_ROUTE = "imoveis";
|
|
@@ -1004,8 +1338,208 @@ function paginationPages(currentPage, totalPages, padding) {
|
|
|
1004
1338
|
return pages;
|
|
1005
1339
|
}
|
|
1006
1340
|
|
|
1007
|
-
// src/
|
|
1341
|
+
// src/listing-detail.ts
|
|
1342
|
+
function finiteNumber(value) {
|
|
1343
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
1344
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
1345
|
+
const parsed = Number(value);
|
|
1346
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
1347
|
+
}
|
|
1348
|
+
return null;
|
|
1349
|
+
}
|
|
1350
|
+
function positiveCount(value) {
|
|
1351
|
+
const amount = finiteNumber(value);
|
|
1352
|
+
return amount != null && amount > 0 ? amount : null;
|
|
1353
|
+
}
|
|
1354
|
+
function formatFloorFact(value) {
|
|
1355
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1356
|
+
return value === 0 ? "T\xE9rreo" : String(value);
|
|
1357
|
+
}
|
|
1358
|
+
if (typeof value !== "string") return null;
|
|
1359
|
+
const trimmed = value.trim();
|
|
1360
|
+
if (!trimmed) return null;
|
|
1361
|
+
const parsed = Number(trimmed);
|
|
1362
|
+
if (Number.isFinite(parsed) && trimmed === String(parsed)) {
|
|
1363
|
+
return parsed === 0 ? "T\xE9rreo" : trimmed;
|
|
1364
|
+
}
|
|
1365
|
+
return trimmed;
|
|
1366
|
+
}
|
|
1367
|
+
function listingValues(listing) {
|
|
1368
|
+
const values = [
|
|
1369
|
+
{
|
|
1370
|
+
key: "price",
|
|
1371
|
+
label: "Pre\xE7o",
|
|
1372
|
+
text: listing.priceVisibility === "private" ? "Sob consulta" : formatListingPrice(listing.price)
|
|
1373
|
+
}
|
|
1374
|
+
];
|
|
1375
|
+
const condoFee = positiveCount(listing.property?.condoFee);
|
|
1376
|
+
if (condoFee != null) {
|
|
1377
|
+
values.push({
|
|
1378
|
+
key: "condoFee",
|
|
1379
|
+
label: "Condom\xEDnio",
|
|
1380
|
+
text: formatListingPrice(condoFee)
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
const propertyTax = positiveCount(listing.property?.propertyTax);
|
|
1384
|
+
if (propertyTax != null) {
|
|
1385
|
+
values.push({
|
|
1386
|
+
key: "propertyTax",
|
|
1387
|
+
label: "IPTU",
|
|
1388
|
+
text: formatListingPrice(propertyTax)
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
return values;
|
|
1392
|
+
}
|
|
1393
|
+
function listingFacts(listing) {
|
|
1394
|
+
const property = listing.property ?? {};
|
|
1395
|
+
const facts = [];
|
|
1396
|
+
const area = formatAreaM2(
|
|
1397
|
+
positiveCount(property.usableArea) ?? positiveCount(property.totalArea)
|
|
1398
|
+
);
|
|
1399
|
+
if (area) facts.push({ key: "area", label: "\xC1rea", text: area });
|
|
1400
|
+
const bedrooms = positiveCount(property.bedrooms);
|
|
1401
|
+
if (bedrooms != null) {
|
|
1402
|
+
facts.push({
|
|
1403
|
+
key: "bedrooms",
|
|
1404
|
+
label: "Dormit\xF3rios",
|
|
1405
|
+
text: String(bedrooms)
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
const suites = positiveCount(property.suites);
|
|
1409
|
+
if (suites != null) {
|
|
1410
|
+
facts.push({ key: "suites", label: "Su\xEDtes", text: String(suites) });
|
|
1411
|
+
}
|
|
1412
|
+
const parking = positiveCount(property.parkingSpaces);
|
|
1413
|
+
if (parking != null) {
|
|
1414
|
+
facts.push({ key: "parkingSpaces", label: "Vagas", text: String(parking) });
|
|
1415
|
+
}
|
|
1416
|
+
const rooms = positiveCount(property.rooms);
|
|
1417
|
+
if (rooms != null) {
|
|
1418
|
+
facts.push({ key: "rooms", label: "Salas", text: String(rooms) });
|
|
1419
|
+
}
|
|
1420
|
+
const floorText = formatFloorFact(property.floor);
|
|
1421
|
+
if (floorText) {
|
|
1422
|
+
facts.push({ key: "floor", label: "Andar", text: floorText });
|
|
1423
|
+
}
|
|
1424
|
+
return facts;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// src/listing-detail-fields.ts
|
|
1428
|
+
function visibleText(value) {
|
|
1429
|
+
if (typeof value !== "string") return null;
|
|
1430
|
+
const trimmed = value.trim();
|
|
1431
|
+
if (!trimmed || trimmed === "undefined" || trimmed === "null") return null;
|
|
1432
|
+
return trimmed;
|
|
1433
|
+
}
|
|
1434
|
+
function visibleRows(rows) {
|
|
1435
|
+
return rows.filter((row) => {
|
|
1436
|
+
const label = visibleText(row.label);
|
|
1437
|
+
const text = visibleText(row.text);
|
|
1438
|
+
return label != null && text != null;
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
function listingDetailFieldsModel(listing, dictionary) {
|
|
1442
|
+
return {
|
|
1443
|
+
facts: visibleRows(listingFacts(listing)),
|
|
1444
|
+
values: visibleRows(listingValues(listing)),
|
|
1445
|
+
amenityGroups: listingAmenityGroups(listing, dictionary).map((group) => ({
|
|
1446
|
+
...group,
|
|
1447
|
+
labels: group.labels.map((label) => visibleText(label)).filter((label) => label != null)
|
|
1448
|
+
})).filter((group) => group.labels.length > 0)
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// src/react/listing-detail-fields.tsx
|
|
1008
1453
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1454
|
+
function ListingDetailFields({
|
|
1455
|
+
listing,
|
|
1456
|
+
dictionary,
|
|
1457
|
+
className,
|
|
1458
|
+
classNames,
|
|
1459
|
+
style
|
|
1460
|
+
}) {
|
|
1461
|
+
const model = listingDetailFieldsModel(listing, dictionary ?? void 0);
|
|
1462
|
+
if (model.facts.length === 0 && model.values.length === 0 && model.amenityGroups.length === 0) {
|
|
1463
|
+
return null;
|
|
1464
|
+
}
|
|
1465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1466
|
+
"div",
|
|
1467
|
+
{
|
|
1468
|
+
"data-slot": "listing-detail-fields",
|
|
1469
|
+
className: cn(className, classNames?.root),
|
|
1470
|
+
style,
|
|
1471
|
+
children: [
|
|
1472
|
+
model.facts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { "data-slot": "listing-facts", className: classNames?.facts, children: model.facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1473
|
+
"li",
|
|
1474
|
+
{
|
|
1475
|
+
"data-slot": "listing-fact",
|
|
1476
|
+
"data-key": fact.key,
|
|
1477
|
+
className: classNames?.fact,
|
|
1478
|
+
children: [
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-slot": "listing-fact-label", children: fact.label }),
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-slot": "listing-fact-text", children: fact.text })
|
|
1481
|
+
]
|
|
1482
|
+
},
|
|
1483
|
+
fact.key
|
|
1484
|
+
)) }) : null,
|
|
1485
|
+
model.values.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dl", { "data-slot": "listing-values", className: classNames?.values, children: model.values.map((value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1486
|
+
"div",
|
|
1487
|
+
{
|
|
1488
|
+
"data-slot": "listing-value",
|
|
1489
|
+
"data-key": value.key,
|
|
1490
|
+
className: classNames?.value,
|
|
1491
|
+
children: [
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { "data-slot": "listing-value-label", children: value.label }),
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { "data-slot": "listing-value-text", children: value.text })
|
|
1494
|
+
]
|
|
1495
|
+
},
|
|
1496
|
+
value.key
|
|
1497
|
+
)) }) : null,
|
|
1498
|
+
model.amenityGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1499
|
+
"section",
|
|
1500
|
+
{
|
|
1501
|
+
"data-slot": "listing-amenities",
|
|
1502
|
+
"data-key": group.key,
|
|
1503
|
+
className: classNames?.amenityGroup,
|
|
1504
|
+
children: [
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1506
|
+
"h2",
|
|
1507
|
+
{
|
|
1508
|
+
"data-slot": "listing-amenities-title",
|
|
1509
|
+
className: classNames?.amenityTitle,
|
|
1510
|
+
children: group.title
|
|
1511
|
+
}
|
|
1512
|
+
),
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1514
|
+
"ul",
|
|
1515
|
+
{
|
|
1516
|
+
"data-slot": "listing-amenities-list",
|
|
1517
|
+
className: classNames?.amenityList,
|
|
1518
|
+
children: group.labels.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1519
|
+
"li",
|
|
1520
|
+
{
|
|
1521
|
+
"data-slot": "listing-amenity-label",
|
|
1522
|
+
className: classNames?.amenityLabel,
|
|
1523
|
+
children: label
|
|
1524
|
+
},
|
|
1525
|
+
label
|
|
1526
|
+
))
|
|
1527
|
+
}
|
|
1528
|
+
)
|
|
1529
|
+
]
|
|
1530
|
+
},
|
|
1531
|
+
group.key
|
|
1532
|
+
))
|
|
1533
|
+
]
|
|
1534
|
+
}
|
|
1535
|
+
);
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
// src/react/search-page.tsx
|
|
1539
|
+
var import_react3 = require("react");
|
|
1540
|
+
|
|
1541
|
+
// src/react/filter-panel.tsx
|
|
1542
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1009
1543
|
function RangeFields({
|
|
1010
1544
|
filter,
|
|
1011
1545
|
rangeDraft,
|
|
@@ -1017,10 +1551,10 @@ function RangeFields({
|
|
|
1017
1551
|
const patch = (side, raw) => {
|
|
1018
1552
|
onRangePatch(filter.id, side, isPrice ? formatGroupedInteger(raw) : raw);
|
|
1019
1553
|
};
|
|
1020
|
-
return /* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
1554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { "data-slot": "search-filter", children: [
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: filter.label }),
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { "data-slot": "search-range-row", children: [
|
|
1557
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1024
1558
|
RangeSide,
|
|
1025
1559
|
{
|
|
1026
1560
|
id: `${filter.id}-min`,
|
|
@@ -1032,7 +1566,7 @@ function RangeFields({
|
|
|
1032
1566
|
onEnter: () => onRangeCommit(filter.id, "enter")
|
|
1033
1567
|
}
|
|
1034
1568
|
),
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1036
1570
|
RangeSide,
|
|
1037
1571
|
{
|
|
1038
1572
|
id: `${filter.id}-max`,
|
|
@@ -1044,7 +1578,7 @@ function RangeFields({
|
|
|
1044
1578
|
onEnter: () => onRangeCommit(filter.id, "enter")
|
|
1045
1579
|
}
|
|
1046
1580
|
),
|
|
1047
|
-
/* @__PURE__ */ (0,
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1048
1582
|
"button",
|
|
1049
1583
|
{
|
|
1050
1584
|
type: "button",
|
|
@@ -1065,7 +1599,7 @@ function RangeSide({
|
|
|
1065
1599
|
onCommit,
|
|
1066
1600
|
onEnter
|
|
1067
1601
|
}) {
|
|
1068
|
-
const input = /* @__PURE__ */ (0,
|
|
1602
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1069
1603
|
"input",
|
|
1070
1604
|
{
|
|
1071
1605
|
id,
|
|
@@ -1086,10 +1620,10 @@ function RangeSide({
|
|
|
1086
1620
|
"data-slot": "search-range-input"
|
|
1087
1621
|
}
|
|
1088
1622
|
);
|
|
1089
|
-
return /* @__PURE__ */ (0,
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1091
|
-
isPrice ? /* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { "data-slot": "search-range-side", htmlFor: id, children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: label }),
|
|
1625
|
+
isPrice ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-slot": "search-range-affix", children: [
|
|
1626
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "data-slot": "search-range-prefix", children: "R$" }),
|
|
1093
1627
|
input
|
|
1094
1628
|
] }) : input
|
|
1095
1629
|
] });
|
|
@@ -1101,9 +1635,9 @@ function CountFields({
|
|
|
1101
1635
|
}) {
|
|
1102
1636
|
const selected = pathFilterValue(pathFilters, filter.id);
|
|
1103
1637
|
const choices = countFacetChoices(filter.options);
|
|
1104
|
-
return /* @__PURE__ */ (0,
|
|
1105
|
-
/* @__PURE__ */ (0,
|
|
1106
|
-
/* @__PURE__ */ (0,
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { "data-slot": "search-filter", children: [
|
|
1639
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: filter.label }),
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "data-slot": "search-count-group", role: "group", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1107
1641
|
"button",
|
|
1108
1642
|
{
|
|
1109
1643
|
type: "button",
|
|
@@ -1123,10 +1657,10 @@ function EnumFields({
|
|
|
1123
1657
|
}) {
|
|
1124
1658
|
const options = filter.options || [];
|
|
1125
1659
|
const scroll = options.length > 8;
|
|
1126
|
-
return /* @__PURE__ */ (0,
|
|
1127
|
-
/* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1129
|
-
/* @__PURE__ */ (0,
|
|
1660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { "data-slot": "search-filter", children: [
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: filter.label }),
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "data-slot": scroll ? "search-scroll" : "search-enum-list", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { "data-slot": "search-enum-option", children: [
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1130
1664
|
"input",
|
|
1131
1665
|
{
|
|
1132
1666
|
type: "checkbox",
|
|
@@ -1135,7 +1669,7 @@ function EnumFields({
|
|
|
1135
1669
|
onChange: () => onChange(filter.id, option.id)
|
|
1136
1670
|
}
|
|
1137
1671
|
),
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: option.label })
|
|
1139
1673
|
] }, option.id)) })
|
|
1140
1674
|
] });
|
|
1141
1675
|
}
|
|
@@ -1147,9 +1681,9 @@ function FilterPanel({
|
|
|
1147
1681
|
onRangePatch,
|
|
1148
1682
|
onRangeCommit
|
|
1149
1683
|
}) {
|
|
1150
|
-
return /* @__PURE__ */ (0,
|
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "data-slot": "search-filters", children: filters.map((filter) => {
|
|
1151
1685
|
if (filter.type === "range") {
|
|
1152
|
-
return /* @__PURE__ */ (0,
|
|
1686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1153
1687
|
RangeFields,
|
|
1154
1688
|
{
|
|
1155
1689
|
filter,
|
|
@@ -1161,7 +1695,7 @@ function FilterPanel({
|
|
|
1161
1695
|
);
|
|
1162
1696
|
}
|
|
1163
1697
|
if (filter.type === "count") {
|
|
1164
|
-
return /* @__PURE__ */ (0,
|
|
1698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1165
1699
|
CountFields,
|
|
1166
1700
|
{
|
|
1167
1701
|
filter,
|
|
@@ -1171,7 +1705,7 @@ function FilterPanel({
|
|
|
1171
1705
|
filter.id
|
|
1172
1706
|
);
|
|
1173
1707
|
}
|
|
1174
|
-
return /* @__PURE__ */ (0,
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1175
1709
|
EnumFields,
|
|
1176
1710
|
{
|
|
1177
1711
|
filter,
|
|
@@ -1198,7 +1732,7 @@ function rangeDraftFromPath(pathFilters) {
|
|
|
1198
1732
|
}
|
|
1199
1733
|
|
|
1200
1734
|
// src/react/search-chrome.tsx
|
|
1201
|
-
var
|
|
1735
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1202
1736
|
function SearchSortSelect({
|
|
1203
1737
|
value,
|
|
1204
1738
|
onChange,
|
|
@@ -1206,16 +1740,16 @@ function SearchSortSelect({
|
|
|
1206
1740
|
className
|
|
1207
1741
|
}) {
|
|
1208
1742
|
const options = searchSortOptions(sorts);
|
|
1209
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
-
/* @__PURE__ */ (0,
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { "data-slot": "search-sort", className, children: [
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "data-slot": "search-label", children: "Ordenar" }),
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1212
1746
|
"select",
|
|
1213
1747
|
{
|
|
1214
1748
|
id: "garagem-search-sort",
|
|
1215
1749
|
"data-slot": "search-sort-trigger",
|
|
1216
1750
|
value,
|
|
1217
1751
|
onChange: (event) => onChange(event.target.value || null),
|
|
1218
|
-
children: options.map((sort) => /* @__PURE__ */ (0,
|
|
1752
|
+
children: options.map((sort) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: sort.id, children: sort.label }, sort.id || "relevance"))
|
|
1219
1753
|
}
|
|
1220
1754
|
)
|
|
1221
1755
|
] });
|
|
@@ -1223,14 +1757,14 @@ function SearchSortSelect({
|
|
|
1223
1757
|
function ResultsSkeleton({
|
|
1224
1758
|
className
|
|
1225
1759
|
}) {
|
|
1226
|
-
return /* @__PURE__ */ (0,
|
|
1227
|
-
/* @__PURE__ */ (0,
|
|
1228
|
-
/* @__PURE__ */ (0,
|
|
1229
|
-
/* @__PURE__ */ (0,
|
|
1230
|
-
/* @__PURE__ */ (0,
|
|
1231
|
-
/* @__PURE__ */ (0,
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchChromeStyles, {}),
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "search-skeleton", className, children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "search-skeleton-card", children: [
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "search-skeleton-block", "data-kind": "media" }),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "search-skeleton-body", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "search-skeleton-block", "data-kind": "line-lg" }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "search-skeleton-block", "data-kind": "line-md" }),
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "search-skeleton-block", "data-kind": "line-sm" })
|
|
1234
1768
|
] })
|
|
1235
1769
|
] }, i)) })
|
|
1236
1770
|
] });
|
|
@@ -1239,12 +1773,12 @@ function SearchPageFallback({
|
|
|
1239
1773
|
className,
|
|
1240
1774
|
as: Root = "main"
|
|
1241
1775
|
}) {
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Root, { "data-slot": "search-page", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ResultsSkeleton, { className }) });
|
|
1243
1777
|
}
|
|
1244
1778
|
|
|
1245
1779
|
// src/react/search-pagination.tsx
|
|
1246
1780
|
var import_link2 = __toESM(require("next/link"));
|
|
1247
|
-
var
|
|
1781
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1248
1782
|
function NavItem({
|
|
1249
1783
|
href,
|
|
1250
1784
|
label,
|
|
@@ -1253,13 +1787,13 @@ function NavItem({
|
|
|
1253
1787
|
onNavigate
|
|
1254
1788
|
}) {
|
|
1255
1789
|
if (disabled || !href || current) {
|
|
1256
|
-
return /* @__PURE__ */ (0,
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1257
1791
|
"li",
|
|
1258
1792
|
{
|
|
1259
1793
|
"data-slot": "search-pagination-item",
|
|
1260
1794
|
"data-current": current ? "true" : void 0,
|
|
1261
1795
|
"data-disabled": disabled ? "true" : void 0,
|
|
1262
|
-
children: /* @__PURE__ */ (0,
|
|
1796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: label })
|
|
1263
1797
|
}
|
|
1264
1798
|
);
|
|
1265
1799
|
}
|
|
@@ -1271,7 +1805,7 @@ function NavItem({
|
|
|
1271
1805
|
event.preventDefault();
|
|
1272
1806
|
onNavigate(href);
|
|
1273
1807
|
}
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { "data-slot": "search-pagination-item", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_link2.default, { href, onClick: handleClick, "aria-label": label, children: label }) });
|
|
1275
1809
|
}
|
|
1276
1810
|
function SearchPagination({
|
|
1277
1811
|
page,
|
|
@@ -1282,14 +1816,14 @@ function SearchPagination({
|
|
|
1282
1816
|
}) {
|
|
1283
1817
|
if (totalPages <= 1) return null;
|
|
1284
1818
|
const pages = paginationPages(page, totalPages, 2);
|
|
1285
|
-
return /* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1286
1820
|
"nav",
|
|
1287
1821
|
{
|
|
1288
1822
|
"data-slot": "search-pagination",
|
|
1289
1823
|
className,
|
|
1290
1824
|
"aria-label": "Pagina\xE7\xE3o",
|
|
1291
|
-
children: /* @__PURE__ */ (0,
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ul", { children: [
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1293
1827
|
NavItem,
|
|
1294
1828
|
{
|
|
1295
1829
|
href: hrefWithExplicitPage(hrefForPage(1), 1),
|
|
@@ -1298,7 +1832,7 @@ function SearchPagination({
|
|
|
1298
1832
|
onNavigate
|
|
1299
1833
|
}
|
|
1300
1834
|
),
|
|
1301
|
-
/* @__PURE__ */ (0,
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1302
1836
|
NavItem,
|
|
1303
1837
|
{
|
|
1304
1838
|
href: hrefWithExplicitPage(
|
|
@@ -1310,7 +1844,7 @@ function SearchPagination({
|
|
|
1310
1844
|
onNavigate
|
|
1311
1845
|
}
|
|
1312
1846
|
),
|
|
1313
|
-
pages.map((n) => /* @__PURE__ */ (0,
|
|
1847
|
+
pages.map((n) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1314
1848
|
NavItem,
|
|
1315
1849
|
{
|
|
1316
1850
|
href: hrefWithExplicitPage(hrefForPage(n), n),
|
|
@@ -1320,7 +1854,7 @@ function SearchPagination({
|
|
|
1320
1854
|
},
|
|
1321
1855
|
n
|
|
1322
1856
|
)),
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1324
1858
|
NavItem,
|
|
1325
1859
|
{
|
|
1326
1860
|
href: hrefForPage(Math.min(totalPages, page + 1)),
|
|
@@ -1329,7 +1863,7 @@ function SearchPagination({
|
|
|
1329
1863
|
onNavigate
|
|
1330
1864
|
}
|
|
1331
1865
|
),
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1333
1867
|
NavItem,
|
|
1334
1868
|
{
|
|
1335
1869
|
href: hrefForPage(totalPages),
|
|
@@ -1344,9 +1878,9 @@ function SearchPagination({
|
|
|
1344
1878
|
}
|
|
1345
1879
|
|
|
1346
1880
|
// src/react/icons.tsx
|
|
1347
|
-
var
|
|
1881
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1348
1882
|
function Icon({ children, ...props }) {
|
|
1349
|
-
return /* @__PURE__ */ (0,
|
|
1883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1350
1884
|
"svg",
|
|
1351
1885
|
{
|
|
1352
1886
|
viewBox: "0 0 24 24",
|
|
@@ -1363,17 +1897,17 @@ function Icon({ children, ...props }) {
|
|
|
1363
1897
|
);
|
|
1364
1898
|
}
|
|
1365
1899
|
function SearchLensIcon(props) {
|
|
1366
|
-
return /* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Icon, { ...props, children: [
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "11", cy: "11", r: "7" }),
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 20l-3.5-3.5" })
|
|
1369
1903
|
] });
|
|
1370
1904
|
}
|
|
1371
1905
|
function SearchClearIcon(props) {
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6 6l12 12M18 6L6 18" }) });
|
|
1373
1907
|
}
|
|
1374
1908
|
|
|
1375
1909
|
// src/react/search-query-form.tsx
|
|
1376
|
-
var
|
|
1910
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1377
1911
|
function SearchQueryForm({
|
|
1378
1912
|
value,
|
|
1379
1913
|
onChange,
|
|
@@ -1388,7 +1922,7 @@ function SearchQueryForm({
|
|
|
1388
1922
|
event.preventDefault();
|
|
1389
1923
|
onSubmit();
|
|
1390
1924
|
}
|
|
1391
|
-
return /* @__PURE__ */ (0,
|
|
1925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1392
1926
|
"form",
|
|
1393
1927
|
{
|
|
1394
1928
|
role: "search",
|
|
@@ -1396,9 +1930,9 @@ function SearchQueryForm({
|
|
|
1396
1930
|
onSubmit: handleSubmit,
|
|
1397
1931
|
className,
|
|
1398
1932
|
children: [
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1933
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: "garagem-search-q", "data-slot": "search-label", children: "Busca" }),
|
|
1934
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-slot": "search-query-field", children: [
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1402
1936
|
"input",
|
|
1403
1937
|
{
|
|
1404
1938
|
id: "garagem-search-q",
|
|
@@ -1413,8 +1947,8 @@ function SearchQueryForm({
|
|
|
1413
1947
|
"data-slot": "search-query-input"
|
|
1414
1948
|
}
|
|
1415
1949
|
),
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1417
|
-
value ? /* @__PURE__ */ (0,
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-slot": "search-query-actions", children: [
|
|
1951
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1418
1952
|
"button",
|
|
1419
1953
|
{
|
|
1420
1954
|
type: "button",
|
|
@@ -1423,17 +1957,17 @@ function SearchQueryForm({
|
|
|
1423
1957
|
onClick: onClear,
|
|
1424
1958
|
"data-slot": "search-icon-button",
|
|
1425
1959
|
"data-kind": "clear",
|
|
1426
|
-
children: clearIcon ?? /* @__PURE__ */ (0,
|
|
1960
|
+
children: clearIcon ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchClearIcon, { className: iconClassName })
|
|
1427
1961
|
}
|
|
1428
1962
|
) : null,
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1430
1964
|
"button",
|
|
1431
1965
|
{
|
|
1432
1966
|
type: "submit",
|
|
1433
1967
|
title: "Buscar",
|
|
1434
1968
|
"aria-label": "Buscar",
|
|
1435
1969
|
"data-slot": "search-icon-button",
|
|
1436
|
-
children: searchIcon ?? /* @__PURE__ */ (0,
|
|
1970
|
+
children: searchIcon ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchLensIcon, { className: iconClassName })
|
|
1437
1971
|
}
|
|
1438
1972
|
)
|
|
1439
1973
|
] })
|
|
@@ -1773,7 +2307,8 @@ function usePublicSearch(options) {
|
|
|
1773
2307
|
}
|
|
1774
2308
|
|
|
1775
2309
|
// src/react/search-page.tsx
|
|
1776
|
-
var
|
|
2310
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2311
|
+
var SEARCH_EMPTY_COPY = "Nenhum im\xF3vel encontrado. Ajuste a busca ou os filtros.";
|
|
1777
2312
|
function ToolbarPopover({
|
|
1778
2313
|
id,
|
|
1779
2314
|
label,
|
|
@@ -1801,8 +2336,8 @@ function ToolbarPopover({
|
|
|
1801
2336
|
document.removeEventListener("keydown", onKey);
|
|
1802
2337
|
};
|
|
1803
2338
|
}, [open, onOpenChange]);
|
|
1804
|
-
return /* @__PURE__ */ (0,
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
2339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-toolbar-item", ref: rootRef, children: [
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1806
2341
|
"button",
|
|
1807
2342
|
{
|
|
1808
2343
|
type: "button",
|
|
@@ -1813,7 +2348,7 @@ function ToolbarPopover({
|
|
|
1813
2348
|
children: label
|
|
1814
2349
|
}
|
|
1815
2350
|
),
|
|
1816
|
-
open ? /* @__PURE__ */ (0,
|
|
2351
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1817
2352
|
"div",
|
|
1818
2353
|
{
|
|
1819
2354
|
"data-slot": "search-popover",
|
|
@@ -1828,7 +2363,7 @@ function FiltersTrigger({
|
|
|
1828
2363
|
onClick,
|
|
1829
2364
|
className
|
|
1830
2365
|
}) {
|
|
1831
|
-
return /* @__PURE__ */ (0,
|
|
2366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1832
2367
|
"button",
|
|
1833
2368
|
{
|
|
1834
2369
|
type: "button",
|
|
@@ -1845,9 +2380,9 @@ function ApplyBar({
|
|
|
1845
2380
|
onApply,
|
|
1846
2381
|
className
|
|
1847
2382
|
}) {
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1849
|
-
/* @__PURE__ */ (0,
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-apply-bar", className, children: [
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-kind": "clear", onClick: onClear, children: "Limpar" }),
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-kind": "apply", onClick: onApply, children: "Ver resultados" })
|
|
1851
2386
|
] });
|
|
1852
2387
|
}
|
|
1853
2388
|
function FilterSheet({
|
|
@@ -1875,8 +2410,8 @@ function FilterSheet({
|
|
|
1875
2410
|
};
|
|
1876
2411
|
}, [open]);
|
|
1877
2412
|
if (!open) return null;
|
|
1878
|
-
return /* @__PURE__ */ (0,
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
2413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-sheet", children: [
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1880
2415
|
"button",
|
|
1881
2416
|
{
|
|
1882
2417
|
type: "button",
|
|
@@ -1886,7 +2421,7 @@ function FilterSheet({
|
|
|
1886
2421
|
onClick: onClose
|
|
1887
2422
|
}
|
|
1888
2423
|
),
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1890
2425
|
"div",
|
|
1891
2426
|
{
|
|
1892
2427
|
"data-slot": "search-sheet-panel",
|
|
@@ -1895,9 +2430,9 @@ function FilterSheet({
|
|
|
1895
2430
|
"aria-modal": "true",
|
|
1896
2431
|
"aria-label": title,
|
|
1897
2432
|
children: [
|
|
1898
|
-
/* @__PURE__ */ (0,
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
1900
|
-
/* @__PURE__ */ (0,
|
|
2433
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { "data-slot": "search-sheet-title", children: title }),
|
|
2434
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-slot": "search-sheet-body", children }),
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-slot": "search-sheet-footer", children: footer })
|
|
1901
2436
|
]
|
|
1902
2437
|
}
|
|
1903
2438
|
)
|
|
@@ -1909,8 +2444,8 @@ function SearchHeading({
|
|
|
1909
2444
|
classNames,
|
|
1910
2445
|
loading
|
|
1911
2446
|
}) {
|
|
1912
|
-
return /* @__PURE__ */ (0,
|
|
1913
|
-
!loading ? /* @__PURE__ */ (0,
|
|
2447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-heading", className: classNames?.heading, children: [
|
|
2448
|
+
!loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1914
2449
|
"span",
|
|
1915
2450
|
{
|
|
1916
2451
|
"data-slot": "search-heading-count",
|
|
@@ -1918,7 +2453,7 @@ function SearchHeading({
|
|
|
1918
2453
|
children: total.toLocaleString("pt-BR")
|
|
1919
2454
|
}
|
|
1920
2455
|
) : null,
|
|
1921
|
-
/* @__PURE__ */ (0,
|
|
2456
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { "data-slot": "search-heading-title", className: classNames?.headingTitle, children: title })
|
|
1922
2457
|
] });
|
|
1923
2458
|
}
|
|
1924
2459
|
function SearchPage({
|
|
@@ -1993,8 +2528,8 @@ function SearchPage({
|
|
|
1993
2528
|
search.applyStaged();
|
|
1994
2529
|
closeSheet();
|
|
1995
2530
|
}
|
|
1996
|
-
const results = search.loading ? /* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
2531
|
+
const results = search.loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ResultsSkeleton, { className: classNames?.skeleton ?? classNames?.grid }) : search.listings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { "data-slot": "search-empty", className: classNames?.empty, children: SEARCH_EMPTY_COPY }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-slot": "search-grid", className: classNames?.grid, children: search.listings.map((listing) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1998
2533
|
Card,
|
|
1999
2534
|
{
|
|
2000
2535
|
listing,
|
|
@@ -2002,7 +2537,7 @@ function SearchPage({
|
|
|
2002
2537
|
},
|
|
2003
2538
|
listing.id
|
|
2004
2539
|
)) }),
|
|
2005
|
-
/* @__PURE__ */ (0,
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2006
2541
|
SearchPagination,
|
|
2007
2542
|
{
|
|
2008
2543
|
page: search.page,
|
|
@@ -2013,8 +2548,8 @@ function SearchPage({
|
|
|
2013
2548
|
}
|
|
2014
2549
|
)
|
|
2015
2550
|
] });
|
|
2016
|
-
const queryAndSort = /* @__PURE__ */ (0,
|
|
2017
|
-
/* @__PURE__ */ (0,
|
|
2551
|
+
const queryAndSort = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-query-sort", children: [
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2018
2553
|
SearchQueryForm,
|
|
2019
2554
|
{
|
|
2020
2555
|
value: search.qDraft,
|
|
@@ -2027,7 +2562,7 @@ function SearchPage({
|
|
|
2027
2562
|
clearIcon: icons?.clear
|
|
2028
2563
|
}
|
|
2029
2564
|
),
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2031
2566
|
SearchSortSelect,
|
|
2032
2567
|
{
|
|
2033
2568
|
value: search.applied.sort || "",
|
|
@@ -2037,7 +2572,7 @@ function SearchPage({
|
|
|
2037
2572
|
}
|
|
2038
2573
|
)
|
|
2039
2574
|
] });
|
|
2040
|
-
const header = heading ?? /* @__PURE__ */ (0,
|
|
2575
|
+
const header = heading ?? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2041
2576
|
SearchHeading,
|
|
2042
2577
|
{
|
|
2043
2578
|
total: search.total,
|
|
@@ -2046,7 +2581,7 @@ function SearchPage({
|
|
|
2046
2581
|
loading: search.loading
|
|
2047
2582
|
}
|
|
2048
2583
|
);
|
|
2049
|
-
const stagedPanel = (items) => /* @__PURE__ */ (0,
|
|
2584
|
+
const stagedPanel = (items) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2050
2585
|
FilterPanel,
|
|
2051
2586
|
{
|
|
2052
2587
|
filters: items,
|
|
@@ -2057,7 +2592,7 @@ function SearchPage({
|
|
|
2057
2592
|
onRangeCommit: (id) => commitRange(id, false)
|
|
2058
2593
|
}
|
|
2059
2594
|
);
|
|
2060
|
-
const sheet = /* @__PURE__ */ (0,
|
|
2595
|
+
const sheet = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2061
2596
|
FilterSheet,
|
|
2062
2597
|
{
|
|
2063
2598
|
open: sheetOpen,
|
|
@@ -2065,7 +2600,7 @@ function SearchPage({
|
|
|
2065
2600
|
onClose: closeSheet,
|
|
2066
2601
|
overlayClassName: classNames?.dialogOverlay,
|
|
2067
2602
|
panelClassName: cn(classNames?.dialog, classNames?.dialogPanel),
|
|
2068
|
-
footer: /* @__PURE__ */ (0,
|
|
2603
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2069
2604
|
ApplyBar,
|
|
2070
2605
|
{
|
|
2071
2606
|
onClear: clearStagedFilters,
|
|
@@ -2076,19 +2611,19 @@ function SearchPage({
|
|
|
2076
2611
|
children: stagedPanel(variant === "toolbar" ? extraFilters : filters)
|
|
2077
2612
|
}
|
|
2078
2613
|
);
|
|
2079
|
-
return /* @__PURE__ */ (0,
|
|
2614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2080
2615
|
Root,
|
|
2081
2616
|
{
|
|
2082
2617
|
"data-slot": "search-page",
|
|
2083
2618
|
"data-variant": variant,
|
|
2084
2619
|
className: cn(className, classNames?.root),
|
|
2085
2620
|
children: [
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SearchChromeStyles, {}),
|
|
2622
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: classNames?.header, children: header }),
|
|
2623
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-body", children: [
|
|
2089
2624
|
queryAndSort,
|
|
2090
|
-
variant === "toolbar" ? /* @__PURE__ */ (0,
|
|
2091
|
-
toolbarFilters.map((filter) => /* @__PURE__ */ (0,
|
|
2625
|
+
variant === "toolbar" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-toolbar", className: classNames?.toolbar, children: [
|
|
2626
|
+
toolbarFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2092
2627
|
ToolbarPopover,
|
|
2093
2628
|
{
|
|
2094
2629
|
id: filter.id,
|
|
@@ -2097,7 +2632,7 @@ function SearchPage({
|
|
|
2097
2632
|
onOpenChange: setOpenToolbar,
|
|
2098
2633
|
triggerClassName: classNames?.toolbarTrigger,
|
|
2099
2634
|
popoverClassName: classNames?.popover,
|
|
2100
|
-
children: /* @__PURE__ */ (0,
|
|
2635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2101
2636
|
FilterPanel,
|
|
2102
2637
|
{
|
|
2103
2638
|
filters: [filter],
|
|
@@ -2117,13 +2652,13 @@ function SearchPage({
|
|
|
2117
2652
|
},
|
|
2118
2653
|
filter.id
|
|
2119
2654
|
)),
|
|
2120
|
-
extraFilters.length > 0 ? /* @__PURE__ */ (0,
|
|
2655
|
+
extraFilters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FiltersTrigger, { onClick: openStagedFilters }) : null
|
|
2121
2656
|
] }) : null,
|
|
2122
|
-
variant === "dialog" ? /* @__PURE__ */ (0,
|
|
2123
|
-
variant === "sidebar" ? /* @__PURE__ */ (0,
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2657
|
+
variant === "dialog" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FiltersTrigger, { onClick: openStagedFilters }) : null,
|
|
2658
|
+
variant === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-slot": "search-layout", children: [
|
|
2659
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("aside", { "data-slot": "search-sidebar", className: classNames?.sidebar, children: [
|
|
2125
2660
|
stagedPanel(filters),
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2127
2662
|
ApplyBar,
|
|
2128
2663
|
{
|
|
2129
2664
|
onClear: clearStagedFilters,
|
|
@@ -2132,8 +2667,8 @@ function SearchPage({
|
|
|
2132
2667
|
}
|
|
2133
2668
|
)
|
|
2134
2669
|
] }),
|
|
2135
|
-
/* @__PURE__ */ (0,
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2670
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FiltersTrigger, { onClick: openStagedFilters }),
|
|
2137
2672
|
results
|
|
2138
2673
|
] })
|
|
2139
2674
|
] }) : results
|
|
@@ -2147,6 +2682,7 @@ function SearchPage({
|
|
|
2147
2682
|
0 && (module.exports = {
|
|
2148
2683
|
FilterPanel,
|
|
2149
2684
|
ListingCard,
|
|
2685
|
+
ListingDetailFields,
|
|
2150
2686
|
ResultsSkeleton,
|
|
2151
2687
|
SearchChromeStyles,
|
|
2152
2688
|
SearchPage,
|