feat(SelectNext): add renderTag prop (DS-5070)#409
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 7cbcbcc): https://react-koobiq-next--prs-409-csi7of3o.web.app (expires Sat, 11 Jul 2026 12:17:55 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff |
There was a problem hiding this comment.
Pull request overview
Adds a renderTag customization hook to SelectNext (multiple selection mode) and refactors selected-tag rendering to use a new shared Tag component, removing the legacy SelectNext Tag/TagGroup implementations.
Changes:
- Introduced a new shared
Tagcomponent (with variants, slots, and i18n) and wired it intoSelectNext/SelectedTags. - Added
renderTagprop toSelectNext(andSelectedTags) plus a Storybook example and MDX docs section. - Removed legacy
SelectNext/components/Tag*andSelectNext/components/TagGroup*code and updated multiple-select tests.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/components/src/components/Tag/utils.ts | Adds variant mapping helper for Tag → IconButton. |
| packages/components/src/components/Tag/types.ts | Defines Tag public types (variants, slots, props). |
| packages/components/src/components/Tag/Tag.tsx | Implements new shared Tag component with optional remove button slot. |
| packages/components/src/components/Tag/Tag.module.css | Adds Tag styling (variants + state via data-attrs). |
| packages/components/src/components/Tag/intl.json | Adds localized remove label for the remove button. |
| packages/components/src/components/Tag/index.ts | Exports Tag component/types/utils. |
| packages/components/src/components/SelectNext/types.ts | Adds renderTag type and Tag-related types. |
| packages/components/src/components/SelectNext/Select.tsx | Switches multiple selected-tags rendering to SelectedTags; exposes SelectNext.Tag. |
| packages/components/src/components/SelectNext/Select.stories.tsx | Adds CustomTagRender story and updates story tags date. |
| packages/components/src/components/SelectNext/Select.mdx | Documents the new “Custom Tag Render” section. |
| packages/components/src/components/SelectNext/components/TagGroup/utils.ts | Removes legacy TagGroup hidden-count helper. |
| packages/components/src/components/SelectNext/components/TagGroup/TagGroupResponsive.tsx | Removes legacy responsive TagGroup implementation. |
| packages/components/src/components/SelectNext/components/TagGroup/TagGroupMultiline.tsx | Removes legacy multiline TagGroup implementation. |
| packages/components/src/components/SelectNext/components/TagGroup/TagGroup.tsx | Removes legacy TagGroup switch component. |
| packages/components/src/components/SelectNext/components/TagGroup/TagGroup.module.css | Removes legacy TagGroup styles. |
| packages/components/src/components/SelectNext/components/TagGroup/index.ts | Removes legacy TagGroup barrel export. |
| packages/components/src/components/SelectNext/components/Tag/utils.ts | Removes legacy SelectNext Tag variant mapping helper. |
| packages/components/src/components/SelectNext/components/Tag/Tag.tsx | Removes legacy SelectNext Tag component. |
| packages/components/src/components/SelectNext/components/Tag/index.ts | Removes legacy SelectNext Tag barrel export. |
| packages/components/src/components/SelectNext/components/index.ts | Stops exporting removed Tag/TagGroup components. |
| packages/components/src/components/SelectNext/tests/SelectMultiple.test.tsx | Adds coverage for default tags, renderTag, and renderValue precedence. |
| packages/components/src/components/SelectedTags/types.ts | Adds renderTag typing and TagProps dependency. |
| packages/components/src/components/SelectedTags/Tag/utils.ts | Removes legacy SelectedTags Tag mapping helper. |
| packages/components/src/components/SelectedTags/Tag/Tag.tsx | Removes legacy SelectedTags Tag component. |
| packages/components/src/components/SelectedTags/Tag/intl.json | Removes legacy SelectedTags Tag i18n (now centralized in Tag). |
| packages/components/src/components/SelectedTags/Tag/index.ts | Removes legacy SelectedTags Tag barrel export. |
| packages/components/src/components/SelectedTags/SelectedTagsResponsive.tsx | Implements renderTag support using new shared Tag + slotProps remove button. |
| packages/components/src/components/SelectedTags/SelectedTagsMultiline.tsx | Implements renderTag support using new shared Tag + slotProps remove button. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.