-
Notifications
You must be signed in to change notification settings - Fork 25
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
FCT-1191: filters: select-inputs: display checkboxes for options in multiselectable select inputs #2975
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 89c68aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 98 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…boxes-for-options-in-multiselectable-select-inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
props.placeholder || intl.formatMessage(messages.placeholder); | ||
props.appearance === 'filter' | ||
? intl.formatMessage(messages.selectInputAsFilterPlaceholder) | ||
: props.placeholder || intl.formatMessage(messages.placeholder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? When appearance
is set to filter
, the placeholder
prop is essentially ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good question 🤔, from the design, it may seem like we want that to be search, but on a second thought now, I think I will change the logic to still capture a provided placeholder from prop. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the placeholder prop visible when provided, otherwise, use the default messages provided here: 86acbb5
return { | ||
Option: (props) => { | ||
const { | ||
// children, - not needed, its just the "label" props content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this bunch of comments (Line 13-26) is helpful/needed. (I copied the list of available props from react-select docs to figure out what's possible and added some remarks).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated here: 86acbb5 thank you
…boxes-for-options-in-multiselectable-select-inputs
…ptions-in-multiselectable-select-inputs' of https://github.com/commercetools/ui-kit into FCT-1191-filters-select-inputs-display-checkboxes-for-options-in-multiselectable-select-inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small nits, but this looks good to me for an initial update for checkboxes/filters
* Returns custom components to be used with react-select, when optionStyle is set to "checkbox" | ||
*/ | ||
type OptionType = { | ||
label: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the label
here be a ReactNode
? That would match what is being passed from TOption
, and allow for more complex (multiline, etc) options to be displayed
`background-color: ${designTokens.backgroundColorForInputWhenHovered};`} | ||
display: flex; | ||
justify-content: space-between; | ||
font-size: 14px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be fontsize20
font-size: 14px; | |
font-size: ${designTokens.fontSize20}; |
display: flex; | ||
align-items: center; | ||
font-weight: 400; | ||
line-height: 18px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line-height: 18px; | |
line-height: ${designTokens.lineHeight05}; |
Summary
This pull request introduces new properties to handle optional styling for the select input when used as a filter component. The most important changes include the addition of the
filter
appearance option and the incorporation of a search icon when this appearance is selected.This PR is opened also to add any other property we might want to add in the appearance option.
Filter-specific changes: