Conversation
46fb58a to
6d8ddbe
Compare
89226bd to
21166a7
Compare
|
Hi @Kocal! Just pushed an update aligning this recipe with the patterns we've validated on the other Shadcn components shipped recently (notably hover-card #3478 merged earlier today). The original implementation relied on the pure-CSS The fix follows the same approach you confirmed for hover-card:
Companion PR for ux.symfony.com is updated too: symfony/ux.symfony.com#68. No rush at all, just letting you know it's ready for another look! 🙏 |
|
Thanks for this! Nice to see the hover behavior already moved from Blocking / conventions
Accessibility / behavior
Minor
|
|
^ I'm on it btw |
|
A couple of corrections to my review above, after checking against the shipped
One point still stands, but softer than I first put it: the The rest of the review stands, the README migration, |
21166a7 to
80b6c60
Compare
|
Thanks for the thorough review, and no worries about the noise! Rebased onto current
On keyboard access I went with your |
|
no no no I'm on it 😭 |
d99e3ed to
d0001b2
Compare
|
Oops, I read "I'm on it" as "I'm on the review", sorry for racing you on this one! 😅 #3801 is clearly the better version (shared viewport, overflow clamp, native trigger, |
|
Sorry it was obvious to me, but looking back, it wasn't clear at all 😓
Basically I'm telling Claude to "update the PR UX and ux.symfony.com + reference our Toolkit kit skill", and it is clever enough to do all the upgrades to make the recipe compliant to Toolkit 3.5 :) |
Adds the navigation-menu recipe to the Shadcn kit, superseding symfony#3484 (thanks @Amoifr): same component, reworked on top of current 3.x and aligned with the kit's current conventions. - Shadcn-style shared viewport: one Stimulus controller on the root <nav>, content panels moved into a single viewport that morphs between triggers (the "swipe"), positioned under the active trigger and clamped to stay within the viewport (LTR + RTL). - NavigationMenu:Trigger renders its own styled <button> + chevron (shadcn's navigationMenuTriggerStyle), so menu triggers and top-level links share the same height. - Keyboard: focusin/focusout keep the menu open while focus is inside it, and aria-expanded stays in sync. - Modern kit conventions: README.md inline live previews, tailwind_classes in attributes.defaults(), literal data-slot / value attributes, canonical manifest deps, version-added 3.5. Snapshots regenerated; kit-lint, PHPUnit, oxlint and oxfmt all pass.
This PR was merged into the 3.x branch. Discussion ---------- [Toolkit][Shadcn] Add navigation-menu recipe | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Part of #3233, replaces #3484 | License | MIT Adds the `navigation-menu` recipe to the Shadcn kit, superseding #3484 (thanks `@Amoifr`): same component, reworked on top of current `3.x` and aligned with the kit's current conventions. https://github.com/user-attachments/assets/2d61acb0-ae9b-449d-850e-79a9153e5a53 Highlights: - Shadcn-style shared viewport: one Stimulus controller on the root `<nav>`, content panels moved into a single viewport that morphs between triggers (the "swipe"), positioned under the active trigger and clamped to stay within the viewport (LTR + RTL). - `NavigationMenu:Trigger` renders its own styled `<button>` + chevron (shadcn's `navigationMenuTriggerStyle`), so menu triggers and top-level links share the same height. - Keyboard: `focusin` / `focusout` keep the menu open while focus is inside it, and `aria-expanded` stays in sync. - Modern kit conventions: `README.md` inline live previews, `tailwind_classes` in `attributes.defaults()`, literal `data-slot` / value attributes, canonical manifest deps, `version-added` 3.5. Snapshots regenerated; kit-lint, PHPUnit, oxlint and oxfmt all pass. Commits ------- 562232c [Toolkit][Shadcn] Add navigation-menu recipe
Adds the navigation-menu recipe to the Shadcn kit, superseding symfony/ux#3484 (thanks @Amoifr): same component, reworked on top of current 3.x and aligned with the kit's current conventions. - Shadcn-style shared viewport: one Stimulus controller on the root <nav>, content panels moved into a single viewport that morphs between triggers (the "swipe"), positioned under the active trigger and clamped to stay within the viewport (LTR + RTL). - NavigationMenu:Trigger renders its own styled <button> + chevron (shadcn's navigationMenuTriggerStyle), so menu triggers and top-level links share the same height. - Keyboard: focusin/focusout keep the menu open while focus is inside it, and aria-expanded stays in sync. - Modern kit conventions: README.md inline live previews, tailwind_classes in attributes.defaults(), literal data-slot / value attributes, canonical manifest deps, version-added 3.5. Snapshots regenerated; kit-lint, PHPUnit, oxlint and oxfmt all pass.
Adds the
navigation-menurecipe to the Shadcn kit.Part of the split of #3467 into one PR per component, tracking #3233.
The submenu opens on hover and on keyboard focus (a Stimulus controller toggles
data-stateon eachItem), and stays open while the focus moves between the trigger and the links of the submenu.Note: the ux.symfony.com companion PR (symfony/ux.symfony.com#68) is obsolete since kits are auto-discovered there.