Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Product Design Review (PDR) document for a new Input primitive component in the Bento design system. The Input primitive is designed to be a headless, accessible foundation for all HTML input types, built on React Aria and Bento's slot system.
Key changes:
- Comprehensive PDR document covering architecture, accessibility, and implementation patterns for a universal Input primitive
- Detailed specification of slot-based architecture with data attributes for styling hooks
- Type-specific prop filtering system to handle different HTML input types appropriately
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| <Input | ||
| type="text" | ||
| value={value} | ||
| onChange={e => setValue(e.target.value)} |
There was a problem hiding this comment.
Is there a case for exposing this as a native listener callback over the cb(updateValue, metaObject) signature? This has been generally helpful on placing the setter directly on the onChange.
function ControlledInputExample() {
const [value, setValue] = React.useState('');
return (
<Input
type="text"
value={value}
onChange={setValue}
/>
);
}There was a problem hiding this comment.
This opens up a good discussion for setting a general pattern for all Bento primitives. I intended this to simply be forwarded attributes that we don't modify internally in order to minimize API differences between our primitive and the native input but I'm interested in hearing thoughts from the rest of the team.
Rendered PDR