Skip to content

Commit

Permalink
Merge branch 'develop' into feature/mapbox-component
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Nov 14, 2022
2 parents f585a30 + 893368d commit c0a58d9
Show file tree
Hide file tree
Showing 78 changed files with 1,068 additions and 857 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ lib/
/coverage
/storybook-static

**/.env
.env
test-site/.env
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ module.exports = {
framework: '@storybook/react',
staticDirs: ['./public'],
webpackFinal: async (config) => {
//use commonjs entry point for "@reach" packages
config.resolve.alias['@reach/auto-id'] = require.resolve('@reach/auto-id');
config.resolve.alias['@reach/utils'] = require.resolve('@reach/utils');

config.resolve.alias['./SearchCore'] = require.resolve('../tests/__fixtures__/core/SearchCore.ts');
config.resolve.alias['../utils/location-operations'] = require.resolve('../tests/__fixtures__/utils/location-operations.ts');
return config;
Expand Down
11 changes: 10 additions & 1 deletion .storybook/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@ module.exports = {
...tailwindConfig,
content: [
'./src/**/*.{ts,tsx}'
]
],
theme: {
...tailwindConfig.theme,
extend: {
...tailwindConfig.theme.extend,
borderColor: {
DEFAULT: 'black'
}
}
}
};
54 changes: 33 additions & 21 deletions THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,39 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----------

The following NPM packages may be included in this product:

- @reach/auto-id@0.18.0
- @reach/utils@0.18.0

These packages each contain the following license and notice below:

The MIT License (MIT)

Copyright (c) 2018-2022, React Training LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----------

The following NPM package may be included in this product:

- @react-aria/ssr@3.1.0
- @react-aria/ssr@3.3.0

This package contains the following license and notice below:

Expand Down Expand Up @@ -639,7 +669,7 @@ Apache License

The following NPM package may be included in this product:

- @reduxjs/toolkit@1.8.5
- @reduxjs/toolkit@1.8.6

This package contains the following license and notice below:

Expand Down Expand Up @@ -1034,7 +1064,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The following NPM package may be included in this product:

- @yext/search-headless-react@2.0.0
- @yext/search-headless-react@2.0.1

This package contains the following license and notice below:

Expand Down Expand Up @@ -4919,24 +4949,6 @@ OTHER DEALINGS IN THE SOFTWARE.

-----------

The following NPM package may be included in this product:

- uuid@9.0.0

This package contains the following license and notice below:

The MIT License (MIT)

Copyright (c) 2010-2020 Robert Kieffer and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----------

The following NPM package may be included in this product:

- validator@13.7.0
Expand Down
1 change: 1 addition & 0 deletions docs/search-ui-react.filtergroupcssclasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export interface FilterGroupCssClasses
| [optionLabel?](./search-ui-react.filtergroupcssclasses.optionlabel.md) | string | <i>(Optional)</i> |
| [optionsContainer?](./search-ui-react.filtergroupcssclasses.optionscontainer.md) | string | <i>(Optional)</i> |
| [searchInput?](./search-ui-react.filtergroupcssclasses.searchinput.md) | string | <i>(Optional)</i> |
| [titleLabel?](./search-ui-react.filtergroupcssclasses.titlelabel.md) | string | <i>(Optional)</i> |

11 changes: 11 additions & 0 deletions docs/search-ui-react.filtergroupcssclasses.titlelabel.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [FilterGroupCssClasses](./search-ui-react.filtergroupcssclasses.md) &gt; [titleLabel](./search-ui-react.filtergroupcssclasses.titlelabel.md)

## FilterGroupCssClasses.titleLabel property

<b>Signature:</b>

```typescript
titleLabel?: string;
```
4 changes: 2 additions & 2 deletions docs/search-ui-react.filtersearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ A component which allows a user to search for filters associated with specific e
<b>Signature:</b>

```typescript
export declare function FilterSearch({ searchFields, label, placeholder, searchOnSelect, sectioned, customCssClasses }: FilterSearchProps): JSX.Element;
export declare function FilterSearch({ searchFields, label, placeholder, searchOnSelect, onSelect, sectioned, customCssClasses }: FilterSearchProps): JSX.Element;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| { searchFields, label, placeholder, searchOnSelect, sectioned, customCssClasses } | [FilterSearchProps](./search-ui-react.filtersearchprops.md) | |
| { searchFields, label, placeholder, searchOnSelect, onSelect, sectioned, customCssClasses } | [FilterSearchProps](./search-ui-react.filtersearchprops.md) | |

<b>Returns:</b>

Expand Down
1 change: 1 addition & 0 deletions docs/search-ui-react.filtersearchprops.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface FilterSearchProps
| --- | --- | --- |
| [customCssClasses?](./search-ui-react.filtersearchprops.customcssclasses.md) | [FilterSearchCssClasses](./search-ui-react.filtersearchcssclasses.md) | <i>(Optional)</i> CSS classes for customizing the component styling. |
| [label?](./search-ui-react.filtersearchprops.label.md) | string | <i>(Optional)</i> The display label for the component. |
| [onSelect?](./search-ui-react.filtersearchprops.onselect.md) | (params: [OnSelectParams](./search-ui-react.onselectparams.md)<!-- -->) =&gt; void | <i>(Optional)</i> A function which is called when a filter is selected. |
| [placeholder?](./search-ui-react.filtersearchprops.placeholder.md) | string | <i>(Optional)</i> The search input's placeholder text when no text has been entered by the user. Defaults to "Search here...". |
| [searchFields](./search-ui-react.filtersearchprops.searchfields.md) | Omit&lt;SearchParameterField, 'fetchEntities'&gt;\[\] | An array of fieldApiName and entityType which indicates what to perform the filter search against. |
| [searchOnSelect?](./search-ui-react.filtersearchprops.searchonselect.md) | boolean | <i>(Optional)</i> Whether to trigger a search when an option is selected. Defaults to false. |
Expand Down
13 changes: 13 additions & 0 deletions docs/search-ui-react.filtersearchprops.onselect.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [FilterSearchProps](./search-ui-react.filtersearchprops.md) &gt; [onSelect](./search-ui-react.filtersearchprops.onselect.md)

## FilterSearchProps.onSelect property

A function which is called when a filter is selected.

<b>Signature:</b>

```typescript
onSelect?: (params: OnSelectParams) => void;
```
5 changes: 5 additions & 0 deletions docs/search-ui-react.filtersearchprops.searchonselect.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## FilterSearchProps.searchOnSelect property

> Warning: This API is now obsolete.
>
> Use the `onSelect` prop instead.
>
Whether to trigger a search when an option is selected. Defaults to false.

<b>Signature:</b>
Expand Down
3 changes: 2 additions & 1 deletion docs/search-ui-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| [executeAutocomplete(searchActions)](./search-ui-react.executeautocomplete.md) | Executes a universal/vertical autocomplete search and return the corresponding response. |
| [executeSearch(searchActions)](./search-ui-react.executesearch.md) | Executes a universal/vertical search. |
| [FilterDivider({ className })](./search-ui-react.filterdivider.md) | A divider component used to separate NumericalFacets, HierarchicalFacets, StandardFacets, and StaticFilters. |
| [FilterSearch({ searchFields, label, placeholder, searchOnSelect, sectioned, customCssClasses })](./search-ui-react.filtersearch.md) | A component which allows a user to search for filters associated with specific entities and fields. |
| [FilterSearch({ searchFields, label, placeholder, searchOnSelect, onSelect, sectioned, customCssClasses })](./search-ui-react.filtersearch.md) | A component which allows a user to search for filters associated with specific entities and fields. |
| [getSearchIntents(searchActions)](./search-ui-react.getsearchintents.md) | Get search intents of the current query stored in headless using autocomplete request. |
| [getUserLocation(geolocationOptions)](./search-ui-react.getuserlocation.md) | Retrieves user's location using navigator.geolocation API. |
| [HierarchicalFacets({ searchOnChange, collapsible, defaultExpanded, includedFieldIds, customCssClasses, delimiter, showMoreLimit })](./search-ui-react.hierarchicalfacets.md) | A component that displays hierarchical facets, in a tree level structure, applicable to the current vertical search. |
Expand Down Expand Up @@ -73,6 +73,7 @@
| [MapboxMapProps](./search-ui-react.mapboxmapprops.md) | Props for the [MapboxMap()](./search-ui-react.mapboxmap.md) component. The type param "T" represents the type of "rawData" field of the results use in the map. |
| [NumericalFacetsCssClasses](./search-ui-react.numericalfacetscssclasses.md) | The CSS class interface for [NumericalFacets()](./search-ui-react.numericalfacets.md)<!-- -->. |
| [NumericalFacetsProps](./search-ui-react.numericalfacetsprops.md) | Props for the [NumericalFacets()](./search-ui-react.numericalfacets.md) component. |
| [OnSelectParams](./search-ui-react.onselectparams.md) | The parameters that are passed into [FilterSearchProps.onSelect](./search-ui-react.filtersearchprops.onselect.md)<!-- -->. |
| [PaginationCssClasses](./search-ui-react.paginationcssclasses.md) | The CSS classes used for pagination. |
| [PaginationProps](./search-ui-react.paginationprops.md) | Props for [Pagination()](./search-ui-react.pagination.md) component |
| [RangeInputCssClasses](./search-ui-react.rangeinputcssclasses.md) | The CSS class interface for RangeInput. |
Expand Down
13 changes: 13 additions & 0 deletions docs/search-ui-react.onselectparams.currentfilter.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md) &gt; [currentFilter](./search-ui-react.onselectparams.currentfilter.md)

## OnSelectParams.currentFilter property

The previously selected filter.

<b>Signature:</b>

```typescript
currentFilter: StaticFilter | undefined;
```
13 changes: 13 additions & 0 deletions docs/search-ui-react.onselectparams.executefiltersearch.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md) &gt; [executeFilterSearch](./search-ui-react.onselectparams.executefiltersearch.md)

## OnSelectParams.executeFilterSearch property

A function that executes a filter search and updates the input and dropdown options with the response.

<b>Signature:</b>

```typescript
executeFilterSearch: (query?: string) => Promise<FilterSearchResponse | undefined>;
```
24 changes: 24 additions & 0 deletions docs/search-ui-react.onselectparams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md)

## OnSelectParams interface

The parameters that are passed into [FilterSearchProps.onSelect](./search-ui-react.filtersearchprops.onselect.md)<!-- -->.

<b>Signature:</b>

```typescript
export interface OnSelectParams
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [currentFilter](./search-ui-react.onselectparams.currentfilter.md) | StaticFilter \| undefined | The previously selected filter. |
| [executeFilterSearch](./search-ui-react.onselectparams.executefiltersearch.md) | (query?: string) =&gt; Promise&lt;FilterSearchResponse \| undefined&gt; | A function that executes a filter search and updates the input and dropdown options with the response. |
| [newDisplayName](./search-ui-react.onselectparams.newdisplayname.md) | string | The display name of the newly selected filter. |
| [newFilter](./search-ui-react.onselectparams.newfilter.md) | FieldValueStaticFilter | The newly selected filter. |
| [setCurrentFilter](./search-ui-react.onselectparams.setcurrentfilter.md) | (filter: StaticFilter) =&gt; void | A function that sets which filter the component is currently associated with. |

13 changes: 13 additions & 0 deletions docs/search-ui-react.onselectparams.newdisplayname.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md) &gt; [newDisplayName](./search-ui-react.onselectparams.newdisplayname.md)

