@garagem-ai/site-sdk 0.4.13 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -32
- package/dist/index.d.mts +20 -17
- package/dist/index.d.ts +20 -17
- package/dist/index.js +91 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -18
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -98
- package/dist/react.d.ts +2 -98
- package/dist/react.js +11 -957
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +11 -955
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-1O4sKtKb.d.mts → search-engine-4ocM0UPk.d.mts} +16 -1
- package/dist/{search-engine-1O4sKtKb.d.ts → search-engine-4ocM0UPk.d.ts} +16 -1
- package/package.json +2 -2
- package/src/index.ts +5 -0
- package/src/react/index.ts +1 -13
- package/src/react/search-chrome.tsx +0 -48
- package/src/react/search.css +2 -499
- package/src/react/styles/search-chrome-css.generated.ts +2 -2
- package/src/react/types.ts +0 -32
- package/src/search-engine.ts +47 -1
- package/src/studio-contract.ts +57 -20
- package/src/react/filter-panel.tsx +0 -248
- package/src/react/icons.tsx +0 -46
- package/src/react/search-page.tsx +0 -475
- package/src/react/search-pagination.tsx +0 -120
- package/src/react/search-query-form.tsx +0 -81
package/dist/react.d.mts
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
-
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary
|
|
2
|
+
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary } from './search-engine-4ocM0UPk.mjs';
|
|
3
3
|
|
|
4
|
-
type SearchPageVariant = "toolbar" | "dialog" | "sidebar";
|
|
5
|
-
type SearchPageClassNames = {
|
|
6
|
-
root?: string;
|
|
7
|
-
header?: string;
|
|
8
|
-
heading?: string;
|
|
9
|
-
headingCount?: string;
|
|
10
|
-
headingTitle?: string;
|
|
11
|
-
toolbar?: string;
|
|
12
|
-
toolbarTrigger?: string;
|
|
13
|
-
popover?: string;
|
|
14
|
-
query?: string;
|
|
15
|
-
sort?: string;
|
|
16
|
-
icon?: string;
|
|
17
|
-
sidebar?: string;
|
|
18
|
-
dialog?: string;
|
|
19
|
-
dialogOverlay?: string;
|
|
20
|
-
dialogPanel?: string;
|
|
21
|
-
grid?: string;
|
|
22
|
-
card?: string;
|
|
23
|
-
pagination?: string;
|
|
24
|
-
applyBar?: string;
|
|
25
|
-
skeleton?: string;
|
|
26
|
-
empty?: string;
|
|
27
|
-
checkbox?: string;
|
|
28
|
-
};
|
|
29
|
-
type SearchPageIcons = {
|
|
30
|
-
search?: ReactNode;
|
|
31
|
-
clear?: ReactNode;
|
|
32
|
-
};
|
|
33
4
|
type ListingCardClassNames = {
|
|
34
5
|
root?: string;
|
|
35
6
|
media?: string;
|
|
@@ -114,79 +85,12 @@ type ListingDetailFieldsProps = {
|
|
|
114
85
|
*/
|
|
115
86
|
declare function ListingDetailFields({ listing, dictionary, className, classNames, style, }: ListingDetailFieldsProps): ReactElement | null;
|
|
116
87
|
|
|
117
|
-
type SearchPageProps = {
|
|
118
|
-
siteId: SiteIdInput;
|
|
119
|
-
baseUrl?: string;
|
|
120
|
-
variant?: SearchPageVariant;
|
|
121
|
-
/** Landmark element. Studio search pages pass `"div"` so the route owns `<main>`. */
|
|
122
|
-
as?: "main" | "div";
|
|
123
|
-
className?: string;
|
|
124
|
-
classNames?: SearchPageClassNames;
|
|
125
|
-
heading?: ReactNode;
|
|
126
|
-
icons?: SearchPageIcons;
|
|
127
|
-
listingCard?: typeof ListingCard;
|
|
128
|
-
};
|
|
129
|
-
declare function SearchPage({ siteId, baseUrl, variant, as: Root, className, classNames, heading, icons, listingCard: Card, }: SearchPageProps): ReactElement;
|
|
130
|
-
|
|
131
88
|
declare function SearchChromeStyles(): ReactElement | null;
|
|
132
89
|
|
|
133
|
-
type SearchPaginationProps = {
|
|
134
|
-
page: number;
|
|
135
|
-
totalPages: number;
|
|
136
|
-
hrefForPage: (page: number) => string;
|
|
137
|
-
onNavigate?: (href: string) => void;
|
|
138
|
-
className?: string;
|
|
139
|
-
};
|
|
140
|
-
declare function SearchPagination({ page, totalPages, hrefForPage, onNavigate, className, }: SearchPaginationProps): ReactElement | null;
|
|
141
|
-
|
|
142
|
-
type SearchQueryFormProps = {
|
|
143
|
-
value: string;
|
|
144
|
-
onChange: (value: string) => void;
|
|
145
|
-
onSubmit: () => void;
|
|
146
|
-
onClear: () => void;
|
|
147
|
-
className?: string;
|
|
148
|
-
iconClassName?: string;
|
|
149
|
-
searchIcon?: ReactNode;
|
|
150
|
-
clearIcon?: ReactNode;
|
|
151
|
-
};
|
|
152
|
-
declare function SearchQueryForm({ value, onChange, onSubmit, onClear, className, iconClassName, searchIcon, clearIcon, }: SearchQueryFormProps): ReactElement;
|
|
153
|
-
|
|
154
|
-
type RangeCommitSource = "blur" | "enter" | "apply";
|
|
155
|
-
type FilterPanelProps = {
|
|
156
|
-
filters: SearchUiFilter[];
|
|
157
|
-
pathFilters: SearchPathFilters;
|
|
158
|
-
onChange: (filterId: string, value: unknown) => void;
|
|
159
|
-
rangeDraft: Record<string, {
|
|
160
|
-
min: string;
|
|
161
|
-
max: string;
|
|
162
|
-
}>;
|
|
163
|
-
onRangePatch: (filterId: string, side: "min" | "max", value: string) => void;
|
|
164
|
-
onRangeCommit: (filterId: string, source?: RangeCommitSource) => void;
|
|
165
|
-
};
|
|
166
|
-
declare function FilterPanel({ filters, pathFilters, onChange, rangeDraft, onRangePatch, onRangeCommit, }: FilterPanelProps): ReactElement;
|
|
167
|
-
declare function rangeDraftFromPath(pathFilters: SearchPathFilters): Record<string, {
|
|
168
|
-
min: string;
|
|
169
|
-
max: string;
|
|
170
|
-
}>;
|
|
171
|
-
|
|
172
|
-
type SearchSortSelectProps = {
|
|
173
|
-
value: string;
|
|
174
|
-
onChange: (sort: string | null) => void;
|
|
175
|
-
sorts?: Array<{
|
|
176
|
-
id: string;
|
|
177
|
-
label: string;
|
|
178
|
-
}>;
|
|
179
|
-
className?: string;
|
|
180
|
-
};
|
|
181
|
-
declare function SearchSortSelect({ value, onChange, sorts, className, }: SearchSortSelectProps): ReactElement;
|
|
182
90
|
declare function ResultsSkeleton({ className, }: {
|
|
183
91
|
className?: string;
|
|
184
92
|
}): ReactElement;
|
|
185
|
-
declare function SearchPageFallback({ className, as: Root, }: {
|
|
186
|
-
className?: string;
|
|
187
|
-
as?: "main" | "div";
|
|
188
|
-
}): ReactElement;
|
|
189
93
|
|
|
190
94
|
declare function usePublicSearch(options: UsePublicSearchOptions): PublicSearchState;
|
|
191
95
|
|
|
192
|
-
export {
|
|
96
|
+
export { ListingCard, type ListingCardClassNames, type ListingCardProps, type ListingCardSlots, ListingDetailFields, type ListingDetailFieldsClassNames, type ListingDetailFieldsProps, type PublicSearchState, ResultsSkeleton, SearchChromeStyles, type SiteIdInput, type UsePublicSearchOptions, usePublicSearch };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
-
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary
|
|
2
|
+
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary } from './search-engine-4ocM0UPk.js';
|
|
3
3
|
|
|
4
|
-
type SearchPageVariant = "toolbar" | "dialog" | "sidebar";
|
|
5
|
-
type SearchPageClassNames = {
|
|
6
|
-
root?: string;
|
|
7
|
-
header?: string;
|
|
8
|
-
heading?: string;
|
|
9
|
-
headingCount?: string;
|
|
10
|
-
headingTitle?: string;
|
|
11
|
-
toolbar?: string;
|
|
12
|
-
toolbarTrigger?: string;
|
|
13
|
-
popover?: string;
|
|
14
|
-
query?: string;
|
|
15
|
-
sort?: string;
|
|
16
|
-
icon?: string;
|
|
17
|
-
sidebar?: string;
|
|
18
|
-
dialog?: string;
|
|
19
|
-
dialogOverlay?: string;
|
|
20
|
-
dialogPanel?: string;
|
|
21
|
-
grid?: string;
|
|
22
|
-
card?: string;
|
|
23
|
-
pagination?: string;
|
|
24
|
-
applyBar?: string;
|
|
25
|
-
skeleton?: string;
|
|
26
|
-
empty?: string;
|
|
27
|
-
checkbox?: string;
|
|
28
|
-
};
|
|
29
|
-
type SearchPageIcons = {
|
|
30
|
-
search?: ReactNode;
|
|
31
|
-
clear?: ReactNode;
|
|
32
|
-
};
|
|
33
4
|
type ListingCardClassNames = {
|
|
34
5
|
root?: string;
|
|
35
6
|
media?: string;
|
|
@@ -114,79 +85,12 @@ type ListingDetailFieldsProps = {
|
|
|
114
85
|
*/
|
|
115
86
|
declare function ListingDetailFields({ listing, dictionary, className, classNames, style, }: ListingDetailFieldsProps): ReactElement | null;
|
|
116
87
|
|
|
117
|
-
type SearchPageProps = {
|
|
118
|
-
siteId: SiteIdInput;
|
|
119
|
-
baseUrl?: string;
|
|
120
|
-
variant?: SearchPageVariant;
|
|
121
|
-
/** Landmark element. Studio search pages pass `"div"` so the route owns `<main>`. */
|
|
122
|
-
as?: "main" | "div";
|
|
123
|
-
className?: string;
|
|
124
|
-
classNames?: SearchPageClassNames;
|
|
125
|
-
heading?: ReactNode;
|
|
126
|
-
icons?: SearchPageIcons;
|
|
127
|
-
listingCard?: typeof ListingCard;
|
|
128
|
-
};
|
|
129
|
-
declare function SearchPage({ siteId, baseUrl, variant, as: Root, className, classNames, heading, icons, listingCard: Card, }: SearchPageProps): ReactElement;
|
|
130
|
-
|
|
131
88
|
declare function SearchChromeStyles(): ReactElement | null;
|
|
132
89
|
|
|
133
|
-
type SearchPaginationProps = {
|
|
134
|
-
page: number;
|
|
135
|
-
totalPages: number;
|
|
136
|
-
hrefForPage: (page: number) => string;
|
|
137
|
-
onNavigate?: (href: string) => void;
|
|
138
|
-
className?: string;
|
|
139
|
-
};
|
|
140
|
-
declare function SearchPagination({ page, totalPages, hrefForPage, onNavigate, className, }: SearchPaginationProps): ReactElement | null;
|
|
141
|
-
|
|
142
|
-
type SearchQueryFormProps = {
|
|
143
|
-
value: string;
|
|
144
|
-
onChange: (value: string) => void;
|
|
145
|
-
onSubmit: () => void;
|
|
146
|
-
onClear: () => void;
|
|
147
|
-
className?: string;
|
|
148
|
-
iconClassName?: string;
|
|
149
|
-
searchIcon?: ReactNode;
|
|
150
|
-
clearIcon?: ReactNode;
|
|
151
|
-
};
|
|
152
|
-
declare function SearchQueryForm({ value, onChange, onSubmit, onClear, className, iconClassName, searchIcon, clearIcon, }: SearchQueryFormProps): ReactElement;
|
|
153
|
-
|
|
154
|
-
type RangeCommitSource = "blur" | "enter" | "apply";
|
|
155
|
-
type FilterPanelProps = {
|
|
156
|
-
filters: SearchUiFilter[];
|
|
157
|
-
pathFilters: SearchPathFilters;
|
|
158
|
-
onChange: (filterId: string, value: unknown) => void;
|
|
159
|
-
rangeDraft: Record<string, {
|
|
160
|
-
min: string;
|
|
161
|
-
max: string;
|
|
162
|
-
}>;
|
|
163
|
-
onRangePatch: (filterId: string, side: "min" | "max", value: string) => void;
|
|
164
|
-
onRangeCommit: (filterId: string, source?: RangeCommitSource) => void;
|
|
165
|
-
};
|
|
166
|
-
declare function FilterPanel({ filters, pathFilters, onChange, rangeDraft, onRangePatch, onRangeCommit, }: FilterPanelProps): ReactElement;
|
|
167
|
-
declare function rangeDraftFromPath(pathFilters: SearchPathFilters): Record<string, {
|
|
168
|
-
min: string;
|
|
169
|
-
max: string;
|
|
170
|
-
}>;
|
|
171
|
-
|
|
172
|
-
type SearchSortSelectProps = {
|
|
173
|
-
value: string;
|
|
174
|
-
onChange: (sort: string | null) => void;
|
|
175
|
-
sorts?: Array<{
|
|
176
|
-
id: string;
|
|
177
|
-
label: string;
|
|
178
|
-
}>;
|
|
179
|
-
className?: string;
|
|
180
|
-
};
|
|
181
|
-
declare function SearchSortSelect({ value, onChange, sorts, className, }: SearchSortSelectProps): ReactElement;
|
|
182
90
|
declare function ResultsSkeleton({ className, }: {
|
|
183
91
|
className?: string;
|
|
184
92
|
}): ReactElement;
|
|
185
|
-
declare function SearchPageFallback({ className, as: Root, }: {
|
|
186
|
-
className?: string;
|
|
187
|
-
as?: "main" | "div";
|
|
188
|
-
}): ReactElement;
|
|
189
93
|
|
|
190
94
|
declare function usePublicSearch(options: UsePublicSearchOptions): PublicSearchState;
|
|
191
95
|
|
|
192
|
-
export {
|
|
96
|
+
export { ListingCard, type ListingCardClassNames, type ListingCardProps, type ListingCardSlots, ListingDetailFields, type ListingDetailFieldsClassNames, type ListingDetailFieldsProps, type PublicSearchState, ResultsSkeleton, SearchChromeStyles, type SiteIdInput, type UsePublicSearchOptions, usePublicSearch };
|