@garagem-ai/site-sdk 0.4.1 → 0.4.2
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 +21 -34
- package/dist/index.d.mts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -0
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +212 -179
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +155 -122
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +13 -0
- package/src/react/listing-card.tsx +64 -52
- package/src/react/search-chrome.tsx +14 -12
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/react/styles/search-chrome-styles.tsx +22 -3
- package/src/studio-contract.ts +138 -0
package/dist/react.mjs
CHANGED
|
@@ -105,8 +105,35 @@ function cn(...parts) {
|
|
|
105
105
|
return parts.filter(Boolean).join(" ");
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
// src/react/styles/search-chrome-styles.tsx
|
|
109
|
+
import { useLayoutEffect } from "react";
|
|
110
|
+
|
|
111
|
+
// src/react/styles/search-chrome-css.generated.ts
|
|
112
|
+
var SEARCH_CHROME_CSS_VERSION = "0.4.2";
|
|
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-page"]{margin-inline:auto;max-width:80rem;padding:3rem 1.5rem}[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
|
+
|
|
115
|
+
// src/react/styles/search-chrome-styles.tsx
|
|
116
|
+
var STYLE_ID = `garagem-search-chrome-${SEARCH_CHROME_CSS_VERSION}`;
|
|
117
|
+
function injectSearchChromeOnce() {
|
|
118
|
+
if (typeof document === "undefined") return;
|
|
119
|
+
if (document.getElementById(STYLE_ID)) return;
|
|
120
|
+
const el = document.createElement("style");
|
|
121
|
+
el.id = STYLE_ID;
|
|
122
|
+
el.textContent = SEARCH_CHROME_CSS;
|
|
123
|
+
document.head.appendChild(el);
|
|
124
|
+
}
|
|
125
|
+
function SearchChromeStyles() {
|
|
126
|
+
if (typeof document !== "undefined") {
|
|
127
|
+
injectSearchChromeOnce();
|
|
128
|
+
}
|
|
129
|
+
useLayoutEffect(() => {
|
|
130
|
+
injectSearchChromeOnce();
|
|
131
|
+
}, []);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
108
135
|
// src/react/listing-card.tsx
|
|
109
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
136
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
110
137
|
function isListing(value) {
|
|
111
138
|
return "priceVisibility" in value && "businessType" in value && "title" in value;
|
|
112
139
|
}
|
|
@@ -121,51 +148,68 @@ function ListingCard({
|
|
|
121
148
|
const model = isListing(listing) ? toListingCardModel(listing) : listing;
|
|
122
149
|
const target = href ?? model.href;
|
|
123
150
|
const areaLabel = formatAreaM2(model.areaM2);
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
151
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
152
|
+
/* @__PURE__ */ jsx(SearchChromeStyles, {}),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
"article",
|
|
155
|
+
{
|
|
156
|
+
"data-slot": "listing-card",
|
|
157
|
+
className: cn(className, classNames?.root),
|
|
158
|
+
style,
|
|
159
|
+
children: /* @__PURE__ */ jsxs(Link, { href: target, "data-slot": "listing-card-link", children: [
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "listing-card-media", className: classNames?.media, children: [
|
|
161
|
+
slots?.media ?? (model.coverSrc ? /* @__PURE__ */ jsx("img", { src: model.coverSrc, alt: model.coverAlt }) : /* @__PURE__ */ jsx("div", { "data-slot": "listing-card-empty", children: "Sem foto" })),
|
|
162
|
+
slots?.badge ?? /* @__PURE__ */ jsx(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
"data-slot": "listing-card-badge",
|
|
166
|
+
className: classNames?.badge,
|
|
167
|
+
children: model.businessLabel
|
|
168
|
+
}
|
|
169
|
+
)
|
|
139
170
|
] }),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "listing-card-body", className: classNames?.body, children: [
|
|
172
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "listing-card-price-row", children: [
|
|
173
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "listing-card-price", className: classNames?.price, children: model.priceLabel }),
|
|
174
|
+
model.pricePeriod ? /* @__PURE__ */ jsx("span", { "data-slot": "listing-card-period", children: model.pricePeriod }) : null
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsx("h3", { "data-slot": "listing-card-title", className: classNames?.title, children: model.title }),
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
"p",
|
|
179
|
+
{
|
|
180
|
+
"data-slot": "listing-card-location",
|
|
181
|
+
className: classNames?.location,
|
|
182
|
+
children: model.locationLabel || model.propertyType || ""
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ jsxs(
|
|
186
|
+
"ul",
|
|
187
|
+
{
|
|
188
|
+
"data-slot": "listing-card-features",
|
|
189
|
+
className: classNames?.features,
|
|
190
|
+
children: [
|
|
191
|
+
model.bedrooms != null ? /* @__PURE__ */ jsxs("li", { children: [
|
|
192
|
+
model.bedrooms,
|
|
193
|
+
" quartos"
|
|
194
|
+
] }) : null,
|
|
195
|
+
model.bathrooms != null ? /* @__PURE__ */ jsxs("li", { children: [
|
|
196
|
+
model.bathrooms,
|
|
197
|
+
" banheiros"
|
|
198
|
+
] }) : null,
|
|
199
|
+
model.parkingSpaces != null ? /* @__PURE__ */ jsxs("li", { children: [
|
|
200
|
+
model.parkingSpaces,
|
|
201
|
+
" vagas"
|
|
202
|
+
] }) : null,
|
|
203
|
+
areaLabel ? /* @__PURE__ */ jsx("li", { children: areaLabel }) : null
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
slots?.cta ? /* @__PURE__ */ jsx("div", { "data-slot": "listing-card-cta", className: classNames?.cta, children: slots.cta }) : null
|
|
208
|
+
] })
|
|
165
209
|
] })
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
);
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] });
|
|
169
213
|
}
|
|
170
214
|
|
|
171
215
|
// src/react/search-page.tsx
|
|
@@ -1113,19 +1157,8 @@ function rangeDraftFromPath(pathFilters) {
|
|
|
1113
1157
|
};
|
|
1114
1158
|
}
|
|
1115
1159
|
|
|
1116
|
-
// src/react/styles/search-chrome-css.generated.ts
|
|
1117
|
-
var SEARCH_CHROME_CSS_VERSION = "0.4.1";
|
|
1118
|
-
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-page"]{margin-inline:auto;max-width:80rem;padding:3rem 1.5rem}[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}}`;
|
|
1119
|
-
|
|
1120
|
-
// src/react/styles/search-chrome-styles.tsx
|
|
1121
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1122
|
-
var STYLE_ID = `garagem-search-chrome-${SEARCH_CHROME_CSS_VERSION}`;
|
|
1123
|
-
function SearchChromeStyles() {
|
|
1124
|
-
return /* @__PURE__ */ jsx3("style", { id: STYLE_ID, children: SEARCH_CHROME_CSS });
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
1160
|
// src/react/search-chrome.tsx
|
|
1128
|
-
import { jsx as
|
|
1161
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1129
1162
|
function SearchSortSelect({
|
|
1130
1163
|
value,
|
|
1131
1164
|
onChange,
|
|
@@ -1134,15 +1167,15 @@ function SearchSortSelect({
|
|
|
1134
1167
|
}) {
|
|
1135
1168
|
const options = searchSortOptions(sorts);
|
|
1136
1169
|
return /* @__PURE__ */ jsxs3("label", { "data-slot": "search-sort", className, children: [
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ jsx3("span", { "data-slot": "search-label", children: "Ordenar" }),
|
|
1171
|
+
/* @__PURE__ */ jsx3(
|
|
1139
1172
|
"select",
|
|
1140
1173
|
{
|
|
1141
1174
|
id: "garagem-search-sort",
|
|
1142
1175
|
"data-slot": "search-sort-trigger",
|
|
1143
1176
|
value,
|
|
1144
1177
|
onChange: (event) => onChange(event.target.value || null),
|
|
1145
|
-
children: options.map((sort) => /* @__PURE__ */
|
|
1178
|
+
children: options.map((sort) => /* @__PURE__ */ jsx3("option", { value: sort.id, children: sort.label }, sort.id || "relevance"))
|
|
1146
1179
|
}
|
|
1147
1180
|
)
|
|
1148
1181
|
] });
|
|
@@ -1150,27 +1183,27 @@ function SearchSortSelect({
|
|
|
1150
1183
|
function ResultsSkeleton({
|
|
1151
1184
|
className
|
|
1152
1185
|
}) {
|
|
1153
|
-
return /* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */ jsxs3("div", { "data-slot": "search-skeleton-
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1186
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1187
|
+
/* @__PURE__ */ jsx3(SearchChromeStyles, {}),
|
|
1188
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-skeleton", className, children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsxs3("div", { "data-slot": "search-skeleton-card", children: [
|
|
1189
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-skeleton-block", "data-kind": "media" }),
|
|
1190
|
+
/* @__PURE__ */ jsxs3("div", { "data-slot": "search-skeleton-body", children: [
|
|
1191
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-skeleton-block", "data-kind": "line-lg" }),
|
|
1192
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-skeleton-block", "data-kind": "line-md" }),
|
|
1193
|
+
/* @__PURE__ */ jsx3("div", { "data-slot": "search-skeleton-block", "data-kind": "line-sm" })
|
|
1194
|
+
] })
|
|
1195
|
+
] }, i)) })
|
|
1196
|
+
] });
|
|
1161
1197
|
}
|
|
1162
1198
|
function SearchPageFallback({
|
|
1163
1199
|
className
|
|
1164
1200
|
}) {
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */ jsx4(SearchChromeStyles, {}),
|
|
1167
|
-
/* @__PURE__ */ jsx4(ResultsSkeleton, { className })
|
|
1168
|
-
] });
|
|
1201
|
+
return /* @__PURE__ */ jsx3("main", { "data-slot": "search-page", children: /* @__PURE__ */ jsx3(ResultsSkeleton, { className }) });
|
|
1169
1202
|
}
|
|
1170
1203
|
|
|
1171
1204
|
// src/react/search-pagination.tsx
|
|
1172
1205
|
import Link2 from "next/link";
|
|
1173
|
-
import { jsx as
|
|
1206
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1174
1207
|
function NavItem({
|
|
1175
1208
|
href,
|
|
1176
1209
|
label,
|
|
@@ -1179,13 +1212,13 @@ function NavItem({
|
|
|
1179
1212
|
onNavigate
|
|
1180
1213
|
}) {
|
|
1181
1214
|
if (disabled || !href || current) {
|
|
1182
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ jsx4(
|
|
1183
1216
|
"li",
|
|
1184
1217
|
{
|
|
1185
1218
|
"data-slot": "search-pagination-item",
|
|
1186
1219
|
"data-current": current ? "true" : void 0,
|
|
1187
1220
|
"data-disabled": disabled ? "true" : void 0,
|
|
1188
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ jsx4("span", { children: label })
|
|
1189
1222
|
}
|
|
1190
1223
|
);
|
|
1191
1224
|
}
|
|
@@ -1197,7 +1230,7 @@ function NavItem({
|
|
|
1197
1230
|
event.preventDefault();
|
|
1198
1231
|
onNavigate(href);
|
|
1199
1232
|
}
|
|
1200
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ jsx4("li", { "data-slot": "search-pagination-item", children: /* @__PURE__ */ jsx4(Link2, { href, onClick: handleClick, "aria-label": label, children: label }) });
|
|
1201
1234
|
}
|
|
1202
1235
|
function SearchPagination({
|
|
1203
1236
|
page,
|
|
@@ -1208,14 +1241,14 @@ function SearchPagination({
|
|
|
1208
1241
|
}) {
|
|
1209
1242
|
if (totalPages <= 1) return null;
|
|
1210
1243
|
const pages = paginationPages(page, totalPages, 2);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsx4(
|
|
1212
1245
|
"nav",
|
|
1213
1246
|
{
|
|
1214
1247
|
"data-slot": "search-pagination",
|
|
1215
1248
|
className,
|
|
1216
1249
|
"aria-label": "Pagina\xE7\xE3o",
|
|
1217
1250
|
children: /* @__PURE__ */ jsxs4("ul", { children: [
|
|
1218
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ jsx4(
|
|
1219
1252
|
NavItem,
|
|
1220
1253
|
{
|
|
1221
1254
|
href: hrefWithExplicitPage(hrefForPage(1), 1),
|
|
@@ -1224,7 +1257,7 @@ function SearchPagination({
|
|
|
1224
1257
|
onNavigate
|
|
1225
1258
|
}
|
|
1226
1259
|
),
|
|
1227
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ jsx4(
|
|
1228
1261
|
NavItem,
|
|
1229
1262
|
{
|
|
1230
1263
|
href: hrefWithExplicitPage(
|
|
@@ -1236,7 +1269,7 @@ function SearchPagination({
|
|
|
1236
1269
|
onNavigate
|
|
1237
1270
|
}
|
|
1238
1271
|
),
|
|
1239
|
-
pages.map((n) => /* @__PURE__ */
|
|
1272
|
+
pages.map((n) => /* @__PURE__ */ jsx4(
|
|
1240
1273
|
NavItem,
|
|
1241
1274
|
{
|
|
1242
1275
|
href: hrefWithExplicitPage(hrefForPage(n), n),
|
|
@@ -1246,7 +1279,7 @@ function SearchPagination({
|
|
|
1246
1279
|
},
|
|
1247
1280
|
n
|
|
1248
1281
|
)),
|
|
1249
|
-
/* @__PURE__ */
|
|
1282
|
+
/* @__PURE__ */ jsx4(
|
|
1250
1283
|
NavItem,
|
|
1251
1284
|
{
|
|
1252
1285
|
href: hrefForPage(Math.min(totalPages, page + 1)),
|
|
@@ -1255,7 +1288,7 @@ function SearchPagination({
|
|
|
1255
1288
|
onNavigate
|
|
1256
1289
|
}
|
|
1257
1290
|
),
|
|
1258
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ jsx4(
|
|
1259
1292
|
NavItem,
|
|
1260
1293
|
{
|
|
1261
1294
|
href: hrefForPage(totalPages),
|
|
@@ -1270,9 +1303,9 @@ function SearchPagination({
|
|
|
1270
1303
|
}
|
|
1271
1304
|
|
|
1272
1305
|
// src/react/icons.tsx
|
|
1273
|
-
import { jsx as
|
|
1306
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1274
1307
|
function Icon({ children, ...props }) {
|
|
1275
|
-
return /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsx5(
|
|
1276
1309
|
"svg",
|
|
1277
1310
|
{
|
|
1278
1311
|
viewBox: "0 0 24 24",
|
|
@@ -1290,16 +1323,16 @@ function Icon({ children, ...props }) {
|
|
|
1290
1323
|
}
|
|
1291
1324
|
function SearchLensIcon(props) {
|
|
1292
1325
|
return /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx5("circle", { cx: "11", cy: "11", r: "7" }),
|
|
1327
|
+
/* @__PURE__ */ jsx5("path", { d: "M20 20l-3.5-3.5" })
|
|
1295
1328
|
] });
|
|
1296
1329
|
}
|
|
1297
1330
|
function SearchClearIcon(props) {
|
|
1298
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ jsx5(Icon, { ...props, children: /* @__PURE__ */ jsx5("path", { d: "M6 6l12 12M18 6L6 18" }) });
|
|
1299
1332
|
}
|
|
1300
1333
|
|
|
1301
1334
|
// src/react/search-query-form.tsx
|
|
1302
|
-
import { jsx as
|
|
1335
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1303
1336
|
function SearchQueryForm({
|
|
1304
1337
|
value,
|
|
1305
1338
|
onChange,
|
|
@@ -1322,9 +1355,9 @@ function SearchQueryForm({
|
|
|
1322
1355
|
onSubmit: handleSubmit,
|
|
1323
1356
|
className,
|
|
1324
1357
|
children: [
|
|
1325
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: "garagem-search-q", "data-slot": "search-label", children: "Busca" }),
|
|
1326
1359
|
/* @__PURE__ */ jsxs6("div", { "data-slot": "search-query-field", children: [
|
|
1327
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ jsx6(
|
|
1328
1361
|
"input",
|
|
1329
1362
|
{
|
|
1330
1363
|
id: "garagem-search-q",
|
|
@@ -1340,7 +1373,7 @@ function SearchQueryForm({
|
|
|
1340
1373
|
}
|
|
1341
1374
|
),
|
|
1342
1375
|
/* @__PURE__ */ jsxs6("div", { "data-slot": "search-query-actions", children: [
|
|
1343
|
-
value ? /* @__PURE__ */
|
|
1376
|
+
value ? /* @__PURE__ */ jsx6(
|
|
1344
1377
|
"button",
|
|
1345
1378
|
{
|
|
1346
1379
|
type: "button",
|
|
@@ -1349,17 +1382,17 @@ function SearchQueryForm({
|
|
|
1349
1382
|
onClick: onClear,
|
|
1350
1383
|
"data-slot": "search-icon-button",
|
|
1351
1384
|
"data-kind": "clear",
|
|
1352
|
-
children: clearIcon ?? /* @__PURE__ */
|
|
1385
|
+
children: clearIcon ?? /* @__PURE__ */ jsx6(SearchClearIcon, { className: iconClassName })
|
|
1353
1386
|
}
|
|
1354
1387
|
) : null,
|
|
1355
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsx6(
|
|
1356
1389
|
"button",
|
|
1357
1390
|
{
|
|
1358
1391
|
type: "submit",
|
|
1359
1392
|
title: "Buscar",
|
|
1360
1393
|
"aria-label": "Buscar",
|
|
1361
1394
|
"data-slot": "search-icon-button",
|
|
1362
|
-
children: searchIcon ?? /* @__PURE__ */
|
|
1395
|
+
children: searchIcon ?? /* @__PURE__ */ jsx6(SearchLensIcon, { className: iconClassName })
|
|
1363
1396
|
}
|
|
1364
1397
|
)
|
|
1365
1398
|
] })
|
|
@@ -1698,7 +1731,7 @@ function usePublicSearch(options) {
|
|
|
1698
1731
|
}
|
|
1699
1732
|
|
|
1700
1733
|
// src/react/search-page.tsx
|
|
1701
|
-
import { Fragment, jsx as
|
|
1734
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1702
1735
|
function ToolbarPopover({
|
|
1703
1736
|
id,
|
|
1704
1737
|
label,
|
|
@@ -1727,7 +1760,7 @@ function ToolbarPopover({
|
|
|
1727
1760
|
};
|
|
1728
1761
|
}, [open, onOpenChange]);
|
|
1729
1762
|
return /* @__PURE__ */ jsxs7("div", { "data-slot": "search-toolbar-item", ref: rootRef, children: [
|
|
1730
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ jsx7(
|
|
1731
1764
|
"button",
|
|
1732
1765
|
{
|
|
1733
1766
|
type: "button",
|
|
@@ -1738,7 +1771,7 @@ function ToolbarPopover({
|
|
|
1738
1771
|
children: label
|
|
1739
1772
|
}
|
|
1740
1773
|
),
|
|
1741
|
-
open ? /* @__PURE__ */
|
|
1774
|
+
open ? /* @__PURE__ */ jsx7(
|
|
1742
1775
|
"div",
|
|
1743
1776
|
{
|
|
1744
1777
|
"data-slot": "search-popover",
|
|
@@ -1753,7 +1786,7 @@ function FiltersTrigger({
|
|
|
1753
1786
|
onClick,
|
|
1754
1787
|
className
|
|
1755
1788
|
}) {
|
|
1756
|
-
return /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ jsx7(
|
|
1757
1790
|
"button",
|
|
1758
1791
|
{
|
|
1759
1792
|
type: "button",
|
|
@@ -1771,8 +1804,8 @@ function ApplyBar({
|
|
|
1771
1804
|
className
|
|
1772
1805
|
}) {
|
|
1773
1806
|
return /* @__PURE__ */ jsxs7("div", { "data-slot": "search-apply-bar", className, children: [
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ jsx7("button", { type: "button", "data-kind": "clear", onClick: onClear, children: "Limpar" }),
|
|
1808
|
+
/* @__PURE__ */ jsx7("button", { type: "button", "data-kind": "apply", onClick: onApply, children: "Ver resultados" })
|
|
1776
1809
|
] });
|
|
1777
1810
|
}
|
|
1778
1811
|
function FilterSheet({
|
|
@@ -1801,7 +1834,7 @@ function FilterSheet({
|
|
|
1801
1834
|
}, [open]);
|
|
1802
1835
|
if (!open) return null;
|
|
1803
1836
|
return /* @__PURE__ */ jsxs7("div", { "data-slot": "search-sheet", children: [
|
|
1804
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ jsx7(
|
|
1805
1838
|
"button",
|
|
1806
1839
|
{
|
|
1807
1840
|
type: "button",
|
|
@@ -1820,9 +1853,9 @@ function FilterSheet({
|
|
|
1820
1853
|
"aria-modal": "true",
|
|
1821
1854
|
"aria-label": title,
|
|
1822
1855
|
children: [
|
|
1823
|
-
/* @__PURE__ */
|
|
1824
|
-
/* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ jsx7("p", { "data-slot": "search-sheet-title", children: title }),
|
|
1857
|
+
/* @__PURE__ */ jsx7("div", { "data-slot": "search-sheet-body", children }),
|
|
1858
|
+
/* @__PURE__ */ jsx7("div", { "data-slot": "search-sheet-footer", children: footer })
|
|
1826
1859
|
]
|
|
1827
1860
|
}
|
|
1828
1861
|
)
|
|
@@ -1835,7 +1868,7 @@ function SearchHeading({
|
|
|
1835
1868
|
loading
|
|
1836
1869
|
}) {
|
|
1837
1870
|
return /* @__PURE__ */ jsxs7("div", { "data-slot": "search-heading", className: classNames?.heading, children: [
|
|
1838
|
-
!loading ? /* @__PURE__ */
|
|
1871
|
+
!loading ? /* @__PURE__ */ jsx7(
|
|
1839
1872
|
"span",
|
|
1840
1873
|
{
|
|
1841
1874
|
"data-slot": "search-heading-count",
|
|
@@ -1843,7 +1876,7 @@ function SearchHeading({
|
|
|
1843
1876
|
children: total.toLocaleString("pt-BR")
|
|
1844
1877
|
}
|
|
1845
1878
|
) : null,
|
|
1846
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx7("h1", { "data-slot": "search-heading-title", className: classNames?.headingTitle, children: title })
|
|
1847
1880
|
] });
|
|
1848
1881
|
}
|
|
1849
1882
|
function SearchPage({
|
|
@@ -1917,8 +1950,8 @@ function SearchPage({
|
|
|
1917
1950
|
search.applyStaged();
|
|
1918
1951
|
closeSheet();
|
|
1919
1952
|
}
|
|
1920
|
-
const results = search.loading ? /* @__PURE__ */
|
|
1921
|
-
/* @__PURE__ */
|
|
1953
|
+
const results = search.loading ? /* @__PURE__ */ jsx7(ResultsSkeleton, { className: classNames?.skeleton ?? classNames?.grid }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
1954
|
+
/* @__PURE__ */ jsx7("div", { "data-slot": "search-grid", className: classNames?.grid, children: search.listings.map((listing) => /* @__PURE__ */ jsx7(
|
|
1922
1955
|
Card,
|
|
1923
1956
|
{
|
|
1924
1957
|
listing,
|
|
@@ -1926,7 +1959,7 @@ function SearchPage({
|
|
|
1926
1959
|
},
|
|
1927
1960
|
listing.id
|
|
1928
1961
|
)) }),
|
|
1929
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ jsx7(
|
|
1930
1963
|
SearchPagination,
|
|
1931
1964
|
{
|
|
1932
1965
|
page: search.page,
|
|
@@ -1938,7 +1971,7 @@ function SearchPage({
|
|
|
1938
1971
|
)
|
|
1939
1972
|
] });
|
|
1940
1973
|
const queryAndSort = /* @__PURE__ */ jsxs7("div", { "data-slot": "search-query-sort", children: [
|
|
1941
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ jsx7(
|
|
1942
1975
|
SearchQueryForm,
|
|
1943
1976
|
{
|
|
1944
1977
|
value: search.qDraft,
|
|
@@ -1951,7 +1984,7 @@ function SearchPage({
|
|
|
1951
1984
|
clearIcon: icons?.clear
|
|
1952
1985
|
}
|
|
1953
1986
|
),
|
|
1954
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsx7(
|
|
1955
1988
|
SearchSortSelect,
|
|
1956
1989
|
{
|
|
1957
1990
|
value: search.applied.sort || "",
|
|
@@ -1961,7 +1994,7 @@ function SearchPage({
|
|
|
1961
1994
|
}
|
|
1962
1995
|
)
|
|
1963
1996
|
] });
|
|
1964
|
-
const header = heading ?? /* @__PURE__ */
|
|
1997
|
+
const header = heading ?? /* @__PURE__ */ jsx7(
|
|
1965
1998
|
SearchHeading,
|
|
1966
1999
|
{
|
|
1967
2000
|
total: search.total,
|
|
@@ -1970,7 +2003,7 @@ function SearchPage({
|
|
|
1970
2003
|
loading: search.loading
|
|
1971
2004
|
}
|
|
1972
2005
|
);
|
|
1973
|
-
const stagedPanel = (items) => /* @__PURE__ */
|
|
2006
|
+
const stagedPanel = (items) => /* @__PURE__ */ jsx7(
|
|
1974
2007
|
FilterPanel,
|
|
1975
2008
|
{
|
|
1976
2009
|
filters: items,
|
|
@@ -1981,7 +2014,7 @@ function SearchPage({
|
|
|
1981
2014
|
onRangeCommit: (id) => commitRange(id, false)
|
|
1982
2015
|
}
|
|
1983
2016
|
);
|
|
1984
|
-
const sheet = /* @__PURE__ */
|
|
2017
|
+
const sheet = /* @__PURE__ */ jsx7(
|
|
1985
2018
|
FilterSheet,
|
|
1986
2019
|
{
|
|
1987
2020
|
open: sheetOpen,
|
|
@@ -1989,7 +2022,7 @@ function SearchPage({
|
|
|
1989
2022
|
onClose: closeSheet,
|
|
1990
2023
|
overlayClassName: classNames?.dialogOverlay,
|
|
1991
2024
|
panelClassName: cn(classNames?.dialog, classNames?.dialogPanel),
|
|
1992
|
-
footer: /* @__PURE__ */
|
|
2025
|
+
footer: /* @__PURE__ */ jsx7(
|
|
1993
2026
|
ApplyBar,
|
|
1994
2027
|
{
|
|
1995
2028
|
onClear: clearStagedFilters,
|
|
@@ -2007,12 +2040,12 @@ function SearchPage({
|
|
|
2007
2040
|
"data-variant": variant,
|
|
2008
2041
|
className: cn(className, classNames?.root),
|
|
2009
2042
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsx7(SearchChromeStyles, {}),
|
|
2044
|
+
/* @__PURE__ */ jsx7("div", { className: classNames?.header, children: header }),
|
|
2012
2045
|
/* @__PURE__ */ jsxs7("div", { "data-slot": "search-body", children: [
|
|
2013
2046
|
queryAndSort,
|
|
2014
2047
|
variant === "toolbar" ? /* @__PURE__ */ jsxs7("div", { "data-slot": "search-toolbar", className: classNames?.toolbar, children: [
|
|
2015
|
-
toolbarFilters.map((filter) => /* @__PURE__ */
|
|
2048
|
+
toolbarFilters.map((filter) => /* @__PURE__ */ jsx7(
|
|
2016
2049
|
ToolbarPopover,
|
|
2017
2050
|
{
|
|
2018
2051
|
id: filter.id,
|
|
@@ -2021,7 +2054,7 @@ function SearchPage({
|
|
|
2021
2054
|
onOpenChange: setOpenToolbar,
|
|
2022
2055
|
triggerClassName: classNames?.toolbarTrigger,
|
|
2023
2056
|
popoverClassName: classNames?.popover,
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2057
|
+
children: /* @__PURE__ */ jsx7(
|
|
2025
2058
|
FilterPanel,
|
|
2026
2059
|
{
|
|
2027
2060
|
filters: [filter],
|
|
@@ -2041,13 +2074,13 @@ function SearchPage({
|
|
|
2041
2074
|
},
|
|
2042
2075
|
filter.id
|
|
2043
2076
|
)),
|
|
2044
|
-
extraFilters.length > 0 ? /* @__PURE__ */
|
|
2077
|
+
extraFilters.length > 0 ? /* @__PURE__ */ jsx7(FiltersTrigger, { onClick: openStagedFilters }) : null
|
|
2045
2078
|
] }) : null,
|
|
2046
|
-
variant === "dialog" ? /* @__PURE__ */
|
|
2079
|
+
variant === "dialog" ? /* @__PURE__ */ jsx7(FiltersTrigger, { onClick: openStagedFilters }) : null,
|
|
2047
2080
|
variant === "sidebar" ? /* @__PURE__ */ jsxs7("div", { "data-slot": "search-layout", children: [
|
|
2048
2081
|
/* @__PURE__ */ jsxs7("aside", { "data-slot": "search-sidebar", className: classNames?.sidebar, children: [
|
|
2049
2082
|
stagedPanel(filters),
|
|
2050
|
-
/* @__PURE__ */
|
|
2083
|
+
/* @__PURE__ */ jsx7(
|
|
2051
2084
|
ApplyBar,
|
|
2052
2085
|
{
|
|
2053
2086
|
onClear: clearStagedFilters,
|
|
@@ -2057,7 +2090,7 @@ function SearchPage({
|
|
|
2057
2090
|
)
|
|
2058
2091
|
] }),
|
|
2059
2092
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
2060
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ jsx7(FiltersTrigger, { onClick: openStagedFilters }),
|
|
2061
2094
|
results
|
|
2062
2095
|
] })
|
|
2063
2096
|
] }) : results
|