Conversation
Ports Shadcn's Attachment component: root plus Media, Content, Title, Description, Actions, Action, Trigger and Group sub-components. No Stimulus controller, the component is purely presentational upstream. Classes are taken from registry/new-york-v4/ui/attachment.tsx, which is the flattened equivalent of registry/bases/radix plus its cn-attachment* classes expanded from style-nova.css. Three upstream utilities are defined in packages/shadcn/src/tailwind.css, which the kit does not ship, so they are substituted (following the scroll-area precedent of using stock Tailwind instead): * scrollbar-none -> no-scrollbar, which the pinned shadcn 4.6.0 baseline does define * shimmer -> animate-pulse on the title while uploading/processing * scroll-fade-x -> omitted; the scroll-driven original needs keyframes absent from the baseline, and a static mask would clip the edge cards when unscrolled
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.
Adds the
attachmentrecipe to the Shadcn kit, porting Shadcn's Attachment component: a file or image attachment with media, metadata, upload state and actions.It ships the root component plus
Media,Content,Title,Description,Actions,Action,TriggerandGroupsub-components. No Stimulus controller — the component is purely presentational upstream.All 6 upstream examples are reused as live-preview blocks in the recipe
README.md(hero, Image, States, Sizes, Group, Trigger), plus theRTLsection.Notes for reviewers
Upstream paths moved.
apps/v4/styles/radix-nova/ui/no longer exists andui-rtl/is gone entirely. Classes here come fromregistry/new-york-v4/ui/attachment.tsx, which I verified is the flattened equivalent ofregistry/bases/radix/ui/attachment.tsxplus itscn-attachment*classes expanded fromregistry/styles/style-nova.css.Three upstream utilities are substituted.
shimmer,scroll-fade-xandscrollbar-noneare defined inpackages/shadcn/src/tailwind.css, which the kit does not ship — the kit pinsshadcn/dist/tailwind.css4.6.0, which defines none of the three. Following thescroll-areaprecedent of substituting stock Tailwind:scrollbar-noneno-scrollbarshimmeranimate-pulseon the title whileuploading/processing@property,@keyframesandbackground-clip: textscroll-fade-xHappy to revisit if you'd rather bump the pinned
shadcnCSS package instead — that's a kit-wide change so I kept it out of this PR.Attachment:Triggertakes anasprop (likeButtonandItem) rather than exposing anattachment_trigger_attrsbag, since it carries no behaviour of its own — it is a positioned overlay. It composes withDialog:Triggeras<twig:Attachment:Trigger {{ ...dialog_trigger_attrs }} />, which the Trigger example exercises.type="button"is only emitted when it actually renders a<button>.Also adds 5 lucide icon fixtures (
file-code,file-search,file-text,file-warning,table) needed by the examples.Checks
bin/ux-toolkit-kit-lint --fail-on-warning kits/shadcncleantwig-cs-fixer,oxfmt --check,php-cs-fixer checkcleancommon/post-linksnapshot failure (an attribute-quoting difference on PHP 8.5, fails identically on a clean3.x)