## OnSelectParams.newDisplayName property

The display name of the newly selected filter.

<b>Signature:</b>

```typescript
newDisplayName: string;
```
13 changes: 13 additions & 0 deletions docs/search-ui-react.onselectparams.newfilter.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md) &gt; [newFilter](./search-ui-react.onselectparams.newfilter.md)

## OnSelectParams.newFilter property

The newly selected filter.

<b>Signature:</b>

```typescript
newFilter: FieldValueStaticFilter;
```
13 changes: 13 additions & 0 deletions docs/search-ui-react.onselectparams.setcurrentfilter.md
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) &gt; [@yext/search-ui-react](./search-ui-react.md) &gt; [OnSelectParams](./search-ui-react.onselectparams.md) &gt; [setCurrentFilter](./search-ui-react.onselectparams.setcurrentfilter.md)

## OnSelectParams.setCurrentFilter property

A function that sets which filter the component is currently associated with.

<b>Signature:</b>

```typescript
setCurrentFilter: (filter: StaticFilter) => void;
```
18 changes: 17 additions & 1 deletion etc/search-ui-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { AnalyticsConfig } from '@yext/analytics';
import { AnalyticsService } from '@yext/analytics';
import { AutocompleteResponse } from '@yext/search-headless-react';
import { DirectAnswer as DirectAnswer_2 } from '@yext/search-headless-react';
import { FieldValueStaticFilter } from '@yext/search-headless-react';
import { FilterSearchResponse } from '@yext/search-headless-react';
import { HighlightedValue } from '@yext/search-headless-react';
import { LngLat } from 'mapbox-gl';
import { LngLatBounds } from 'mapbox-gl';
Expand All @@ -24,6 +26,7 @@ import { SearchActions } from '@yext/search-headless-react';
import { SearchHeadless } from '@yext/search-headless-react';
import { SearchIntent } from '@yext/search-headless-react';
import { SearchParameterField } from '@yext/search-headless-react';
import { StaticFilter } from '@yext/search-headless-react';
import { UniversalLimit } from '@yext/search-headless-react';
import { UnknownFieldValueDirectAnswer } from '@yext/search-headless-react';
import { VerticalResults as VerticalResults_2 } from '@yext/search-headless-react';
Expand Down Expand Up @@ -217,6 +220,8 @@ export interface FilterGroupCssClasses {
optionsContainer?: string;
// (undocumented)
searchInput?: string;
// (undocumented)
titleLabel?: string;
}

