Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

misama-ct
Copy link
Contributor

@misama-ct misama-ct commented Oct 22, 2024

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:

  • appearance: "filter" - new prop
  • optionStyle - new prop
  • always open options for select input
  • select input should not hold text
  • select utils updates for checkbox component
  • Replace "Select..." placeholder with "Search"
  • searchable options
  • input isCondensed
  • remove box-shadow
  • oprions border-radius of 4px
  • select options can optionally have a count value rendered to far right of checkbox option

Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: 89c68aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 98 packages
Name Type
@commercetools-uikit/select-input Minor
@commercetools-uikit/select-utils Minor
@commercetools-uikit/tag Minor
@commercetools-uikit/i18n Minor
@commercetools-uikit/data-table-manager Minor
@commercetools-uikit/filters Minor
@commercetools-uikit/pagination Minor
@commercetools-uikit/select-field Minor
@commercetools-uikit/inputs Minor
@commercetools-uikit/async-creatable-select-input Minor
@commercetools-uikit/async-select-input Minor
@commercetools-uikit/checkbox-input Minor
@commercetools-uikit/creatable-select-input Minor
@commercetools-uikit/date-input Minor
@commercetools-uikit/date-range-input Minor
@commercetools-uikit/date-time-input Minor
@commercetools-uikit/localized-money-input Minor
@commercetools-uikit/money-input Minor
@commercetools-uikit/search-select-input Minor
@commercetools-uikit/selectable-search-input Minor
@commercetools-uikit/quick-filters Minor
@commercetools-frontend/ui-kit Minor
@commercetools-uikit/data-table Minor
@commercetools-uikit/fields Minor
@commercetools-uikit/async-creatable-select-field Minor
@commercetools-uikit/async-select-field Minor
@commercetools-uikit/creatable-select-field Minor
@commercetools-uikit/date-field Minor
@commercetools-uikit/date-range-field Minor
@commercetools-uikit/date-time-field Minor
@commercetools-uikit/money-field Minor
@commercetools-uikit/search-select-field Minor
@commercetools-uikit/design-system Minor
@commercetools-uikit/calendar-time-utils Minor
@commercetools-uikit/calendar-utils Minor
@commercetools-uikit/hooks Minor
@commercetools-uikit/localized-utils Minor
@commercetools-uikit/utils Minor
@commercetools-uikit/accessible-hidden Minor
@commercetools-uikit/avatar Minor
@commercetools-uikit/card Minor
@commercetools-uikit/collapsible-motion Minor
@commercetools-uikit/collapsible-panel Minor
@commercetools-uikit/collapsible Minor
@commercetools-uikit/constraints Minor
@commercetools-uikit/field-errors Minor
@commercetools-uikit/field-label Minor
@commercetools-uikit/field-warnings Minor
@commercetools-uikit/grid Minor
@commercetools-uikit/icons Minor
@commercetools-uikit/label Minor
@commercetools-uikit/link Minor
@commercetools-uikit/loading-spinner Minor
@commercetools-uikit/messages Minor
@commercetools-uikit/notifications Minor
@commercetools-uikit/primary-action-dropdown Minor
@commercetools-uikit/progress-bar Minor
@commercetools-uikit/stamp Minor
@commercetools-uikit/text Minor
@commercetools-uikit/tooltip Minor
@commercetools-uikit/view-switcher Minor
@commercetools-uikit/accessible-button Minor
@commercetools-uikit/flat-button Minor
@commercetools-uikit/icon-button Minor
@commercetools-uikit/link-button Minor
@commercetools-uikit/primary-button Minor
@commercetools-uikit/secondary-button Minor
@commercetools-uikit/secondary-icon-button Minor
@commercetools-uikit/dropdown-menu Minor
@commercetools-uikit/localized-multiline-text-field Minor
@commercetools-uikit/localized-text-field Minor
@commercetools-uikit/multiline-text-field Minor
@commercetools-uikit/number-field Minor
@commercetools-uikit/password-field Minor
@commercetools-uikit/radio-field Minor
@commercetools-uikit/text-field Minor
@commercetools-uikit/time-field Minor
@commercetools-uikit/input-utils Minor
@commercetools-uikit/localized-multiline-text-input Minor
@commercetools-uikit/localized-rich-text-input Minor
@commercetools-uikit/localized-text-input Minor
@commercetools-uikit/multiline-text-input Minor
@commercetools-uikit/number-input Minor
@commercetools-uikit/password-input Minor
@commercetools-uikit/radio-input Minor
@commercetools-uikit/rich-text-input Minor
@commercetools-uikit/rich-text-utils Minor
@commercetools-uikit/search-text-input Minor
@commercetools-uikit/text-input Minor
@commercetools-uikit/time-input Minor
@commercetools-uikit/toggle-input Minor
@commercetools-uikit/spacings-inline Minor
@commercetools-uikit/spacings-inset-squish Minor
@commercetools-uikit/spacings-inset Minor
@commercetools-uikit/spacings-stack Minor
@commercetools-uikit/buttons Minor
@commercetools-uikit/spacings Minor
visual-testing-app Patch

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

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 1:26pm

@ddouglasz ddouglasz marked this pull request as ready for review October 24, 2024 14:31
@ddouglasz ddouglasz requested a review from a team as a code owner October 24, 2024 14:31
@ddouglasz ddouglasz requested review from stephsprinkle, jaikamat, ddouglasz, tylermorrisford, ByronDWall and a team and removed request for a team October 24, 2024 14:31
…boxes-for-options-in-multiselectable-select-inputs
Copy link
Contributor Author

@misama-ct misama-ct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the placeholder-condition is fixed (if it needs fixing) I'd say this can be implemented by the other Select-Inputs! Can't approve though, cause:

image

😄

props.placeholder || intl.formatMessage(messages.placeholder);
props.appearance === 'filter'
? intl.formatMessage(messages.selectInputAsFilterPlaceholder)
: props.placeholder || intl.formatMessage(messages.placeholder);
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor Author

@misama-ct misama-ct Oct 29, 2024

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).

Copy link
Contributor

@ddouglasz ddouglasz Oct 29, 2024

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

@ddouglasz ddouglasz closed this Oct 29, 2024
@ddouglasz ddouglasz deleted the FCT-1191-filters-select-inputs-display-checkboxes-for-options-in-multiselectable-select-inputs branch October 29, 2024 12:11
@ddouglasz ddouglasz restored the FCT-1191-filters-select-inputs-display-checkboxes-for-options-in-multiselectable-select-inputs branch October 29, 2024 12:12
@ddouglasz ddouglasz reopened this Oct 29, 2024
Ddouglasz added 2 commits November 6, 2024 14:23
…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
Copy link
Contributor

@ByronDWall ByronDWall left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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

Suggested change
font-size: 14px;
font-size: ${designTokens.fontSize20};

display: flex;
align-items: center;
font-weight: 400;
line-height: 18px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
line-height: 18px;
line-height: ${designTokens.lineHeight05};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants