searchsmartly-ui 0.0.30 → 0.0.37

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +172 -8
  2. package/dist/index.esm.js +4 -4
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +4 -4
  5. package/dist/index.js.map +1 -1
  6. package/dist/src/components/ErrorBoundary/ErrorBoundary.d.ts +16 -0
  7. package/dist/src/components/ErrorBoundary/index.d.ts +1 -0
  8. package/dist/src/components/FilterButton/FilterButton.d.ts +10 -0
  9. package/dist/src/components/FilterButton/index.d.ts +1 -0
  10. package/dist/src/components/forms/LifestyleForm/LifestyleForm.d.ts +13 -0
  11. package/dist/src/components/forms/LifestyleForm/index.d.ts +1 -0
  12. package/dist/src/components/forms/PropertyTypeForm/PropertyTypeForm.d.ts +11 -0
  13. package/dist/src/components/forms/PropertyTypeForm/index.d.ts +1 -0
  14. package/dist/src/components/forms/RentBuyForm/RentBuyForm.d.ts +11 -0
  15. package/dist/src/components/forms/RentBuyForm/index.d.ts +1 -0
  16. package/dist/src/components/forms/index.d.ts +3 -0
  17. package/dist/src/components/icons/AmenityBeachIcon.d.ts +2 -0
  18. package/dist/src/components/icons/AmenityFitnessIcon.d.ts +2 -0
  19. package/dist/src/components/icons/AmenityGreenSpaceIcon.d.ts +2 -0
  20. package/dist/src/components/icons/AmenityPublicIcon.d.ts +2 -0
  21. package/dist/src/components/icons/AmenityRestaurantIcon.d.ts +2 -0
  22. package/dist/src/components/icons/AmenitySchoolsIcon.d.ts +2 -0
  23. package/dist/src/components/icons/AmenitySupermarketsIcon.d.ts +2 -0
  24. package/dist/src/components/icons/FiltersIcon.d.ts +2 -0
  25. package/dist/src/components/icons/index.d.ts +1 -0
  26. package/dist/src/components/index.d.ts +4 -0
  27. package/dist/src/components/list/ListHeader.d.ts +9 -3
  28. package/dist/src/components/list/PropertiesList/PropertiesList.d.ts +8 -3
  29. package/dist/src/components/list/PropertyCard.d.ts +2 -2
  30. package/dist/src/components/loader/Loader.d.ts +8 -0
  31. package/dist/src/components/loader/index.d.ts +1 -0
  32. package/dist/src/components/modals/FiltersModal/FiltersModal.d.ts +17 -0
  33. package/dist/src/components/modals/FiltersModal/FooterButtons.d.ts +9 -0
  34. package/dist/src/components/modals/FiltersModal/constants.d.ts +13 -0
  35. package/dist/src/components/modals/FiltersModal/index.d.ts +2 -0
  36. package/dist/src/components/modals/index.d.ts +2 -0
  37. package/dist/src/components/modals/modal/ModalContainer.d.ts +7 -0
  38. package/dist/src/components/modals/modal/index.d.ts +1 -0
  39. package/dist/src/components/modals/modal/provider/ModalBase.d.ts +14 -0
  40. package/dist/src/components/modals/modal/provider/ModalsProvider.d.ts +22 -0
  41. package/dist/src/components/modals/modal/provider/Transition.d.ts +5 -0
  42. package/dist/src/components/modals/modal/provider/index.d.ts +3 -0
  43. package/dist/src/components/modals/types.d.ts +9 -0
  44. package/dist/src/helpers/index.d.ts +3 -0
  45. package/dist/src/helpers/pluralize.d.ts +1 -0
  46. package/dist/src/hooks/index.d.ts +1 -0
  47. package/dist/src/hooks/useModal.d.ts +6 -0
  48. package/dist/src/index.d.ts +1 -0
  49. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -3,15 +3,16 @@ import * as _emotion_styled from '@emotion/styled';
3
3
  import * as _mui_system from '@mui/system';
4
4
  import { SxProps as SxProps$1 } from '@mui/system';
5
5
  import * as react from 'react';
