Repository navigation
Description
Hi! I built a shadcn-style component library on top of GPUIX: https://github.com/drewnekota/gpuix-ui (headless Dialog / Popover / DropdownMenu / Tabs / Checkbox / Switch / RadioGroup / Collapsible primitives, styled components, theme tokens, and an agent-chat example, all tested through createTestRoot). Your AGENTS.md asks outside contributors to open issues rather than PRs, so here are the things I hit that seem to belong upstream. Happy to turn any of them into a PR if you want one.
1. Select / Combobox find items by component identity
collectItems in select.js matches child.type === SelectItem. Any wrapper component around SelectItem (the whole point of the "wrap it in components/ui/select.tsx" pattern the README recommends) is invisible to it: items ends up empty, so SelectValue shows nothing and Up/Down/Enter do nothing, while the content still paints. I worked around it by having my styled Select rewrite <SelectItem> elements into primitive items before passing children down (see packages/ui/src/select.tsx).
Suggestion: let items register themselves through context on mount (the Radix approach) instead of walking the element tree, or expose a static marker (SelectItem.__gpuixItem = true) wrappers can copy. Combobox has the same shape.
2. Props and GpuixTheme types are not exported
StyleDesc, PublicInstance, EventPayload are exported from @gpuix/react, but Props (the div prop type) and GpuixTheme are not. A component library needs both constantly. I derive them from JSX.IntrinsicElements['div'] and NonNullable<JSX.IntrinsicElements['markdown']['theme']> via @gpuix/react/jsx-runtime, which works but is fragile.
3. Headless primitives that would fit next to Select / Combobox / Tooltip
Dialog, Popover, DropdownMenu, Tabs, Checkbox, Switch, RadioGroup, Collapsible. Mine live in packages/primitives/src/*.tsx and only use public API: <anchored deferred> with position: {x:0,y:0} for the modal layer (which turns out to be window-absolute, so no portal is needed), onMouseDownOutside for dismissal, tabIndex + autoFocus + renderer.focusElement for focus management, and a small mount-order registry for arrow-key navigation. Two things I could not do from userland and would love primitives for:
- Focus trap / Tab containment inside a dialog. Tab from the last focusable element in the panel walks out to the page behind the overlay.
focusNext/focusPreviousexist but there is no way to scope traversal to a subtree. - Measuring an element from JS (
getElementBoundsis test-only). Typeahead,align="center"on menus wider than the trigger, and "scroll the highlighted item into view" all want it.
4. Small things
- A filled child
divblocks the click on its parent (documented), which means every switch thumb / radio dot needspointerEvents: 'none'. ApointerEvents: 'none'default for children of an element that hasonClickand no handlers of their own might be friendlier, though I understand if that is too magic. floating.js(FloatingLayer,renderSlot,useControllableState,StateStyle) is not in theexportsmap, so a library has to copy it to build new floating primitives. Exporting it as@gpuix/react/floatingwould let third-party primitives share the same anchoring behaviour.
Thanks for GPUIX, it was a pleasure to build on. The whole thing, including the chat example with menus and dialogs, came together in a day on 0.7.0.
Activity
Let Select follow Base UI, and export library APIs for gpuix-ui.
release: @gpuix/[email protected] and @gpuix/[email protected]