-
Notifications
You must be signed in to change notification settings - Fork 11
Expose styling of facet headers in FilterGroup #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ lib/ | |
# testing | ||
/coverage | ||
/storybook-static | ||
|
||
.env | ||
test-site/.env |
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) > [FilterGroupCssClasses](./search-ui-react.filtergroupcssclasses.md) > [titleLabel](./search-ui-react.filtergroupcssclasses.titlelabel.md) | ||
|
||
## FilterGroupCssClasses.titleLabel property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
titleLabel?: string; | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { useSearchUtilities } from '@yext/search-headless-react'; | ||
import { PropsWithChildren, useMemo, useState } from 'react'; | ||
import { twMerge } from '../hooks/useComposedCssClasses'; | ||
import { | ||
CheckboxOption, | ||
CollapsibleLabel, | ||
CollapsibleLabelCssClasses, | ||
builtInCollapsibleLabelCssClasses, | ||
CollapsibleSection, | ||
FilterOptionConfig, | ||
SearchInput, | ||
|
@@ -17,6 +20,7 @@ import { | |
* @public | ||
*/ | ||
export interface FilterGroupCssClasses { | ||
titleLabel?: string, | ||
searchInput?: string, | ||
optionsContainer?: string, | ||
option?: string, | ||
|
@@ -75,11 +79,17 @@ export function FilterGroup({ | |
}; | ||
}, [customCssClasses]); | ||
|
||
const collapsibleLabelCssClasses: CollapsibleLabelCssClasses = useMemo(() => { | ||
return { | ||
label: cssClasses.titleLabel | ||
}; | ||
}, [cssClasses]); | ||
|
||
function renderTitle() { | ||
return collapsible | ||
? <CollapsibleLabel label={title} /> | ||
? <CollapsibleLabel label={title} customCssClasses={collapsibleLabelCssClasses} /> | ||
nmanu1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: (title && | ||
<div className='text-neutral-dark text-sm font-medium text-left mb-4'> | ||
<div className={twMerge('mb-4', builtInCollapsibleLabelCssClasses.label, collapsibleLabelCssClasses.label)}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking we could put this in the useMemo like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{title} | ||
</div>); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.