@garagem-ai/site-sdk 0.5.2 → 0.5.3
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 +16 -25
- package/dist/index.d.mts +202 -28
- package/dist/index.d.ts +202 -28
- package/dist/index.js +41 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -42
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -60
- package/dist/react.d.ts +2 -60
- package/dist/react.js +150 -862
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +122 -820
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-4ocM0UPk.d.mts → search-engine-CkbO77G8.d.mts} +11 -181
- package/dist/{search-engine-4ocM0UPk.d.ts → search-engine-CkbO77G8.d.ts} +11 -181
- package/package.json +4 -9
- package/src/amenity-labels.ts +9 -2
- package/src/fetchers.ts +2 -1
- package/src/index.ts +1 -2
- package/src/internal/url.ts +1 -0
- package/src/listing-detail.ts +2 -1
- package/src/presentation.ts +1 -24
- package/src/react/index.ts +0 -11
- package/src/react/staged-filters-mirror.ts +38 -0
- package/src/react/types.ts +0 -30
- package/src/react/use-public-search.ts +30 -10
- package/src/search-engine.ts +3 -0
- package/src/studio-contract.ts +35 -20
- package/src/types.ts +10 -0
- package/src/react/cn.ts +0 -3
- package/src/react/listing-card.tsx +0 -98
- package/src/react/listing-detail-fields.tsx +0 -119
- package/src/react/search-chrome.tsx +0 -29
- package/src/react/search.css +0 -214
- package/src/react/styles/index.ts +0 -1
- package/src/react/styles/search-chrome-css.generated.ts +0 -5
- package/src/react/styles/search-chrome-styles.tsx +0 -31
package/src/react/search.css
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Card + skeleton CSS for published Studio sites.
|
|
3
|
-
* Layout does not depend on the app Tailwind scan of node_modules.
|
|
4
|
-
* Brand color/radius come from the site theme (`--background`, `--primary`, …).
|
|
5
|
-
* Search chrome (query, toolbar, sort, filters, pagination) is app-owned.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
--garagem-listing-card-radius: 0.75rem;
|
|
10
|
-
--garagem-listing-card-gap: 1.5rem;
|
|
11
|
-
--garagem-listing-price-size: 1.125rem;
|
|
12
|
-
--garagem-listing-media-ratio: 4 / 3;
|
|
13
|
-
--garagem-skeleton: var(--muted, #e7e5e4);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[data-slot="search-grid"],
|
|
17
|
-
[data-slot="search-skeleton"] {
|
|
18
|
-
display: grid;
|
|
19
|
-
grid-template-columns: 1fr;
|
|
20
|
-
gap: var(--garagem-listing-card-gap);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@media (min-width: 640px) {
|
|
24
|
-
[data-slot="search-grid"],
|
|
25
|
-
[data-slot="search-skeleton"] {
|
|
26
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@media (min-width: 1024px) {
|
|
31
|
-
[data-slot="search-grid"],
|
|
32
|
-
[data-slot="search-skeleton"] {
|
|
33
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[data-slot="listing-card"] {
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
border-radius: var(--garagem-listing-card-radius);
|
|
40
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
41
|
-
background: var(--card, var(--background, #fff));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[data-slot="listing-card-price-row"] {
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
align-items: baseline;
|
|
47
|
-
gap: 0.25rem;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
[data-slot="listing-card-price"] {
|
|
51
|
-
font-size: var(--garagem-listing-price-size);
|
|
52
|
-
font-weight: 600;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[data-slot="listing-card-period"] {
|
|
56
|
-
font-size: 0.75rem;
|
|
57
|
-
color: var(--muted-foreground, #737373);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[data-slot="listing-card-link"] {
|
|
61
|
-
display: block;
|
|
62
|
-
color: inherit;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[data-slot="listing-card-media"] {
|
|
68
|
-
position: relative;
|
|
69
|
-
width: 100%;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
background: var(--muted, #f5f5f4);
|
|
72
|
-
aspect-ratio: var(--garagem-listing-media-ratio);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
[data-slot="listing-card-media"] img {
|
|
76
|
-
height: 100%;
|
|
77
|
-
width: 100%;
|
|
78
|
-
object-fit: cover;
|
|
79
|
-
transition: transform 0.3s;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[data-slot="listing-card"]:hover [data-slot="listing-card-media"] img {
|
|
83
|
-
transform: scale(1.05);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (prefers-reduced-motion: reduce) {
|
|
87
|
-
[data-slot="listing-card-media"] img {
|
|
88
|
-
transition: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
[data-slot="listing-card"]:hover [data-slot="listing-card-media"] img {
|
|
92
|
-
transform: none;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[data-slot="listing-card-empty"] {
|
|
97
|
-
display: flex;
|
|
98
|
-
height: 100%;
|
|
99
|
-
width: 100%;
|
|
100
|
-
align-items: center;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
font-size: 0.75rem;
|
|
103
|
-
color: var(--muted-foreground, #737373);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
[data-slot="listing-card-cta"] {
|
|
107
|
-
margin-top: 0.75rem;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
[data-slot="listing-card-badge"] {
|
|
111
|
-
position: absolute;
|
|
112
|
-
left: 0.75rem;
|
|
113
|
-
top: 0.75rem;
|
|
114
|
-
border-radius: 999px;
|
|
115
|
-
background: color-mix(in srgb, var(--background, #fff) 90%, transparent);
|
|
116
|
-
padding: 0.25rem 0.5rem;
|
|
117
|
-
font-size: 0.75rem;
|
|
118
|
-
font-weight: 500;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
[data-slot="listing-card-body"] {
|
|
122
|
-
padding: 1rem;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
[data-slot="listing-card-title"] {
|
|
126
|
-
display: -webkit-box;
|
|
127
|
-
margin-top: 0.25rem;
|
|
128
|
-
overflow: hidden;
|
|
129
|
-
-webkit-box-orient: vertical;
|
|
130
|
-
-webkit-line-clamp: 1;
|
|
131
|
-
font-size: 0.875rem;
|
|
132
|
-
font-weight: 500;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
[data-slot="listing-card-location"] {
|
|
136
|
-
margin-top: 0.125rem;
|
|
137
|
-
overflow: hidden;
|
|
138
|
-
text-overflow: ellipsis;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
font-size: 0.75rem;
|
|
141
|
-
color: var(--muted-foreground, #737373);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
[data-slot="listing-card-features"] {
|
|
145
|
-
display: flex;
|
|
146
|
-
flex-wrap: wrap;
|
|
147
|
-
margin-top: 0.75rem;
|
|
148
|
-
gap: 0.25rem 1rem;
|
|
149
|
-
padding: 0;
|
|
150
|
-
list-style: none;
|
|
151
|
-
font-size: 0.75rem;
|
|
152
|
-
color: var(--muted-foreground, #737373);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
[data-slot="search-skeleton-block"] {
|
|
156
|
-
animation: garagem-search-pulse 1.2s ease-in-out infinite;
|
|
157
|
-
background: var(--garagem-skeleton);
|
|
158
|
-
border-radius: 0.375rem;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
[data-slot="search-skeleton-card"] {
|
|
162
|
-
overflow: hidden;
|
|
163
|
-
border-radius: var(--garagem-listing-card-radius);
|
|
164
|
-
border: 1px solid var(--border, #e4e4e7);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
[data-slot="search-skeleton-body"] {
|
|
168
|
-
display: flex;
|
|
169
|
-
flex-direction: column;
|
|
170
|
-
gap: 0.5rem;
|
|
171
|
-
padding: 1rem;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
[data-slot="search-skeleton-block"][data-kind="media"] {
|
|
175
|
-
aspect-ratio: var(--garagem-listing-media-ratio);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
[data-slot="search-skeleton-block"][data-kind="line-lg"] {
|
|
179
|
-
height: 1.25rem;
|
|
180
|
-
width: 50%;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
[data-slot="search-skeleton-block"][data-kind="line-md"] {
|
|
184
|
-
height: 1rem;
|
|
185
|
-
width: 75%;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
[data-slot="search-skeleton-block"][data-kind="line-sm"] {
|
|
189
|
-
height: 0.75rem;
|
|
190
|
-
width: 66.666667%;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
[data-slot="search-skeleton-block"][data-kind="detail-media"] {
|
|
194
|
-
max-width: 45rem;
|
|
195
|
-
aspect-ratio: 4 / 3;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
[data-slot="search-skeleton-block"][data-kind="detail-title"] {
|
|
199
|
-
width: 66.666667%;
|
|
200
|
-
height: 2rem;
|
|
201
|
-
margin-top: 1.5rem;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
@media (prefers-reduced-motion: reduce) {
|
|
205
|
-
[data-slot="search-skeleton-block"] {
|
|
206
|
-
animation: none;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@keyframes garagem-search-pulse {
|
|
211
|
-
50% {
|
|
212
|
-
opacity: 0.55;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SearchChromeStyles } from "./search-chrome-styles";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* Generated by scripts/build-search-chrome-css.mjs — do not edit. */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/* prettier-ignore */
|
|
4
|
-
export const SEARCH_CHROME_CSS_VERSION = "0.5.2";
|
|
5
|
-
export const SEARCH_CHROME_CSS = ":root{--garagem-listing-card-radius:0.75rem;--garagem-listing-card-gap:1.5rem;--garagem-listing-price-size:1.125rem;--garagem-listing-media-ratio:4 / 3;--garagem-skeleton:var(--muted,#e7e5e4)}[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{display:grid;grid-template-columns:1fr;gap:var(--garagem-listing-card-gap)}@media (min-width:640px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){[data-slot=\"search-grid\"],[data-slot=\"search-skeleton\"]{grid-template-columns:repeat(3,minmax(0,1fr))}}[data-slot=\"listing-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7);background:var(--card,var(--background,#fff))}[data-slot=\"listing-card-price-row\"]{display:inline-flex;align-items:baseline;gap:0.25rem}[data-slot=\"listing-card-price\"]{font-size:var(--garagem-listing-price-size);font-weight:600}[data-slot=\"listing-card-period\"]{font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-link\"]{display:block;color:inherit;text-decoration:none;cursor:pointer}[data-slot=\"listing-card-media\"]{position:relative;width:100%;overflow:hidden;background:var(--muted,#f5f5f4);aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"listing-card-media\"] img{height:100%;width:100%;object-fit:cover;transition:transform 0.3s}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:scale(1.05)}@media (prefers-reduced-motion:reduce){[data-slot=\"listing-card-media\"] img{transition:none}[data-slot=\"listing-card\"]:hover [data-slot=\"listing-card-media\"] img{transform:none}}[data-slot=\"listing-card-empty\"]{display:flex;height:100%;width:100%;align-items:center;justify-content:center;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-cta\"]{margin-top:0.75rem}[data-slot=\"listing-card-badge\"]{position:absolute;left:0.75rem;top:0.75rem;border-radius:999px;background:color-mix(in srgb,var(--background,#fff) 90%,transparent);padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500}[data-slot=\"listing-card-body\"]{padding:1rem}[data-slot=\"listing-card-title\"]{display:-webkit-box;margin-top:0.25rem;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;font-size:0.875rem;font-weight:500}[data-slot=\"listing-card-location\"]{margin-top:0.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"listing-card-features\"]{display:flex;flex-wrap:wrap;margin-top:0.75rem;gap:0.25rem 1rem;padding:0;list-style:none;font-size:0.75rem;color:var(--muted-foreground,#737373)}[data-slot=\"search-skeleton-block\"]{animation:garagem-search-pulse 1.2s ease-in-out infinite;background:var(--garagem-skeleton);border-radius:0.375rem}[data-slot=\"search-skeleton-card\"]{overflow:hidden;border-radius:var(--garagem-listing-card-radius);border:1px solid var(--border,#e4e4e7)}[data-slot=\"search-skeleton-body\"]{display:flex;flex-direction:column;gap:0.5rem;padding:1rem}[data-slot=\"search-skeleton-block\"][data-kind=\"media\"]{aspect-ratio:var(--garagem-listing-media-ratio)}[data-slot=\"search-skeleton-block\"][data-kind=\"line-lg\"]{height:1.25rem;width:50%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-md\"]{height:1rem;width:75%}[data-slot=\"search-skeleton-block\"][data-kind=\"line-sm\"]{height:0.75rem;width:66.666667%}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-media\"]{max-width:45rem;aspect-ratio:4 / 3}[data-slot=\"search-skeleton-block\"][data-kind=\"detail-title\"]{width:66.666667%;height:2rem;margin-top:1.5rem}@media (prefers-reduced-motion:reduce){[data-slot=\"search-skeleton-block\"]{animation:none}}@keyframes garagem-search-pulse{50%{opacity:0.55}}";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useLayoutEffect, type ReactElement } from "react";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
SEARCH_CHROME_CSS,
|
|
7
|
-
SEARCH_CHROME_CSS_VERSION,
|
|
8
|
-
} from "./search-chrome-css.generated";
|
|
9
|
-
|
|
10
|
-
const STYLE_ID = `garagem-search-chrome-${SEARCH_CHROME_CSS_VERSION}`;
|
|
11
|
-
|
|
12
|
-
/** Append once to document.head — never a React child (unmount must not remove it). */
|
|
13
|
-
function injectSearchChromeOnce(): void {
|
|
14
|
-
if (typeof document === "undefined") return;
|
|
15
|
-
if (document.getElementById(STYLE_ID)) return;
|
|
16
|
-
const el = document.createElement("style");
|
|
17
|
-
el.id = STYLE_ID;
|
|
18
|
-
el.textContent = SEARCH_CHROME_CSS;
|
|
19
|
-
document.head.appendChild(el);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function SearchChromeStyles(): ReactElement | null {
|
|
23
|
-
// Client render: inject before paint (Studio / v0 are client-heavy grids).
|
|
24
|
-
if (typeof document !== "undefined") {
|
|
25
|
-
injectSearchChromeOnce();
|
|
26
|
-
}
|
|
27
|
-
useLayoutEffect(() => {
|
|
28
|
-
injectSearchChromeOnce();
|
|
29
|
-
}, []);
|
|
30
|
-
return null;
|
|
31
|
-
}
|