6
- import { FC, PropsWithChildren, ReactElement, MouseEvent } from 'react';
6
+ import { FC, PropsWithChildren, ReactElement, MouseEvent, ReactNode, ComponentType, Component, ErrorInfo } from 'react';
7
7
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
8
8
  import * as _mui_material from '@mui/material';
9
- import { SxProps, Theme, BoxProps, StackProps, SvgIconProps } from '@mui/material';
9
+ import { SxProps, Theme, BoxProps, StackProps, SvgIconProps, ButtonProps } from '@mui/material';
10
10
  import { LazyLoadImageProps } from 'react-lazy-load-image-component';
11
11
  import { LazyLoadTypes } from 'react-slick';
12
12
  import { ChipProps } from '@mui/material/Chip/Chip';
13
13
  import * as react_jsx_runtime from 'react/jsx-runtime';
14
14
  import { Theme as Theme$1 } from '@mui/material/styles';
15
+ import { TransitionProps } from '@mui/material/transitions';
15
16
  import { ThemeProviderProps } from '@mui/material/styles/ThemeProvider';
16
17
 
17
18
  declare const Button: _emotion_styled.StyledComponent<_mui_material.ButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
@@ -122,19 +123,24 @@ type PropertyItemType = {
122
123
 
123
124
  type ListProps<T extends PropertyItemType> = {
124
125
  title: string;
125
- currency?: string;
126
+ totalCount?: number;
126
127
  defaultPropertyCard?: boolean;
127
128
  properties: T[];
129
+ badgeContent?: ReactNode;
128
130
  children?: ({ property }: {
129
131
  property: T;
130
132
  }) => ReactElement;
133
+ renderItem?: ({ property }: {
134
+ property: T;
135
+ }, index: number) => ReactElement;
131
136
  cardHeader?: (val: T) => void;
132
137
  disableCarousel?: boolean;
133
138
  loadMoreLoading?: boolean;
134
139
  onLoadMore?: () => void;
135
140
  onClickMapButton?: () => void;
141
+ onClickFilters?: () => void;
136
142
  };
137
- declare const PropertiesList: <T extends PropertyItemType>({ currency, title, properties, defaultPropertyCard, disableCarousel, cardHeader, loadMoreLoading, onLoadMore, onClickMapButton, children, }: ListProps<T>) => react_jsx_runtime.JSX.Element;
143
+ declare const PropertiesList: <T extends PropertyItemType>({ title, badgeContent, properties, loadMoreLoading, onLoadMore, totalCount, onClickMapButton, renderItem, onClickFilters, }: ListProps<T>) => react_jsx_runtime.JSX.Element;
138
144
 
139
145
  type PropertyCardType<T extends PropertyItemType> = Omit<BoxProps, 'property'> & {
140
146
  id?: string;
@@ -144,13 +150,18 @@ type PropertyCardType<T extends PropertyItemType> = Omit<BoxProps, 'property'> &
144
150
  tagColor?: ChipProps['color'];
145
151
  property: T;
146
152
  children?: ReactElement | ReactElement[];
147
- header?: (val: T) => void;
153
+ header?: ReactElement;
148
154
  };
149
155
  declare const PropertyCard: <T extends PropertyItemType>({ property, currency, id, disableCarousel, isPopover, children, header, tagColor, sx, }: PropertyCardType<T>) => react_jsx_runtime.JSX.Element;
150
156
 
151
- declare const ListHeader: FC<{
157
+ type ListHeaderProps = {
152
158
  title: string;
153
- }>;
159
+ totalCount?: number;
160
+ small?: boolean;
161
+ badgeContent?: ReactNode;
162
+ onClickFilters?: () => void;
163
+ };
164
+ declare const ListHeader: FC<ListHeaderProps>;
154
165
 
155
166
  declare const Powered: FC<StackProps>;
156
167
 
@@ -173,6 +184,40 @@ type BudgetFormProps = {
173
184
  declare const formatPrice: (price: string | number) => string;
174
185
  declare const BudgetForm: FC<BudgetFormProps>;
175
186
 
187
+ type RentBuyFormProps = {
188
+ selected?: string;
189
+ options?: {
190
+ label: string;
191
+ value: string;
192
+ }[];
193
+ title?: string;
194
+ onChange: (val: string) => void;
195
+ };
196
+ declare const RentBuyForm: FC<RentBuyFormProps>;
197
+
198
+ type PropertyTypeFormProps = {
199
+ selected?: string[];
200
+ options?: {
201
+ label: string;
202
+ value: string;
203
+ }[];
204
+ title?: string;
205
+ onChange: (val: (string | undefined)[]) => void;
206
+ };
207
+ declare const PropertyTypeForm: FC<PropertyTypeFormProps>;
208
+
209
+ type LifestyleFormProps = {
210
+ selected?: (string | undefined)[];
211
+ options?: {
212
+ label: string;
213
+ value: string;
214
+ icon: ComponentType<SvgIconProps>;
215
+ }[];
216
+ title?: string;
217
+ onChange: (val: (string | undefined)[]) => void;
218
+ };
219
+ declare const LifestyleForm: FC<LifestyleFormProps>;
220
+
176
221
  declare const StarIcon: ({ sx, ...props }: SvgIconProps) => react_jsx_runtime.JSX.Element;
177
222
 
178
223
  declare const ParksIcon: ({ sx, ...props }: SvgIconProps) => react_jsx_runtime.JSX.Element;
@@ -193,12 +238,131 @@ declare const BedIcon: ({ sx, ...props }: SvgIconProps) => react_jsx_runtime.JSX
193
238
 
194
239
  declare const SearchsmartlyLogo: () => react_jsx_runtime.JSX.Element;
195
240
 
241
+ declare const FiltersIcon: ({ ...props }: SvgIconProps) => react_jsx_runtime.JSX.Element;
242
+
243
+ type FilterButtonProps = {
244
+ small?: boolean;
245
+ badgeContent?: ReactNode;
246
+ onClick?: () => void;
247
+ } & ButtonProps;
248
+ declare const FilterButton: FC<FilterButtonProps>;
249
+
250
+ type ModalsProps = {
251
+ payload?: Record<any, any> | undefined;
252
+ DialogProps: {
253
+ open: boolean;
254
+ [key: string]: any;
255
+ };
256
+ handleModalReject?: (val?: any) => void;
257
+ handleModalResolve: (val?: any) => void;
258
+ };
259
+
260
+ interface FormProps {
261
+ filters: Record<string, unknown>;
262
+ onSubmit: (val?: Record<string, unknown> | undefined) => void;
263
+ children: (props: {
264
+ onSubmit: (val?: Record<string, unknown> | undefined) => void;
265
+ }) => ReactNode;
266
+ }
267
+ interface FiltersModalProps extends ModalsProps {
268
+ payload: {
269
+ Form: FC<FormProps>;
270
+ filters: Record<string, unknown>;
271
+ };
272
+ }
273
+ declare const FiltersModal: FC<FiltersModalProps>;
274
+
275
+ interface FooterButtonsInterface {
276
+ isValid?: boolean;
277
+ isSubmitting?: boolean;
278
+ count?: number;
279
+ onSubmit: () => void;
280
+ }
281
+ declare const FooterButtons: FC<FooterButtonsInterface>;
282
+
283
+ interface ModalsContextProps {
284
+ globalValues: any;
285
+ modals: any[];
286
+ setGlobalValues: (val: any) => void;
287
+ deleteModal: (val: any[]) => void;
288
+ addModal: (val: {
289
+ [p: string]: any;
290
+ ModalComponent: any;
291
+ }) => void;
292
+ openModal: (val: {
293
+ [p: string]: any;
294
+ ModalComponent: any;
295
+ }) => void;
296
+ }
297
+ declare const ModalsContext: react.Context<ModalsContextProps>;
298
+ type ModalsProviderProps = {
299
+ children: ReactNode;
300
+ pathname?: string;
301
+ };
302
+ declare const ModalsProvider: ({ pathname, children }: ModalsProviderProps) => react_jsx_runtime.JSX.Element;
303
+
304
+ type ModalBaseProps = {
305
+ modalID: number;
306
+ open?: boolean;
307
+ payload?: Record<string, any>;
308
+ DialogProps?: Record<string, any>;
309
+ ModalComponent: any;
310
+ onModalResolved: (val: any) => void;
311
+ onModalRejected: (val: any) => void;
312
+ onModalExited: (val: any) => void;
313
+ [key: string]: any;
314
+ };
315
+ declare const ModalBase: FC<ModalBaseProps>;
316
+
317
+ declare const Transition: react.ForwardRefExoticComponent<TransitionProps & {
318
+ children: ReactElement<any, any>;
319
+ } & react.RefAttributes<unknown>>;
320
+
321
+ type LoaderProps = {
322
+ loading?: boolean;
323
+ color?: string;
324
+ render: () => ReactNode;
325
+ };
326
+ declare const Loader: FC<LoaderProps>;
327
+
328
+ interface Props {
329
+ children?: ReactNode;
330
+ }
331
+ interface State {
332
+ hasError: boolean;
333
+ }
334
+ declare class ErrorBoundary extends Component<Props, State> {
335
+ constructor(props: any);
336
+ static getDerivedStateFromError(_: Error): {
337
+ hasError: boolean;
338
+ };
339
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
340
+ render(): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
341
+ }
342
+
196
343
  declare const useResponsive: () => {
197
344
  isMobile: boolean;
198
345
  isTablet: boolean;
199
346
  isDesktop: boolean;
200
347
  };
201
348
 
349
+ declare const useModal: () => {
350
+ openModal: (ModalComponent: ComponentType<ModalsProps>, props?: Record<string, any>) => void;
351
+ openSingleModal: (ModalComponent: ComponentType<ModalsProps>, props?: Record<string, any>) => void;
352
+ };
353
+
202
354
  declare const ThemeProvider: FC<ThemeProviderProps>;
203
355
 
204
- export { AmenityTags, BaseLayout, BeachesIcon, BedIcon, BedroomsForm, BudgetForm, BusIcon, Button, CardImage, EmptyDefaultImage, GymIcon, LazyLoadImage, ListHeader, Onboarding, OnboardingStepLayout, ParksIcon, Powered, PropertiesList, PropertyCard, type PropertyCardType, PropertyTag, RestaurantsIcon, SchoolsIcon, SearchsmartlyLogo, ShopIcon, SlickCarousel, StarIcon, Tag, type TagProps, ThemeProvider, amenityTagConfig, formatPrice, getAmenityTags, thresholds, useResponsive };
356
+ declare const pluralize: (count: number, noun: string, suffix?: string) => string;
357
+
358
+ declare const currencyFormatterProperty: (price: number, currency?: string) => string;
359
+
360
+ declare const renderPlural: (word: string, number: number) => string;
361
+ declare const getBedroomsText: ({ bedrooms, isShared, disablePlural, isShort }: {
362
+ bedrooms?: number | undefined;
363
+ isShared?: boolean | undefined;
364
+ disablePlural?: boolean | undefined;
365
+ isShort?: boolean | undefined;
366
+ }) => string;
367
+
368
+ export { AmenityTags, BaseLayout, BeachesIcon, BedIcon, BedroomsForm, BudgetForm, BusIcon, Button, CardImage, EmptyDefaultImage, ErrorBoundary, FilterButton, FiltersIcon, FiltersModal, FooterButtons, GymIcon, LazyLoadImage, LifestyleForm, type LifestyleFormProps, ListHeader, Loader, ModalBase, ModalsContext, ModalsProvider, Onboarding, OnboardingStepLayout, ParksIcon, Powered, PropertiesList, PropertyCard, type PropertyCardType, PropertyTag, PropertyTypeForm, type PropertyTypeFormProps, RentBuyForm, type RentBuyFormProps, RestaurantsIcon, SchoolsIcon, SearchsmartlyLogo, ShopIcon, SlickCarousel, StarIcon, Tag, type TagProps, ThemeProvider, Transition, amenityTagConfig, currencyFormatterProperty, formatPrice, getAmenityTags, getBedroomsText, pluralize, renderPlural, thresholds, useModal, useResponsive };