diff --git a/packages/common/src/components/Filter/types.ts b/packages/common/src/components/Filter/types.ts index 2218db25b..27a314619 100644 --- a/packages/common/src/components/Filter/types.ts +++ b/packages/common/src/components/Filter/types.ts @@ -41,4 +41,6 @@ export interface FilterTypeProps { * Language to be used for locale sensitive sorting/filtering. Defaults to 'en'. */ resolvedLanguage: string; + /** Text that explains how to use the filter. */ + helperText?: string | React.ReactNode; } diff --git a/packages/common/src/components/FilterGroup/FilterFromDef.tsx b/packages/common/src/components/FilterGroup/FilterFromDef.tsx index 2e981e8c0..79ecd7bd3 100644 --- a/packages/common/src/components/FilterGroup/FilterFromDef.tsx +++ b/packages/common/src/components/FilterGroup/FilterFromDef.tsx @@ -44,6 +44,7 @@ export const FilterFromDef = ({ supportedValues={def.values} supportedGroups={def.groups} resolvedLanguage={resolvedLanguage} + helperText={def.helperText} /> ) ); diff --git a/packages/common/src/utils/types.ts b/packages/common/src/utils/types.ts index 8f09beeea..7f30aaebe 100644 --- a/packages/common/src/utils/types.ts +++ b/packages/common/src/utils/types.ts @@ -1,3 +1,4 @@ +import React from 'react'; export interface EnumGroup { groupId: string; label: string; @@ -20,6 +21,7 @@ export interface FilterDef { // override default behavior if there are no filters provided by the user // by default missing/empty filters result in positive match (vacuous truth) defaultValues?: string[]; + helperText?: string | React.ReactNode; } type OpenApiJsonPath = string | ((resourceData: unknown) => unknown);