api-report cleanup

Signed-off-by: Anders Näsman <andersn@spotify.com>
This commit is contained in:
Anders Näsman
2022-06-03 11:35:52 +02:00
committed by Eric Peterson
parent a7a0e2520a
commit b3d64b448e
18 changed files with 116 additions and 70 deletions
@@ -44,17 +44,28 @@ const useStyles = makeStyles(theme => ({
},
}));
/**
* @public
*/
export type FiltersState = {
selected: string;
checked: Array<string>;
};
/**
* @public
*/
export type FilterOptions = {
kind: Array<string>;
lifecycle: Array<string>;
};
type FiltersProps = {
/**
* Props for {@link Filters}.
*
* @public
*/
export type FiltersProps = {
filters: FiltersState;
filterOptions: FilterOptions;
resetFilters: () => void;
@@ -62,6 +73,9 @@ type FiltersProps = {
updateChecked: (filter: string) => void;
};
/**
* @public
*/
export const Filters = ({
filters,
filterOptions,
@@ -28,11 +28,19 @@ const useStyles = makeStyles(theme => ({
},
}));
type FiltersButtonProps = {
/**
* Props for {@link FiltersButton}.
*
* @public
*/
export type FiltersButtonProps = {
numberOfSelectedFilters: number;
handleToggleFilters: () => void;
};
/**
* @public
*/
export const FiltersButton = ({
numberOfSelectedFilters,
handleToggleFilters,
@@ -15,5 +15,6 @@
*/
export { FiltersButton } from './FiltersButton';
export type { FiltersButtonProps } from './FiltersButton';
export { Filters } from './Filters';
export type { FiltersState } from './Filters';
export type { FilterOptions, FiltersProps, FiltersState } from './Filters';
@@ -37,9 +37,7 @@ export type HomePageSearchBarProps = Partial<
>;
/**
* The search bar created specifically for the composable home page
*
* @public
* The search bar created specifically for the composable home page.
*/
export const HomePageSearchBar = ({ ...props }: HomePageSearchBarProps) => {
const classes = useStyles(props);
@@ -40,11 +40,10 @@ import {
} from '@backstage/plugin-search-react';
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* Props for {@link SearchBarBase}.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export type SearchBarBaseProps = Omit<InputBaseProps, 'onChange'> & {
debounceTime?: number;
@@ -55,13 +54,12 @@ export type SearchBarBaseProps = Omit<InputBaseProps, 'onChange'> & {
};
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* All search boxes exported by the search plugin are based on the <SearchBarBase />,
* and this one is based on the <InputBase /> component from Material UI.
* Recommended if you don't use Search Provider or Search Context.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export const SearchBarBase = ({
onChange,
@@ -153,20 +151,18 @@ export const SearchBarBase = ({
};
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* Props for {@link SearchBar}.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export type SearchBarProps = Partial<SearchBarBaseProps>;
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* Recommended search bar when you use the Search Provider or Search Context.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export const SearchBar = ({ onChange, ...props }: SearchBarProps) => {
const { term, setTerm } = useSearch();
@@ -29,9 +29,8 @@ import {
} from '@backstage/plugin-search-react';
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export type SearchAutocompleteFilterProps = SearchFilterComponentProps & {
filterSelectedOptions?: boolean;
@@ -41,7 +40,6 @@ export type SearchAutocompleteFilterProps = SearchFilterComponentProps & {
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
*/
export const AutocompleteFilter = (props: SearchAutocompleteFilterProps) => {
const {
@@ -24,9 +24,8 @@ import {
} from '@backstage/plugin-search-react';
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export type SearchFilterComponentProps = {
className?: string;
@@ -48,9 +47,8 @@ export type SearchFilterComponentProps = {
};
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export type SearchFilterWrapperProps = SearchFilterComponentProps & {
component: (props: SearchFilterComponentProps) => ReactElement;
@@ -58,6 +56,7 @@ export type SearchFilterWrapperProps = SearchFilterComponentProps & {
};
/**
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
const SearchFilter = ({
@@ -82,12 +81,12 @@ SearchFilter.Select = (
) => <SearchFilter {...props} component={SelectFilter} />;
/**
* @deprecated Moved to `@backstage/plugin-search-react`.
*
* A control surface for a given filter field name, rendered as an autocomplete
* textfield. A hard-coded list of values may be provided, or an async function
* which returns values may be provided instead.
*
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
SearchFilter.Autocomplete = (props: SearchAutocompleteFilterProps) => (
<SearchFilter {...props} component={AutocompleteFilter} />
@@ -50,6 +50,9 @@ export interface SearchModalChildrenProps {
toggleModal: () => void;
}
/**
* @public
**/
export interface SearchModalProps {
/**
* If true, it renders the modal.
@@ -167,6 +170,9 @@ export const Modal = ({ toggleModal }: SearchModalProps) => {
);
};
/**
* @public
*/
export const SearchModal = ({
open = true,
hidden,
@@ -87,6 +87,9 @@ export const UrlUpdater = () => {
return null;
};
/**
* @public
*/
export const SearchPage = () => {
const outlet = useOutlet();
@@ -30,6 +30,7 @@ const useStyles = makeStyles(theme => ({
}));
/**
* @public
* @deprecated Moved to `@backstage/plugin-search-react`.
*/
export const SearchResultPager = () => {
@@ -47,6 +47,8 @@ const useStyles = makeStyles(theme => ({
}));
/**
* Props for {@link SearchType}.
*
* @public
*/
export type SearchTypeProps = {
@@ -56,6 +58,9 @@ export type SearchTypeProps = {
defaultValue?: string[] | string | null;
};
/**
* @public
*/
const SearchType = (props: SearchTypeProps) => {
const { className, defaultValue, name, values = [] } = props;
const classes = useStyles();
@@ -21,10 +21,18 @@ import { rootRouteRef } from '../../plugin';
import { useRouteRef, IconComponent } from '@backstage/core-plugin-api';
import { SidebarSearchField, useContent } from '@backstage/core-components';
/**
* Props for {@link SidebarSearch}.
*
* @public
*/
export type SidebarSearchProps = {
icon?: IconComponent;
};
/**
* @public
*/
export const SidebarSearch = (props: SidebarSearchProps) => {
const searchRoute = useRouteRef(rootRouteRef);
const { focusContent } = useContent();
@@ -24,6 +24,11 @@ import {
useSearchModal,
} from '../SearchModal';
/**
* Props for {@link SidebarSearchModal}.
*
* @public
*/
export type SidebarSearchModalProps = {
icon?: IconComponent;
children?: (props: SearchModalChildrenProps) => JSX.Element;
+6 -1
View File
@@ -21,7 +21,12 @@
*/
export { Filters, FiltersButton } from './components/Filters';
export type { FiltersState } from './components/Filters';
export type {
FilterOptions,
FiltersState,
FiltersProps,
FiltersButtonProps,
} from './components/Filters';
export type { HomePageSearchBarProps } from './components/HomePageComponent';
export { SearchBar, SearchBarBase } from './components/SearchBar';
export type {
+14
View File
@@ -34,6 +34,9 @@ export const rootRouteRef = createRouteRef({
id: 'search',
});
/**
* @public
*/
export const searchPlugin = createPlugin({
id: 'search',
apis: [
@@ -50,6 +53,9 @@ export const searchPlugin = createPlugin({
},
});
/**
* @public
*/
export const SearchPage = searchPlugin.provide(
createRoutableExtension({
name: 'SearchPage',
@@ -59,10 +65,14 @@ export const SearchPage = searchPlugin.provide(
);
/**
* @public
* @deprecated Import from `@backstage/plugin-search-react` instead.
*/
export const SearchResult = RealSearchResult;
/**
* @public
*/
export const SidebarSearchModal = searchPlugin.provide(
createComponentExtension({
name: 'SidebarSearchModal',
@@ -76,10 +86,14 @@ export const SidebarSearchModal = searchPlugin.provide(
);
/**
* @public
* @deprecated Import from `@backstage/plugin-search-react` instead.
*/
export const DefaultResultListItem = RealDefaultResultListItem;
/**
* @public
*/
export const HomePageSearchBar = searchPlugin.provide(
createComponentExtension({
name: 'HomePageSearchBar',