-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add geolocation component, with jest tests and storybook stories
- Loading branch information
Yen Truong
committed
Nov 16, 2022
1 parent
8422231
commit bb343f5
Showing
22 changed files
with
612 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [Geolocation\_2](./search-ui-react.geolocation_2.md) | ||
|
||
## Geolocation\_2() function | ||
|
||
A React Component which collects location information to create a location filter and perform a new search. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function Geolocation({ geolocationOptions, radius, label, GeolocationIcon, onClick, customCssClasses, }: GeolocationProps): JSX.Element | null; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| { geolocationOptions, radius, label, GeolocationIcon, onClick, customCssClasses, } | [GeolocationProps](./search-ui-react.geolocationprops.md) | | | ||
|
||
<b>Returns:</b> | ||
|
||
JSX.Element \| null | ||
|
||
A react component for geolocation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationCssClasses](./search-ui-react.geolocationcssclasses.md) > [button](./search-ui-react.geolocationcssclasses.button.md) | ||
|
||
## GeolocationCssClasses.button property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
button?: string; | ||
``` |
11 changes: 11 additions & 0 deletions
11
docs/search-ui-react.geolocationcssclasses.geolocationcontainer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationCssClasses](./search-ui-react.geolocationcssclasses.md) > [geolocationContainer](./search-ui-react.geolocationcssclasses.geolocationcontainer.md) | ||
|
||
## GeolocationCssClasses.geolocationContainer property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
geolocationContainer?: string; | ||
``` |
11 changes: 11 additions & 0 deletions
11
docs/search-ui-react.geolocationcssclasses.iconcontainer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationCssClasses](./search-ui-react.geolocationcssclasses.md) > [iconContainer](./search-ui-react.geolocationcssclasses.iconcontainer.md) | ||
|
||
## GeolocationCssClasses.iconContainer property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
iconContainer?: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationCssClasses](./search-ui-react.geolocationcssclasses.md) | ||
|
||
## GeolocationCssClasses interface | ||
|
||
The CSS class interface for the Geolocation component. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface GeolocationCssClasses | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [button?](./search-ui-react.geolocationcssclasses.button.md) | string | <i>(Optional)</i> | | ||
| [geolocationContainer?](./search-ui-react.geolocationcssclasses.geolocationcontainer.md) | string | <i>(Optional)</i> | | ||
| [iconContainer?](./search-ui-react.geolocationcssclasses.iconcontainer.md) | string | <i>(Optional)</i> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [customCssClasses](./search-ui-react.geolocationprops.customcssclasses.md) | ||
|
||
## GeolocationProps.customCssClasses property | ||
|
||
CSS classes for customizing the component styling. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
customCssClasses?: GeolocationCssClasses; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [GeolocationIcon](./search-ui-react.geolocationprops.geolocationicon.md) | ||
|
||
## GeolocationProps.GeolocationIcon property | ||
|
||
Custom icon component to display along with the button. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
GeolocationIcon?: React.FC; | ||
``` |
13 changes: 13 additions & 0 deletions
13
docs/search-ui-react.geolocationprops.geolocationoptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [geolocationOptions](./search-ui-react.geolocationprops.geolocationoptions.md) | ||
|
||
## GeolocationProps.geolocationOptions property | ||
|
||
Configuration used when collecting the user's location. Definition: [https://w3c.github.io/geolocation-api/\#position\_options\_interface](https://w3c.github.io/geolocation-api/#position_options_interface)<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
geolocationOptions?: PositionOptions; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [label](./search-ui-react.geolocationprops.label.md) | ||
|
||
## GeolocationProps.label property | ||
|
||
The label for the button. Defaults to 'Use my location'. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
label?: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) | ||
|
||
## GeolocationProps interface | ||
|
||
The props for the Geolocation component. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface GeolocationProps | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [customCssClasses?](./search-ui-react.geolocationprops.customcssclasses.md) | [GeolocationCssClasses](./search-ui-react.geolocationcssclasses.md) | <i>(Optional)</i> CSS classes for customizing the component styling. | | ||
| [GeolocationIcon?](./search-ui-react.geolocationprops.geolocationicon.md) | React.FC | <i>(Optional)</i> Custom icon component to display along with the button. | | ||
| [geolocationOptions?](./search-ui-react.geolocationprops.geolocationoptions.md) | PositionOptions | <i>(Optional)</i> Configuration used when collecting the user's location. Definition: [https://w3c.github.io/geolocation-api/\#position\_options\_interface](https://w3c.github.io/geolocation-api/#position_options_interface)<!-- -->. | | ||
| [label?](./search-ui-react.geolocationprops.label.md) | string | <i>(Optional)</i> The label for the button. Defaults to 'Use my location'. | | ||
| [onClick?](./search-ui-react.geolocationprops.onclick.md) | () => void | <i>(Optional)</i> A function which is called when the geolocation button is clicked. This is called prior to executing the existing click behavior. | | ||
| [radius?](./search-ui-react.geolocationprops.radius.md) | number | <i>(Optional)</i> The radius, in miles, around the user's location to find results. Defaults to 50. If location accuracy is low, a larger radius may be used automatically. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [onClick](./search-ui-react.geolocationprops.onclick.md) | ||
|
||
## GeolocationProps.onClick property | ||
|
||
A function which is called when the geolocation button is clicked. This is called prior to executing the existing click behavior. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
onClick?: () => void; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-ui-react](./search-ui-react.md) > [GeolocationProps](./search-ui-react.geolocationprops.md) > [radius](./search-ui-react.geolocationprops.radius.md) | ||
|
||
## GeolocationProps.radius property | ||
|
||
The radius, in miles, around the user's location to find results. Defaults to 50. If location accuracy is low, a larger radius may be used automatically. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
radius?: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.