diff --git a/messages/es.json b/messages/es.json index 317dac0..b9e6eba 100644 --- a/messages/es.json +++ b/messages/es.json @@ -27,5 +27,5 @@ "place-components.label.postalCode": "Código Postal", "place-components.label.dontKnowPostalCode": "No conozco mi código postal", "place-components.label.autocompleteAddress": "Dirección y número", - "place-components.label.autocompleteAddressFail": "No se han encontrado resultados" + "place-components.label.autocompleteAddressFail": "Sin resultados" } diff --git a/react/LocationSearch.css b/react/LocationSearch.css deleted file mode 100644 index 207b140..0000000 --- a/react/LocationSearch.css +++ /dev/null @@ -1,3 +0,0 @@ -.locationSearch { - max-width: 18rem; -} diff --git a/react/LocationSearch.tsx b/react/LocationSearch.tsx index eeacad8..994e006 100644 --- a/react/LocationSearch.tsx +++ b/react/LocationSearch.tsx @@ -1,37 +1,61 @@ -import React, { useState, useMemo } from 'react' +import React, { useState, useMemo, useRef } from 'react' import { FormattedMessage } from 'react-intl' -import { Input, IconSearch, IconClear } from 'vtex.styleguide' +import { Input, IconSearch, IconClear, IconWarning } from 'vtex.styleguide' +import { positionMatchWidth } from '@reach/popover' + import { Combobox, ComboboxInput, ComboboxOption, ComboboxPopover, ComboboxList, -} from '@reach/combobox' -import '@reach/combobox/styles.css' +} from './components/Combobox' +import PlaceIcon from './components/PlaceIcon' -import { addresses as mockedAddresses } from './addresses' -import styles from './LocationSearch.css' +interface Interval { + offset: number + size: number +} -const MAX_DROPDOWN_ADDRESSES = 6 +export interface Suggestion { + description: string + mainText: string + mainTextMatchInterval: Interval + secondaryText: string +} -// This function will be replaced in the future, after integrating the -// component with GraphQL queries. -const getAddresses = (searchTerm: string) => { - return mockedAddresses - .filter((address: string) => - address.toLocaleLowerCase().includes(searchTerm.toLocaleLowerCase()) - ) - .slice(0, MAX_DROPDOWN_ADDRESSES) +const renderSuggestionText = (suggestion: Suggestion) => { + const { mainText } = suggestion + const { offset, size } = suggestion.mainTextMatchInterval + return ( +
+ + {mainText.substr(0, offset)} + {mainText.substr(offset, size)} + {mainText.substr(size + offset)} + {' '} + {suggestion.secondaryText} +
+ ) } interface LocationSearchProps { + getAddresses: (searchTerm: string) => Suggestion[] onSelectAddress?: (selectedAddress: string) => void + renderEngineLogo?: () => React.ReactNode } -const LocationSearch: React.FC = ({ onSelectAddress }) => { +const LocationSearch: React.FC = ({ + getAddresses, + onSelectAddress, + renderEngineLogo, +}) => { const [searchTerm, setSearchTerm] = useState('') - const addresses = useMemo(() => getAddresses(searchTerm), [searchTerm]) + const addresses = useMemo(() => getAddresses(searchTerm), [ + getAddresses, + searchTerm, + ]) + const inputWrapperRef = useRef(null) const handleKeyDown = (event: React.KeyboardEvent) => { if (event.key !== 'Escape') { @@ -46,48 +70,76 @@ const LocationSearch: React.FC = ({ onSelectAddress }) => { } return ( -
+
- - } - prefix={ -
- -
- } - suffix={ - searchTerm.trim().length && ( - setSearchTerm('')} - onKeyPress={() => {}} - > - - +
+ + } + prefix={ +
+ +
+ } + suffix={ + searchTerm.trim().length && ( + setSearchTerm('')} + onKeyPress={() => {}} + > + + + ) + } + value={searchTerm} + onChange={(event: React.ChangeEvent) => + setSearchTerm(event.target.value) + } + onKeyDown={handleKeyDown} + /> +
+ + positionMatchWidth( + inputWrapperRef.current?.getBoundingClientRect(), + popoverRect ) } - value={searchTerm} - onChange={(event: React.ChangeEvent) => - setSearchTerm(event.target.value) - } - onKeyDown={handleKeyDown} - /> - + > {addresses.length > 0 ? ( - - {addresses.map((address, index) => ( - - ))} - + <> + + {addresses.map((address, index) => ( + + + {renderSuggestionText(address)} + + ))} + + {renderEngineLogo && ( +
+
{renderEngineLogo()}
+
+ )} + ) : ( - +
+
+ +
+
+ +
+
)}
diff --git a/react/addresses.tsx b/react/addresses.tsx deleted file mode 100644 index e1406e6..0000000 --- a/react/addresses.tsx +++ /dev/null @@ -1,1002 +0,0 @@ -export const addresses: string[] = [ - '9 Twin Pines Point', - '93800 Eggendart Center', - '17 Warrior Drive', - '5400 Buhler Junction', - '0637 Toban Drive', - '368 Northfield Avenue', - '988 Elka Avenue', - '767 Banding Road', - '02771 Gulseth Junction', - '7934 Division Point', - '6 Susan Plaza', - '53176 Duke Circle', - '596 Farragut Alley', - '0180 Briar Crest Park', - '447 Green Ridge Way', - '26 Kensington Point', - '89 Warner Parkway', - '62 Bluejay Avenue', - '4852 Redwing Hill', - '41 Pankratz Parkway', - '37014 Bartelt Center', - '05 Butternut Drive', - '4275 Carioca Lane', - '292 Arkansas Hill', - '5 7th Junction', - '749 Amoth Center', - '836 Hoepker Plaza', - '982 Elmside Crossing', - '58 Cambridge Court', - '26 Buell Terrace', - '83 Shasta Crossing', - '4 Shasta Trail', - '48 Hauk Way', - '68845 Superior Point', - '7 Atwood Parkway', - '0269 South Lane', - '362 Upham Place', - '439 Manitowish Center', - '5677 Melody Court', - '08 Fairfield Junction', - '904 Maryland Street', - '94287 Dawn Avenue', - '84 Debs Lane', - '4446 Forest Court', - '7585 Sheridan Alley', - '8 Maple Alley', - '6 Moland Place', - '8589 Oxford Pass', - '9 Westend Place', - '4952 Larry Place', - '08199 5th Court', - '73855 Acker Hill', - '29 Mariners Cove Center', - '7666 Fieldstone Alley', - '058 Myrtle Trail', - '12 Lien Hill', - '85223 Stephen Park', - '905 Mayfield Parkway', - '553 Armistice Trail', - '36236 Jenna Way', - '497 Farragut Plaza', - '02770 Victoria Junction', - '653 Sunfield Pass', - '5 Continental Park', - '4 Bartillon Point', - '29435 Lake View Terrace', - '98 Saint Paul Plaza', - '21591 Superior Parkway', - '11327 Ridgeway Trail', - '35 Scoville Point', - '2 Anthes Crossing', - '335 2nd Way', - '842 Laurel Circle', - '43592 Aberg Alley', - '957 Montana Parkway', - '2739 Main Center', - '220 American Ash Road', - '55 Clove Lane', - '26 Ramsey Lane', - '36287 Fallview Center', - '7 Westport Place', - '7 Cherokee Parkway', - '6 Lyons Circle', - '2367 Lunder Street', - '73924 Pine View Crossing', - '76759 Ryan Alley', - '97639 Green Ridge Pass', - '328 Everett Circle', - '087 Daystar Center', - '50 Manitowish Center', - '1 Old Shore Center', - '601 Dovetail Junction', - '6 Red Cloud Pass', - '7 High Crossing Pass', - '38834 Glendale Pass', - '2 Petterle Drive', - '18 Evergreen Court', - '9 Kipling Street', - '11 Melody Park', - '670 Crowley Hill', - '193 Veith Plaza', - '90 Laurel Pass', - '3 Kropf Hill', - '4 Pankratz Street', - '76 Lakewood Gardens Hill', - '832 Stuart Parkway', - '5447 Veith Lane', - '3 Randy Road', - '2510 Erie Plaza', - '47015 Boyd Court', - '3 Columbus Avenue', - '9787 Meadow Vale Drive', - '395 Bellgrove Alley', - '9 Oak Place', - '9295 Springview Crossing', - '477 Hooker Pass', - '36725 Lien Road', - '10 Summer Ridge Center', - '936 Coolidge Alley', - '3 Rockefeller Plaza', - '9832 Holmberg Park', - '2 Killdeer Terrace', - '47113 Jackson Center', - '92 Dayton Hill', - '3 Sheridan Place', - '420 Mallory Court', - '09 Banding Hill', - '8 Paget Crossing', - '978 Carioca Pass', - '6 Schurz Alley', - '748 Cordelia Way', - '263 Westend Point', - '58280 Butterfield Avenue', - '918 Fisk Road', - '83639 Arizona Pass', - '027 Chive Street', - '574 Banding Parkway', - '3 Dwight Place', - '9320 East Avenue', - '8 7th Pass', - '215 West Drive', - '82211 Macpherson Place', - '5782 Garrison Park', - '133 Westend Plaza', - '50 Spohn Trail', - '30 Corscot Junction', - '20144 Pine View Junction', - '127 Dovetail Crossing', - '54 Hallows Court', - '0869 Fremont Plaza', - '5 Bobwhite Alley', - '68053 Kensington Place', - '3 Norway Maple Crossing', - '37104 Northridge Way', - '2 Alpine Court', - '4 International Parkway', - '04 Springs Way', - '762 Kennedy Alley', - '1 Bluejay Trail', - '6346 Eggendart Crossing', - '2572 Fulton Terrace', - '5062 Porter Place', - '099 Maple Wood Circle', - '4 Garrison Lane', - '18733 Muir Park', - '4679 Marcy Pass', - '44 Tony Park', - '497 Esker Court', - '83332 Messerschmidt Terrace', - '275 Chinook Plaza', - '0 Chinook Pass', - '4009 Burning Wood Crossing', - '275 Clyde Gallagher Lane', - '935 Jenna Place', - '7 Morning Alley', - '82 Glendale Hill', - '38 West Crossing', - '2 Pleasure Trail', - '40019 Charing Cross Point', - '29 Maple Wood Trail', - '42 Atwood Park', - '39124 Helena Park', - '7591 Larry Drive', - '02 Gerald Point', - '8 Dryden Road', - '11451 Delladonna Place', - '86813 Aberg Place', - '6856 Park Meadow Point', - '7 Eagle Crest Alley', - '5 Mayfield Terrace', - '61 Annamark Way', - '7 Charing Cross Drive', - '6589 Talmadge Place', - '02 Warrior Junction', - '708 Dixon Point', - '01867 Dawn Court', - '252 Fulton Avenue', - '881 Messerschmidt Hill', - '53951 Forest Junction', - '00 Gina Court', - '65408 Knutson Way', - '00315 Waxwing Point', - '8 Carey Center', - '15969 Spenser Pass', - '1600 Westport Plaza', - '50 Morning Park', - '5576 Moulton Lane', - '29344 Hallows Crossing', - '8032 Steensland Road', - '5088 Holy Cross Junction', - '290 Corry Parkway', - '1322 Del Sol Drive', - '150 Melvin Court', - '54 Birchwood Place', - '6751 Mendota Place', - '175 Talmadge Alley', - '871 Heath Drive', - '83906 Forest Run Lane', - '5 Corscot Trail', - '87215 Daystar Way', - '5379 Arkansas Parkway', - '12952 Dixon Avenue', - '42431 Continental Center', - '90859 Anniversary Center', - '51 Meadow Vale Pass', - '96905 Blackbird Hill', - '21 Orin Road', - '06805 Dawn Center', - '65 Monterey Hill', - '9581 Larry Way', - '95 Ridgeview Point', - '8 Dovetail Avenue', - '21307 Artisan Drive', - '65989 Duke Avenue', - '262 Lien Plaza', - '456 Pierstorff Trail', - '0 Mosinee Center', - '63 Manufacturers Park', - '54759 Veith Junction', - '64 Scott Junction', - '88118 Straubel Road', - '73460 Loomis Court', - '3419 Lien Alley', - '8342 Kedzie Court', - '4614 Burrows Point', - '78337 Helena Circle', - '99 Center Plaza', - '7 Myrtle Drive', - '6 Dryden Park', - '0002 Hudson Court', - '4409 Grayhawk Road', - '35573 Norway Maple Pass', - '82818 South Terrace', - '5830 Gerald Circle', - '57 Dexter Hill', - '06184 Buhler Court', - '8738 Artisan Crossing', - '8222 Ohio Alley', - '61121 Porter Place', - '380 Pawling Alley', - '07809 Garrison Way', - '70 Sherman Park', - '08 Anderson Trail', - '4 Sheridan Center', - '56 Holmberg Drive', - '724 Stephen Parkway', - '49 Fair Oaks Junction', - '30993 Dexter Crossing', - '79 Ridge Oak Road', - '181 Carpenter Park', - '1 Annamark Court', - '60 Lakewood Gardens Road', - '6821 Doe Crossing Avenue', - '93458 Northridge Road', - '7 Summit Trail', - '42 Starling Point', - '03734 Clemons Parkway', - '13091 Forest Run Crossing', - '472 Namekagon Hill', - '33303 Stone Corner Court', - '59 Badeau Court', - '8 Marcy Park', - '18 Rutledge Crossing', - '8 Pine View Alley', - '77606 Raven Plaza', - '43324 Pierstorff Hill', - '691 Northport Lane', - '7 Hauk Way', - '40 Buena Vista Crossing', - '721 Jackson Way', - '89 Valley Edge Avenue', - '53997 Trailsway Drive', - '70 Stephen Parkway', - '274 Coleman Park', - '471 Mendota Hill', - '12 Coolidge Pass', - '95091 School Center', - '11275 Mayer Point', - '44804 Fallview Way', - '73 Donald Crossing', - '299 Bunker Hill Center', - '30 Mccormick Terrace', - '334 Loeprich Circle', - '25 Linden Street', - '698 Gateway Parkway', - '85783 Stone Corner Court', - '4117 Dahle Crossing', - '31 Fuller Junction', - '8 Bashford Trail', - '893 Hermina Plaza', - '60 Claremont Hill', - '179 Eastwood Center', - '64 Derek Park', - '4334 Bluestem Circle', - '45 Armistice Court', - '23 Northport Junction', - '313 Elgar Street', - '531 Hazelcrest Plaza', - '31659 Linden Drive', - '25792 Towne Pass', - '541 Green Ridge Way', - '7 Esker Pass', - '7 Sloan Alley', - '6881 Westridge Plaza', - '5 Hanson Plaza', - '5387 Thierer Alley', - '123 Acker Center', - '26653 Killdeer Crossing', - '57 Iowa Park', - '9 Comanche Drive', - '0457 Bashford Road', - '9 Grayhawk Alley', - '19398 Hanson Pass', - '394 1st Terrace', - '630 Gina Crossing', - '9 Jay Plaza', - '3388 Moose Parkway', - '562 Morning Park', - '07205 Hauk Center', - '049 Morrow Alley', - '56 Garrison Crossing', - '5 Steensland Junction', - '5 Hanson Trail', - '82025 Eastwood Parkway', - '33728 Anhalt Point', - '34532 Mallard Trail', - '7708 Maple Wood Lane', - '33657 Hoepker Circle', - '28 Moulton Point', - '68 Kenwood Lane', - '189 Portage Lane', - '59094 Bluestem Street', - '17791 Randy Junction', - '500 Leroy Center', - '05 Stephen Avenue', - '56956 Morning Alley', - '4202 Morningstar Hill', - '6786 Pine View Avenue', - '9 Union Street', - '381 Laurel Pass', - '958 Mallory Crossing', - '5713 Shelley Crossing', - '5 Hanson Street', - '05 Swallow Crossing', - '63053 Crownhardt Avenue', - '04288 Manufacturers Hill', - '43 Nobel Place', - '620 Melvin Drive', - '56750 Nancy Place', - '54920 Marcy Alley', - '9 Haas Road', - '2544 Namekagon Alley', - '38 Parkside Plaza', - '6 Victoria Avenue', - '630 Lyons Road', - '80 Roth Center', - '05668 Grim Parkway', - '3 Hanover Way', - '46263 Old Shore Trail', - '59217 Green Ridge Avenue', - '9 Forest Dale Hill', - '709 Michigan Point', - '1757 Little Fleur Junction', - '5 Autumn Leaf Road', - '9 Acker Hill', - '624 Carpenter Crossing', - '55762 Anthes Pass', - '16 Grim Place', - '21637 Steensland Way', - '56000 Michigan Alley', - '867 Arrowood Court', - '926 Esch Way', - '287 Judy Circle', - '6 Erie Junction', - '690 David Trail', - '42027 Grim Plaza', - '69911 Hallows Circle', - '29 Sunnyside Junction', - '649 Marcy Place', - '1662 Onsgard Trail', - '8164 Truax Court', - '625 Service Junction', - '9477 American Pass', - '79714 Morning Avenue', - '71545 Maple Wood Way', - '7 American Ash Avenue', - '392 Kingsford Street', - '9037 Sundown Lane', - '2767 Melody Circle', - '0381 Upham Crossing', - '3 Morrow Park', - '3812 Nevada Plaza', - '279 Cordelia Court', - '46 Morningstar Street', - '68 Browning Junction', - '4010 Stoughton Court', - '5498 Northwestern Hill', - '4581 Saint Paul Pass', - '7 Susan Point', - '72 Buell Circle', - '86 Surrey Center', - '2 Arapahoe Junction', - '7 Novick Park', - '2827 Debs Way', - '635 Pepper Wood Center', - '23 Farragut Road', - '65 Eastlawn Junction', - '7035 Muir Pass', - '0206 Bayside Drive', - '87 Lakewood Gardens Circle', - '542 Cascade Lane', - '78 Londonderry Street', - '4479 Declaration Crossing', - '1 Rowland Lane', - '89 Huxley Trail', - '9968 Monument Park', - '4376 Truax Park', - '0 Bartelt Terrace', - '59773 Leroy Point', - '14519 Springview Park', - '5239 Packers Trail', - '2 Magdeline Circle', - '819 John Wall Junction', - '7 Forest Dale Parkway', - '528 6th Junction', - '74 Jenna Center', - '379 Hauk Terrace', - '4095 Texas Court', - '561 Rutledge Road', - '456 Scott Point', - '15 Messerschmidt Circle', - '07966 Doe Crossing Street', - '5117 Bowman Avenue', - '52 Gina Center', - '4464 Clemons Alley', - '4453 Leroy Hill', - '245 Knutson Alley', - '74875 Hauk Drive', - '5110 Everett Road', - '8 Hansons Lane', - '69832 Bonner Park', - '507 Myrtle Crossing', - '1 Morrow Circle', - '833 Maywood Junction', - '3578 Prentice Junction', - '724 Golf Course Court', - '3 Nevada Avenue', - '25066 Porter Alley', - '466 Steensland Point', - '1 Harbort Place', - '05828 School Avenue', - '05462 Sunfield Junction', - '56 Walton Junction', - '1 Dayton Avenue', - '02335 Golf Terrace', - '2 Holy Cross Junction', - '0 Bunker Hill Junction', - '802 Lukken Place', - '0989 Morrow Alley', - '75178 Pearson Pass', - '99352 Sycamore Drive', - '485 Sunfield Circle', - '63 North Place', - '19326 Clemons Lane', - '4 Ohio Terrace', - '0115 Westend Place', - '6308 Hoepker Circle', - '6935 Continental Terrace', - '6 Scofield Pass', - '27 Southridge Court', - '57 Corben Point', - '32102 Harper Junction', - '65396 Starling Place', - '8290 Crownhardt Crossing', - '6493 Cordelia Crossing', - '9 Dawn Street', - '62 Emmet Circle', - '30 Village Park', - '8 Kenwood Place', - '769 Springview Crossing', - '55 Northport Hill', - '81992 Buell Circle', - '8580 Fairview Crossing', - '48 Sauthoff Court', - '7102 Oak Valley Park', - '6 Sheridan Crossing', - '8 Sutherland Pass', - '336 Packers Way', - '4890 Norway Maple Center', - '8005 Portage Road', - '98522 Golf View Parkway', - '904 Myrtle Hill', - '90304 Barby Park', - '130 Kipling Trail', - '695 Menomonie Way', - '299 Reindahl Park', - '389 Norway Maple Lane', - '402 Sutteridge Park', - '976 Stoughton Trail', - '100 Golden Leaf Street', - '9199 Debra Pass', - '4366 Moulton Avenue', - '4 Corry Street', - '4 Stephen Way', - '99739 Florence Parkway', - '897 Coleman Parkway', - '3987 Southridge Park', - '34 Novick Junction', - '5 Bunker Hill Hill', - '0729 Lotheville Plaza', - '5014 Larry Plaza', - '7 Merrick Trail', - '7449 Thompson Crossing', - '36 Northfield Street', - '901 Dahle Point', - '4 Boyd Trail', - '4348 Clyde Gallagher Place', - '9 Manley Court', - '2343 Mariners Cove Parkway', - '81397 Graceland Circle', - '7 Oakridge Terrace', - '9407 Fulton Street', - '7095 Petterle Park', - '09537 Mcguire Drive', - '21672 Swallow Circle', - '7808 Schmedeman Center', - '2 Monterey Parkway', - '31259 Judy Trail', - '5 Anhalt Street', - '745 Talmadge Circle', - '230 Troy Street', - '988 John Wall Junction', - '5 Blue Bill Park Way', - '366 Schurz Center', - '6342 Grim Lane', - '21821 Tony Avenue', - '6270 Grasskamp Junction', - '2 Scoville Avenue', - '054 Independence Road', - '88 Mallard Drive', - '63898 Veith Lane', - '33946 Gateway Trail', - '2922 Larry Circle', - '186 Utah Lane', - '969 Buell Court', - '1 Corben Trail', - '3 Park Meadow Crossing', - '05 Canary Place', - '8 Susan Avenue', - '8782 Aberg Drive', - '1996 Texas Court', - '250 Summer Ridge Road', - '6702 Haas Drive', - '997 Weeping Birch Place', - '39 Messerschmidt Place', - '14375 Kennedy Street', - '895 Bellgrove Crossing', - '24240 Rockefeller Pass', - '3 Service Hill', - '9736 Merchant Place', - '7 David Parkway', - '8 Hallows Hill', - '629 Westport Plaza', - '90 Delladonna Court', - '2061 Susan Junction', - '5 Reindahl Point', - '8 Arizona Pass', - '8975 Mcguire Pass', - '76 Maywood Parkway', - '301 Little Fleur Park', - '165 Mallory Crossing', - '9361 Helena Hill', - '7 Lukken Center', - '73 Gateway Plaza', - '03 Ohio Park', - '77 Merchant Lane', - '71239 Elmside Point', - '53 Troy Road', - '4 Pennsylvania Park', - '024 Division Place', - '312 Dapin Park', - '20641 Waubesa Court', - '631 Longview Way', - '2382 Canary Junction', - '2 Ridgeway Way', - '6 Oriole Point', - '37 Springs Plaza', - '93518 Calypso Court', - '9073 Mayer Hill', - '2 Lunder Point', - '92 Kinsman Junction', - '1 Northland Center', - '5 Mendota Avenue', - '8419 Sutherland Plaza', - '43670 Sachtjen Center', - '2 Surrey Center', - '8492 South Road', - '19117 Del Mar Point', - '310 Derek Court', - '143 Esker Way', - '85593 Hanson Center', - '70372 Elmside Trail', - '41704 Larry Circle', - '7 Milwaukee Drive', - '480 Jay Point', - '301 Weeping Birch Circle', - '006 Messerschmidt Crossing', - '61318 Muir Avenue', - '585 Dryden Hill', - '1 Dryden Circle', - '84435 Knutson Pass', - '68941 Springview Park', - '29 Glendale Circle', - '63516 Columbus Road', - '866 Anthes Road', - '39271 Pleasure Circle', - '86 West Drive', - '45933 Drewry Center', - '190 Eagle Crest Court', - '5457 Hanson Hill', - '31054 Bayside Junction', - '0 Debra Center', - '71081 Orin Parkway', - '4 Judy Drive', - '4607 Meadow Ridge Road', - '995 Northport Avenue', - '35383 Comanche Circle', - '82847 Monica Plaza', - '9 Alpine Point', - '2 Bobwhite Hill', - '915 Leroy Terrace', - '7 New Castle Street', - '7 Stang Center', - '71483 Dorton Center', - '1206 Drewry Crossing', - '59 Anderson Road', - '96043 Kensington Junction', - '06 Ridgeview Court', - '56541 Bartelt Street', - '476 Lukken Court', - '4926 Havey Point', - '269 Kensington Alley', - '23 Helena Alley', - '365 Havey Drive', - '57 Nobel Trail', - '82067 Carey Drive', - '50088 Ridgeway Road', - '6077 Lien Circle', - '789 Pepper Wood Plaza', - '4601 Glendale Alley', - '691 Birchwood Hill', - '2882 Esch Terrace', - '4415 Springs Way', - '415 Scott Way', - '23673 Monica Point', - '3031 Transport Lane', - '6364 Macpherson Plaza', - '66587 South Terrace', - '6 Elka Place', - '0 Holy Cross Road', - '1586 Kropf Park', - '689 Mendota Park', - '6 Haas Place', - '369 Summerview Lane', - '80220 Farmco Court', - '4 Surrey Street', - '881 Pearson Park', - '20037 Independence Crossing', - '6 Fair Oaks Drive', - '57 Birchwood Plaza', - '72 Hanson Road', - '1 Dapin Street', - '37 Mccormick Drive', - '6 Harper Trail', - '61 Goodland Junction', - '8 Pond Center', - '37029 Scott Way', - '70720 Judy Park', - '48 La Follette Drive', - '24 Prairieview Center', - '7 Moland Drive', - '85170 Surrey Point', - '75266 Northridge Street', - '57 Barnett Way', - '70029 Loftsgordon Pass', - '9 Lunder Crossing', - '4 Eastlawn Center', - '69 High Crossing Street', - '2 Eggendart Park', - '335 Shoshone Junction', - '98 Roth Drive', - '39182 Rockefeller Center', - '821 Shoshone Plaza', - '3820 Jenna Road', - '71043 Walton Court', - '671 Maryland Circle', - '410 Farragut Terrace', - '4895 Mifflin Way', - '1342 Roxbury Drive', - '43338 Farwell Alley', - '5748 Fisk Court', - '8764 Fuller Park', - '2 Johnson Junction', - '9 Pond Hill', - '46 Grim Lane', - '3665 Schurz Center', - '53 South Lane', - '9 Canary Terrace', - '471 Crowley Crossing', - '47165 Acker Road', - '57024 Mccormick Park', - '187 Melby Court', - '7 Sachs Parkway', - '9059 Mallard Parkway', - '6659 Walton Street', - '9 Pine View Lane', - '4659 Del Mar Plaza', - '2 Mandrake Place', - '977 Sullivan Way', - '16 Dexter Circle', - '80 Mesta Point', - '7035 Fairfield Point', - '3 Hauk Junction', - '04436 Scoville Center', - '7 Erie Place', - '8269 Summit Plaza', - '38002 Eagle Crest Crossing', - '27 Orin Crossing', - '2 Merry Crossing', - '864 Hanson Lane', - '7 Algoma Point', - '10 Sommers Crossing', - '6 Pond Avenue', - '1544 Westport Lane', - '7 Meadow Valley Crossing', - '485 Mitchell Terrace', - '4 Loftsgordon Trail', - '31 Shopko Road', - '09462 Victoria Crossing', - '593 Elmside Pass', - '8 Lake View Terrace', - '72 American Drive', - '7613 Sage Alley', - '4 Grasskamp Point', - '3864 Mallard Avenue', - '48 Crownhardt Circle', - '986 Sugar Circle', - '9434 Riverside Court', - '4640 Pankratz Alley', - '482 Lukken Trail', - '26 Donald Plaza', - '30705 Superior Road', - '39 Burrows Avenue', - '8 Hanover Alley', - '37510 Birchwood Lane', - '4 Burrows Court', - '73240 Kingsford Center', - '1 Forest Park', - '90 Sauthoff Crossing', - '866 Westerfield Circle', - '27 Express Trail', - '1 Ohio Crossing', - '885 Texas Parkway', - '46 Park Meadow Way', - '1 Paget Park', - '863 Garrison Road', - '33757 Lindbergh Street', - '4 Sachtjen Junction', - '6625 Bay Park', - '324 6th Terrace', - '13233 Harbort Plaza', - '00 Elmside Drive', - '114 Spohn Drive', - '1186 Welch Circle', - '01 Hoffman Plaza', - '95 Gateway Road', - '666 La Follette Junction', - '20434 Hazelcrest Way', - '189 Nelson Junction', - '78 Luster Place', - '2837 Fairview Crossing', - '051 Holmberg Parkway', - '196 Dorton Terrace', - '9591 Mosinee Place', - '6 1st Road', - '35894 Lindbergh Park', - '28049 Magdeline Pass', - '5 West Junction', - '8 Bobwhite Parkway', - '019 Everett Junction', - '30624 Nova Pass', - '15 Russell Way', - '37601 Forest Way', - '543 Bunting Point', - '8724 Blaine Crossing', - '540 Manley Junction', - '2 Nobel Parkway', - '3 Leroy Center', - '42 Anzinger Way', - '74142 Cardinal Court', - '3 Forest Dale Point', - '006 New Castle Trail', - '51 Barnett Junction', - '147 Grover Alley', - '5 Eagan Junction', - '236 Everett Crossing', - '8152 Moulton Pass', - '45 Vera Terrace', - '439 Crowley Way', - '82 Declaration Point', - '2035 Division Center', - '84405 Swallow Drive', - '2 Boyd Circle', - '34 Spohn Center', - '8537 Lukken Trail', - '0634 Stuart Lane', - '54950 Old Gate Way', - '0 Iowa Parkway', - '17007 Gulseth Terrace', - '47830 Center Street', - '9 Grover Point', - '1 Park Meadow Junction', - '6 Thackeray Hill', - '5956 Namekagon Road', - '8 Clemons Court', - '741 Burrows Place', - '781 Sycamore Parkway', - '384 Eliot Place', - '46 Eastwood Pass', - '29 Mandrake Alley', - '3 Monument Plaza', - '98 Summerview Place', - '4513 Westport Pass', - '47 Hoard Avenue', - '70851 Dayton Hill', - '747 Kenwood Drive', - '14 Oakridge Road', - '478 Atwood Parkway', - '9306 Forest Street', - '60900 Towne Road', - '8 Hayes Way', - '7317 Merchant Trail', - '4 Fisk Circle', - '655 Vermont Plaza', - '356 Tennyson Avenue', - '52379 New Castle Place', - '16263 Riverside Street', - '26 Darwin Avenue', - '3 Grim Circle', - '445 Main Trail', - '5877 Lien Lane', - '44523 Onsgard Circle', - '97 Mayer Alley', - '06 Blaine Street', - '84 Northridge Lane', - '1 Towne Street', - '470 Village Green Circle', - '8 Washington Way', - '50 Hoard Trail', - '6 Eliot Lane', - '23 Mccormick Point', - '3463 Trailsway Road', - '5 Westerfield Way', - '18532 Paget Alley', - '3 Crowley Plaza', - '037 Almo Drive', - '55402 Gerald Court', - '334 Mcguire Park', - '04477 Warbler Circle', - '5284 Almo Junction', - '31729 Heath Park', - '25 Rusk Crossing', - '4 Bashford Drive', - '538 Hanover Crossing', - '967 Ludington Road', - '74 Truax Center', - '877 Mayfield Road', - '93291 American Ash Circle', - '4 Old Gate Plaza', - '31 Rieder Hill', - '699 Mosinee Terrace', - '7 Esch Drive', - '40 Karstens Drive', - '4750 Roth Avenue', - '634 Eliot Point', - '54888 7th Point', - '93 Del Sol Terrace', - '5606 Main Crossing', - '8137 Pankratz Pass', - '774 Rieder Trail', - '0532 Orin Trail', - '4 Forest Run Plaza', - '32347 Packers Center', - '84308 Burning Wood Circle', - '1 Namekagon Point', - '20 Union Court', - '15190 Eggendart Drive', - '24985 Mccormick Hill', - '4 Sauthoff Court', - '4326 Maryland Circle', - '35 Annamark Park', - '1703 Oakridge Parkway', - '24683 Mayfield Drive', - '98584 Crescent Oaks Lane', - '581 Rusk Trail', - '64686 Continental Road', - '9 Grayhawk Crossing', - '00 Reinke Way', - '114 Stang Way', - '433 Pleasure Court', - '148 Vidon Place', - '987 Troy Drive', - '1 Gale Alley', - '069 Spenser Junction', - '44 Atwood Alley', - '4 Marcy Pass', - '6541 Westridge Hill', - '7 Dahle Terrace', - '40 Talisman Alley', - '38788 Cherokee Lane', - '5 Sauthoff Lane', - '719 Holmberg Drive', - '9846 Roth Alley', - '0088 Artisan Street', - '14163 Center Junction', - '0 Sunnyside Pass', - '7 Shelley Park', - '6 Straubel Court', - '102 Russell Street', - '291 Crest Line Road', - '17 Vernon Terrace', - '017 Ridge Oak Point', - '9783 Jenna Alley', - '043 Schiller Circle', - '4103 Holy Cross Avenue', - '7186 Rutledge Alley', - '1 American Ash Parkway', - '58865 American Way', - '390 4th Way', - '582 Artisan Circle', - '6 Acker Alley', - '04699 Pearson Road', - '338 Judy Crossing', - '76097 Homewood Pass', - '1 Londonderry Point', - '5313 Esker Center', - '78 Hoepker Avenue', - '4750 Heath Pass', - '91 Elka Point', - '22003 Pond Terrace', - '7822 Blaine Lane', - '2782 Hanover Trail', - '89 Riverside Drive', - '4090 Oakridge Place', - '407 Artisan Junction', - '3607 Mariners Cove Road', - '19 Mcguire Avenue', - '3135 Golf Course Place', - '46 Mcbride Way', - '1 Mccormick Road', - '182 Arkansas Avenue', - '5 1st Street', - '7 Goodland Terrace', - '12 7th Lane', - '1051 Bowman Parkway', - '4598 Armistice Avenue', - '2 Columbus Court', - '39131 Dunning Parkway', - '570 Truax Drive', - '8013 Schiller Court', - '251 John Wall Junction', - '60 Sunfield Lane', - '0039 Killdeer Trail', - '867 Cody Plaza', - '63 Westerfield Trail', - '90648 Rowland Alley', - '64368 Novick Road', - '18 Carioca Plaza', - '136 Daystar Hill', - '988 Oriole Street', -] diff --git a/react/components/Combobox.css b/react/components/Combobox.css new file mode 100644 index 0000000..6d3124c --- /dev/null +++ b/react/components/Combobox.css @@ -0,0 +1,11 @@ +:root { + --reach-combobox: 1; +} + +.option:not([aria-selected="true"]).option:not(:hover) { + background-color: transparent; +} + +.popover { + box-shadow: 0px 1px 16px rgba(46, 46, 46, 0.12); +} \ No newline at end of file diff --git a/react/components/Combobox.tsx b/react/components/Combobox.tsx new file mode 100644 index 0000000..6a6905c --- /dev/null +++ b/react/components/Combobox.tsx @@ -0,0 +1,71 @@ +import { + Combobox as ReachCombobox, + ComboboxInput as ReachComboboxInput, + ComboboxPopover as ReachComboboxPopover, + ComboboxPopoverProps as ReachComboboxPopoverProps, + ComboboxList as ReachComboboxList, + ComboboxListProps as ReachComboboxListProps, + ComboboxOption as ReachComboboxOption, + ComboboxOptionProps as ReachComboboxOptionProps, + ComboboxOptionText as ReachComboboxOptionText, +} from '@reach/combobox' +import { PopoverProps } from '@reach/popover' +import React, { forwardRef } from 'react' +import classNames from 'classnames' + +import styles from './Combobox.css' + +export const Combobox = ReachCombobox + +export const ComboboxInput = ReachComboboxInput + +export const ComboboxPopover = forwardRef< + HTMLDivElement, + ReachComboboxPopoverProps & + Partial & + React.RefAttributes +>(function ComboboxPopover({ className, ...props }, ref) { + return ( + + ) +}) + +export const ComboboxList: React.FC = ({ className, ...props }) => ( + +) + +export const ComboboxOption: React.FC = ({ className, children, ...props }) => ( + + {children ?? } + +) + +export default { + Combobox, + ComboboxInput, + ComboboxPopover, + ComboboxList, + ComboboxOption, +} diff --git a/react/components/PlaceIcon.tsx b/react/components/PlaceIcon.tsx new file mode 100644 index 0000000..3bfcf8c --- /dev/null +++ b/react/components/PlaceIcon.tsx @@ -0,0 +1,19 @@ +import React from 'react' + +export const PlaceIcon: React.FC> = props => ( + + + +) + +export default PlaceIcon