feat: add style.menu dropdown style overrides to PromptInput#4708
Draft
ernst-dev wants to merge 2 commits into
Draft
feat: add style.menu dropdown style overrides to PromptInput#4708ernst-dev wants to merge 2 commits into
ernst-dev wants to merge 2 commits into
Conversation
Adds a new `style.menu` sub-object to `PromptInputProps.Style` that lets design-system consumers (e.g. Horizon-Rhythm-Core) override the visual appearance of the trigger-based menus/shortcuts dropdown. New style properties: - style.menu.backgroundColor -> dropdown content-wrapper background - style.menu.borderColor -> dropdown border colour - style.menu.borderRadius -> dropdown border radius - style.menu.borderWidth -> dropdown border width Implementation: - 4 new custom CSS properties added to the generator list - getPromptInputStyles() maps them onto the root element as CSS vars - InternalPromptInput threads style.menu down to TokenMode - TokenMode builds a DropdownProps.Style and passes it to Dropdown - Existing Dropdown style API (dropdownContentBorder* CSS vars) reused - Unit tests updated; dev page added (menu-style.page.tsx)
Remove per-property JSDoc that restated prop names (inconsistent with sibling root/placeholder style sub-objects) and a redundant internal prop comment. Keep the public menu block doc + @awsuiSystem core tag, and add a short note on the DropdownProps.Style background<-backgroundColor bridge.
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.
Description
Extends
PromptInput'sstyleprop with astyle.menusub-object so consumers can theme the trigger-based command/shortcuts dropdown (the menu shown when a trigger character is typed) to match a custom design system.PromptInputProps.Style.menuadds four overrides:backgroundColor,borderColor,borderRadius, andborderWidth. Each maps to a CSS custom property ingetPromptInputStyles(). The value is threaded throughInternalPromptInput→TokenModeand reuses the internalDropdown's existingDropdownProps.StyleAPI. (DropdownProps.Stylenames the fillbackground; the bridge tobackgroundColoris intoken-mode.tsx.) The API is annotated@awsuiSystem core.A dev page for visual testing is included:
pages/prompt-input/menu-style.page.tsx.Related links, issue #, if available: n/a
How has this been tested?
src/prompt-input/__tests__/styles.test.tsxcovers the style → CSS-custom-property mapping and the Core-only gating (2/2 passing locally). The dev pagemenu-style.page.tsxwas used for manual visual verification of the dropdown styling overrides.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.