[Toolkit][Shadcn] Add dropdown-menu and sidebar recipes#3469
[Toolkit][Shadcn] Add dropdown-menu and sidebar recipes#3469Amoifr wants to merge 6 commits intosymfony:3.xfrom
Conversation
|
Can you change the base branch to 3.x please, the 2.x is not maintained anymore. Thanks! Status: Needs work |
65b4755 to
827749f
Compare
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry about this — rebased onto |
|
Main example Capture.video.du.2026-04-20.09-58-20.mp4 |
|
Basic example Capture.video.du.2026-04-20.10-08-18.mp4 |
|
Submenu example Capture.video.du.2026-04-20.11-12-36.mp4 |
|
Shortcuts example Capture.video.du.2026-04-20.11-13-52.mp4 |
|
With icons example Capture.video.du.2026-04-20.11-16-54.mp4 |
|
Checkboxes example Capture.video.du.2026-04-20.11-18-54.mp4 |
|
Checkboxes icons (better than ogiginal) Capture.video.du.2026-04-20.11-41-11.mp4 |
|
Radio group example : Capture.video.du.2026-04-20.11-46-33.mp4 |
|
Radio Icons example Capture.video.du.2026-04-20.11-55-44.mp4 |
|
Desctructive example Capture.video.du.2026-04-20.11-58-01.mp4 |
|
Avatar example Capture.video.du.2026-04-20.11-59-52.mp4 |
|
Complex example : Capture.video.du.2026-04-20.12-10-03.mp4 |
|
RTL example Capture.video.du.2026-04-20.14-05-27.mp4 |
827749f to
40ff3bb
Compare
…h shadcn reference
40ff3bb to
85838de
Compare
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element (button, link, span...). Since `DropdownMenu` relied on native `<details>`/`<summary>` to handle open/close, replace it with a `<div>` backed by a new `dropdown_menu_controller.js` Stimulus controller handling toggle, outside click and escape. Convert `SubTrigger` to the same convention (drop the hardcoded `<button>`/chevron; consumer now picks the wrapping element and adds the chevron). Migrate `Sub`/`SubContent` from the `peer/peer-hover` pattern to `group/group-hover` so the sub-menu still opens on hover once the peer anchor moves out of the template. Also drop two orphan snapshots (`Demo.html__1.html`, `Usage.html__1.html`) shipped by mistake and no longer generated by the test suite.
|
Reworked |
|
it would be great, to add the |
|
Hi @Lacoi! Good catch — that's a fair point, sidebar items are very often links rather than buttons, and several other Shadcn components in this PR already expose an @Kocal @smnandre — would you like me to fold this into the current PR, or keep it focused and address it in a follow-up once this one is in? Happy either way! |
Avoid duplicating the radio group `name` on each `DropdownMenu:RadioItem`. The parent `DropdownMenu:RadioGroup` now exposes its `name` to its direct children through a Twig variable; `RadioItem` falls back to it when its own `name` is omitted.
Hi 👋
Two more recipes from #3233 (previous batches: #3464, #3466, #3467, #3468). Still JS-free:
<details>/<summary>(same pattern as thepopoverrecipe in [Toolkit][Shadcn] Add menubar and popover recipes #3468). Ships withTrigger,Content,Item,Label, andSeparatorsub-components.<aside>) with asideprop (left/right). Ships withHeader,Content,Footer,Group,GroupLabel, andMenuButtonsub-components. Note: shadcn's official Sidebar supports collapse/expand via a context provider, which requires JS; this recipe ships the static-layout version — happy to drop it if you'd rather wait for the interactive variant.Each recipe has
Usage.html.twig,Demo.html.twig, and passing snapshot tests (252 tests, 504 assertions).Thanks! 🙏