react-listing-engine 0.6.3 → 0.6.5
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 +37 -40
- package/dist/{chunk-KLKVHYH3.js → chunk-CGT3RHJ7.js} +1 -1
- package/dist/{chunk-3FOG7ENO.cjs → chunk-RXHR66FS.cjs} +1 -1
- package/dist/{components-provider-CjMxkxrP.d.ts → components-provider-FinfaqUT.d.cts} +13 -2
- package/dist/{components-provider-CF0Mo0B8.d.cts → components-provider-cWVWEDXC.d.ts} +13 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +1 -1
- package/dist/{listing-app-DDKZ6Inn.d.ts → listing-app-BMoMKD4c.d.cts} +12 -11
- package/dist/{listing-app-D2UB9ru3.d.cts → listing-app-BSJKGh7k.d.ts} +12 -11
- package/dist/map-provider.interface-DT-v1plm.d.cts +67 -0
- package/dist/map-provider.interface-DT-v1plm.d.ts +67 -0
- package/dist/maps/google/index.d.cts +1 -2
- package/dist/maps/google/index.d.ts +1 -2
- package/dist/shadcn/index.cjs +1 -1
- package/dist/shadcn/index.d.cts +5 -7
- package/dist/shadcn/index.d.ts +5 -7
- package/dist/shadcn/index.js +1 -1
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.d.cts +3 -5
- package/dist/styled/index.d.ts +3 -5
- package/dist/styled/index.js +1 -1
- package/dist/styles.css +20 -7
- package/dist/testing/index.d.cts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/{url-sync.controller-DX67JivW.d.ts → url-sync.controller-DK5W_0OZ.d.ts} +1 -1
- package/dist/{url-sync.controller-CsU_QxoS.d.cts → url-sync.controller-DXSIWgTa.d.cts} +1 -1
- package/package.json +1 -6
- package/dist/chunk-5FBI2WIM.js +0 -2
- package/dist/chunk-6PZHSHU3.js +0 -2
- package/dist/chunk-CHNUE46K.cjs +0 -2
- package/dist/chunk-LCQZIWBO.cjs +0 -2
- package/dist/entity-adapter.interface-BDgbSxhq.d.cts +0 -33
- package/dist/entity-adapter.interface-BDgbSxhq.d.ts +0 -33
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.cts +0 -12
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.ts +0 -12
- package/dist/map-provider.interface-BMnwW3ob.d.cts +0 -37
- package/dist/map-provider.interface-BxexMT3X.d.ts +0 -37
- package/dist/presets/rental/index.cjs +0 -2
- package/dist/presets/rental/index.d.cts +0 -266
- package/dist/presets/rental/index.d.ts +0 -266
- package/dist/presets/rental/index.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as P}from"../../chunk-5FBI2WIM.js";import{a as h}from"../../chunk-6PZHSHU3.js";import{a as x}from"../../chunk-35KYEBAC.js";var Y=["grocery","shopping","restaurants","schools","hospitals","parks","gyms","cafes"];function _(e,t){let n=e.list;return{id:"businesses",adapter:{list:n?(r,o)=>n(r,o):async()=>({items:[],nextCursor:null}),getPoints:(r,o)=>e.search(r,o).then(s=>s.filter(i=>!t?.categories||t.categories.includes(i.category))).then(s=>s.map(i=>({id:i.id,position:i.coordinates,entity:i})))},marker:{iconUrl:r=>t?.icons?.[r.category]??"",onClick:t?.onClick},clustering:{maxZoom:15},visible:()=>!0}}import{jsx as C}from"react/jsx-runtime";function b({value:e,onChange:t}){return C("input",{type:"search",value:e,onChange:r=>{t(r.target.value)},"aria-label":"Keyword",placeholder:"Search keyword",className:"h-9 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})}import{useState as E}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";var k=["house","apartment","condo","townhouse","land"],N={house:"House",apartment:"Apartment",condo:"Condo",townhouse:"Townhouse",land:"Land"};function F({value:e,onChange:t}){let[n,r]=E(!1),o=i=>l=>{t(l.target.checked?[...e,i]:e.filter(c=>c!==i))};return u("details",{open:n,className:"group relative",children:[u("summary",{onClick:i=>{i.preventDefault(),r(l=>!l)},"aria-expanded":n,className:"flex h-9 w-fit cursor-pointer list-none items-center gap-1.5 rounded-md border border-border bg-background px-3 text-sm text-foreground motion-safe:transition-colors hover:bg-foreground/[0.06] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:["Property type",e.length>0&&m("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold tabular-nums text-primary-foreground",children:e.length}),m("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5 shrink-0 text-muted-foreground motion-safe:transition-transform group-open:rotate-180",children:m("path",{d:"m6 9 6 6 6-6"})})]}),u("fieldset",{className:"absolute z-10 mt-1.5 flex w-48 flex-col gap-1.5 rounded-md border border-border bg-popover p-3 text-popover-foreground shadow-md",children:[m("legend",{className:"sr-only",children:"Property type"}),k.map(i=>u("label",{className:"flex items-center gap-2 text-sm",children:[m("input",{type:"checkbox",checked:e.includes(i),onChange:o(i),className:"size-4 rounded border-border accent-primary"}),N[i]]},i))]})]})}import{jsx as g,jsxs as T}from"react/jsx-runtime";function R(e){if(e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t}function y({value:e,onChange:t}){let n=s=>{t({...e,min:R(s.target.value)})},r=s=>{t({...e,max:R(s.target.value)})},o="h-9 w-full rounded-md border border-border bg-background px-2 text-sm tabular-nums text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";return T("div",{className:"flex items-center gap-2",children:[g("input",{type:"number",inputMode:"numeric","aria-label":"Minimum",placeholder:"Min",value:e.min??"",onChange:n,className:o}),g("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"-"}),g("input",{type:"number",inputMode:"numeric","aria-label":"Maximum",placeholder:"Max",value:e.max??"",onChange:r,className:o})]})}import{Fragment as w,jsx as a,jsxs as d}from"react/jsx-runtime";function f(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function v(e){return e.length?`${e[0].toUpperCase()}${e.slice(1)}`:e}function J({item:e,selected:t,onSelect:n}){let r=e,o=h("flex w-full flex-col overflow-hidden rounded-[10px] border border-border bg-card text-left text-card-foreground","motion-safe:transition-shadow",n&&"hover:shadow-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"ring-2 ring-ring"),s=d(w,{children:[r?.imageUrl?a("img",{src:r.imageUrl,alt:r.title??"",className:"aspect-[4/3] w-full rounded-t-[10px] object-cover"}):a("div",{className:"aspect-[4/3] w-full rounded-t-[10px] bg-muted","aria-hidden":"true"}),d("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[r?.title&&a("span",{className:"text-base font-semibold",children:r.title}),r?.address&&a("span",{className:"text-sm text-muted-foreground",children:r.address}),r?.propertyType!=null&&r.bedrooms!=null&&r.bathrooms!=null&&d("span",{className:"text-sm text-muted-foreground",children:[v(r.propertyType)," \xB7 ",r.bedrooms," bd \xB7 ",r.bathrooms," ba"]}),r?.price!=null&&d("span",{className:"mt-1 font-bold tabular-nums",children:[f(r.price)," ",a("span",{className:"text-sm font-normal text-muted-foreground",children:"/mo"})]})]})]});return n?a("button",{type:"button",onClick:n,"aria-pressed":t??!1,className:o,children:s}):a("article",{className:o,children:s})}function ee({point:e}){let t=e.entity;return d("span",{className:"relative inline-flex items-center whitespace-nowrap rounded-full bg-primary px-2.5 py-1 text-xs font-bold tabular-nums text-primary-foreground shadow",children:[t?.price!=null?f(t.price):"",a("span",{"aria-hidden":"true",className:"absolute -bottom-[3px] left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 rounded-br-[2px] bg-primary"})]})}function S(e){let t=document.createElement("div");t.className="relative inline-flex items-center whitespace-nowrap rounded-full bg-primary px-2.5 py-1 text-xs font-bold text-primary-foreground shadow",t.textContent=f(e.price),t.style.position="relative",t.style.display="inline-flex",t.style.alignItems="center",t.style.whiteSpace="nowrap",t.style.borderRadius="9999px",t.style.backgroundColor="var(--primary, #16a34a)",t.style.color="var(--primary-foreground, #ffffff)",t.style.padding="4px 10px",t.style.fontSize="12px",t.style.fontWeight="700",t.style.fontFamily="inherit",t.style.boxShadow="0 1px 2px rgba(0, 0, 0, 0.3)";let n=document.createElement("span");return n.className="absolute -bottom-[3px] left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 rounded-br-[2px] bg-primary",n.style.position="absolute",n.style.left="50%",n.style.bottom="-3px",n.style.width="8px",n.style.height="8px",n.style.borderRadius="0 0 2px 0",n.style.backgroundColor="var(--primary, #16a34a)",n.style.transform="translateX(-50%) rotate(45deg)",t.appendChild(n),t}function ie(e,t){let n=e.getById;return{id:"properties",adapter:{list:(r,o)=>e.list(r,o),getPoints:(r,o)=>e.search(r,o).then(s=>s.map(i=>({id:i.id,position:i.coordinates,entity:i}))),getById:n?r=>n(r):void 0},marker:{iconUrl:t?.iconUrl,element:t?.element??S,onClick:t?.onClick},clustering:{maxZoom:14}}}var D={key:"price",order:10,label:"Price",render:y,toParams:e=>({minPrice:e.min,maxPrice:e.max}),fromParams:e=>({min:e.minPrice,max:e.maxPrice}),isActive:e=>e.minPrice!=null||e.maxPrice!=null},I={key:"beds",order:20,label:"Bedrooms",render:y,toParams:e=>({minBeds:e.min,maxBeds:e.max}),fromParams:e=>({min:e.minBeds,max:e.maxBeds}),isActive:e=>e.minBeds!=null||e.maxBeds!=null},M={key:"baths",order:30,label:"Bathrooms",render:y,toParams:e=>({minBaths:e.min,maxBaths:e.max}),fromParams:e=>({min:e.minBaths,max:e.maxBaths}),isActive:e=>e.minBaths!=null||e.maxBaths!=null},L={key:"propertyType",order:40,label:"Property type",render:F,toParams:e=>({propertyTypes:e.length?e:void 0}),fromParams:e=>e.propertyTypes??[],isActive:e=>(e.propertyTypes?.length??0)>0},O={key:"keyword",order:50,label:"Keyword",render:b,toParams:e=>({keyword:e||void 0}),fromParams:e=>e.keyword??"",isActive:e=>!!e.keyword},U=[D,I,M,L,O];function pe(){return e=>{U.forEach(t=>e.add(t))}}var A=["house","apartment","condo","townhouse","land"];function V(e){return A.includes(e)}function p(e){if(e===void 0||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t}function H(e){let t={};return e.minPrice!=null&&(t.minPrice=String(e.minPrice)),e.maxPrice!=null&&(t.maxPrice=String(e.maxPrice)),e.minBeds!=null&&(t.minBeds=String(e.minBeds)),e.maxBeds!=null&&(t.maxBeds=String(e.maxBeds)),e.minBaths!=null&&(t.minBaths=String(e.minBaths)),e.maxBaths!=null&&(t.maxBaths=String(e.maxBaths)),e.propertyTypes?.length&&(t.type=e.propertyTypes.join(",")),e.keyword&&(t.q=e.keyword),t}function Q(e){let t={},n=p(e.minPrice);n!==void 0&&(t.minPrice=n);let r=p(e.maxPrice);r!==void 0&&(t.maxPrice=r);let o=p(e.minBeds);o!==void 0&&(t.minBeds=o);let s=p(e.maxBeds);s!==void 0&&(t.maxBeds=s);let i=p(e.minBaths);i!==void 0&&(t.minBaths=i);let l=p(e.maxBaths);l!==void 0&&(t.maxBaths=l);let c=e.type?.split(",").map(B=>B.trim()).filter(V);return c?.length&&(t.propertyTypes=c),e.q&&(t.keyword=e.q),t}function ue(e={}){let t=e.history??new P({mode:e.mode});return new x({history:t,toQuery:H,toFilters:Q,hydrateOnStart:e.hydrateOnStart})}export{Y as KNOWN_BUSINESS_CATEGORIES,b as KeywordFilterControl,J as PropertyCard,ee as PropertyMarker,F as PropertyTypeFilterControl,y as RangeFilterControl,S as defaultPriceMarkerElement,f as formatRentalPrice,_ as nearbyBusinessesDataset,ie as propertiesDataset,U as rentalFilters,Q as rentalFiltersFromQuery,H as rentalFiltersToQuery,ue as rentalUrlSync,pe as withRentalFilters};
|