-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add grouped category listbox for ecosystem project form #1070
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
c6993dd
to
d3eb3a9
Compare
d3eb3a9
to
0310909
Compare
0310909
to
b6bbc13
Compare
children: React.ReactNode | ||
} | ||
|
||
export function ListboxOptionGroup({ |
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.
Would ListboxGroupHeader
describe this component better?
export function ListboxOptionGroup({ | |
export function ListboxGroupHeader({ |
@@ -14,19 +15,24 @@ export type OptionType = { | |||
|
|||
type ListboxOptionProps<Value extends OptionType> = { | |||
option: Value | |||
grouped?: boolean |
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.
Instead of passing a prop, which makes the child component dependent on the parent’s state, what about applying the following style directly to ListboxOptionGroup
:
<span className="block pl-1">
{children}
</span>
This approach improves encapsulation by keeping the spacing logic within ListboxOptionGroup
, ensuring that ListboxOption
components remain unaware of their surrounding context. It also maintains a clearer separation of concerns.
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.
@CharlyMartin - Looking good - Left a naming suggestion and encapsulation suggestion nit. Thank you. 🙌🏼
📝 Description
This PR adds a
FormListboxWithGroups
for the ecosystem project form.🛠️ Key Changes
components/Form/FormListboxWithGroups.tsx
andcomponents/Form/ControlledFormListboxWithGroups.tsx
components/Listbox/ListboxOptionGroup.tsx
following the - https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/ecosystem-explorer/utils/getGroupedCategoryOptions.ts
📌 To-Do Before Merging
📸 Screenshots
🔖 Resources