// @public
Expand All @@ -241,7 +246,7 @@ export interface FilterOptionConfig {
}

// @public
export function FilterSearch({ searchFields, label, placeholder, searchOnSelect, sectioned, customCssClasses }: FilterSearchProps): JSX.Element;
export function FilterSearch({ searchFields, label, placeholder, searchOnSelect, onSelect, sectioned, customCssClasses }: FilterSearchProps): JSX.Element;

// @public
export interface FilterSearchCssClasses extends AutocompleteResultCssClasses {
Expand All @@ -263,8 +268,10 @@ export interface FilterSearchCssClasses extends AutocompleteResultCssClasses {
export interface FilterSearchProps {
customCssClasses?: FilterSearchCssClasses;
label?: string;
onSelect?: (params: OnSelectParams) => void;
placeholder?: string;
searchFields: Omit<SearchParameterField, 'fetchEntities'>[];
// @deprecated
searchOnSelect?: boolean;
sectioned?: boolean;
}
Expand Down Expand Up @@ -391,6 +398,15 @@ export type onSearchFunc = (searchEventData: {
query?: string;
}) => void;

// @public
export interface OnSelectParams {
currentFilter: StaticFilter | undefined;
executeFilterSearch: (query?: string) => Promise<FilterSearchResponse | undefined>;
newDisplayName: string;
newFilter: FieldValueStaticFilter;
setCurrentFilter: (filter: StaticFilter) => void;
}

// @public
export function Pagination(props: PaginationProps): JSX.Element | null;

Expand Down
Loading

0 comments on commit c0a58d9

Please sign in to comment.