Skip to content

test: prototype component-aware base ui selectors - #460

Closed
tmm wants to merge 1 commit into
mainfrom
prototype/base-ui-selectors
Closed

tmm wants to merge 1 commit into
mainfrom
prototype/base-ui-selectors

Conversation

@tmm

@tmm tmm commented Oct 16, 2026

Copy link
Copy Markdown
Member

Type-only prototype of component-aware selector completion using a Zyzz-owned catalog and real Base UI 1.8 types. No runtime API or compiler changes.

// The existing component import supplies selector context.
style(Select.Item, {
  selectors: {
    "&[data-highlighted]": { backgroundColor: "blue" },
  },
})

The TypeScript language-service test verifies Item, Popup, Trigger, side values, nested selector blocks, and unsupported-component behavior. It also demonstrates the structural collision: an unrelated component with the same callback-state shape receives the same hints. Arbitrary CSS selectors remain allowed.

Upstream cooperation could attach an optional type-only attribute schema to each Base UI component export, including attribute value unions. Zyzz could consume that schema instead of matching state shapes, without changing the authoring syntax or adding runtime metadata. The fixture README includes an illustrative declaration and production follow-up requirements.

Validation: completion/consumer checks pass on TypeScript 6, focused TypeScript 7 checking passes, both styleFunction type-bench fixtures pass, and scoped formatting/lint pass. Repository-wide pnpm check:types was killed with exit 137 in this orb and is not reported as passing. No browser behavior is claimed by this type-only experiment.

@tmm tmm closed this Oct 16, 2026
@tmm
tmm deleted the prototype/base-ui-selectors branch October 16, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants