feat(vue): the Vue substrate, opening with Dialog - #38
Draft
ivanbanov wants to merge 2 commits into
Draft
Conversation
A new substrate under packages/vue, delivering the dialog machine to Vue 3 with the same anatomy and behavior contract as the React binding: - @dunky.dev/vue-dialog — the compound component (Trigger, Portal, Backdrop, Viewport, Content, Title, Description, Close) in Vue's native shape: core options as props, core callbacks as emits, v-model:open as the controlled contract. Content's initialFocus takes a MaybeRefOrGetter, resolved at open time so late-filling template refs work. - @dunky.dev/vue-use-focus-trap / vue-use-scroll-lock — the Vue lifecycle wrappers over the framework-free DOM utils. - @dunky-dev/vue — the private substrate harness (Storybook vue3-vite, pnpm dev:vue), with the story set mirroring the React scenarios. - scripts/templates/packages/vue — the scaffold stamps future primitives into this substrate too. The full React dialog behavior suite is ported (35 tests): dismissal gating and vetoes, controlled contract, ARIA wiring, focus management, layer stack containment, scroll lock scoping, back navigation, exit animations, nesting. Blocked on dunky-dev/state-machine#33: @dunky.dev/vue-state-machine is not on npm yet, so the lockfile is not committed here — refresh it once the adapter publishes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ster Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
The third web-facing substrate:
packages/vue, opening with Dialog. One core machine, a new host — behavior and a11y come from@dunky.dev/dialog; this binding only renders and wires the DOM concerns, per the architecture.@dunky.dev/vue-dialogThe compound component (
Dialog+Trigger/Portal/Backdrop/Viewport/Content/Title/Description/Close), hanging off the root so<script setup>'s dot-notation brings the whole compound with one import. The surface is Vue's native shape:onOpenChangeisupdate:open, sov-model:openis the controlled contract. Dismissal emits (@escape-key-down,@interact-outside,@back-navigation) carrypreventDefault()— listeners run synchronously, so the veto contract holds unchanged.Content'sinitialFocusis aMaybeRefOrGetter<HTMLElement | null>, resolved at open time — the Vue idiom for template refs that fill after setup.Portalis aTeleportgated on the core'smounted(soanimatedexits play throughclosing); scoped containers redirect the scroll lock, same as React.@dunky.dev/vue-use-focus-trap/@dunky.dev/vue-use-scroll-lockThe Vue lifecycle wrappers over the framework-free DOM utils. The trap follows the target ref (template refs fill after setup, so binding follows the element, not the call site); the lock takes
MaybeRefOrGetterfor both parameters.Substrate infra
@dunky-dev/vueprivate harness: Storybook (vue3-vite) on port 6007 viapnpm dev:vue, stories written withh()so no SFC tooling enters the build chain.scripts/templates/packages/vue—pnpm scaffold <name>now stamps the Vue substrate too.minimumReleaseAgeExcludefor the adapter's first publish.Verification
pnpm typecheck,pnpm lint,pnpm format:check,pnpm build(publint clean for all three new packages), and the Vue Storybook build all pass.pnpm knipstill reports the pre-existing native/expo noise from main; the new entries are the same mechanical class (jest moduleNameMapper paths, harness runtime dep) — left untouched since knip isn't a CI check.🤖 Generated with Claude Code