[add] Type Writer, Copy Overlay & Command Line components#11
Conversation
command-line public component and surface per-card install commands in demo page
README 已更新并补充 |
There was a problem hiding this comment.
Pull request overview
Ports a new command-line registry component into the Shadcn registry and wires it into the demo so every showcased component card surfaces an install command prompt.
Changes:
- Added a new
CommandLineMobX-powered client component (with typing + copy affordances) and a local example. - Registered
command-lineinregistry.jsonfor distribution via the registry. - Updated the demo UI (
ComponentCard+ homepage) to display per-card install commands and include a dedicatedcommand-lineshowcase entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| registry/new-york/blocks/command-line/index.tsx | Introduces the public CommandLine component (typing effect + copy UI). |
| registry/new-york/blocks/command-line/example.tsx | Adds a demo usage snippet for the new component. |
| registry.json | Registers command-line as a distributable registry item. |
| README.md | Adds command-line to the published registry links list. |
| components/example/component-card.tsx | Adds CommandLine to every component card, surfacing install commands. |
| app/page.tsx | Adds a dedicated command-line card/example to the homepage showcase. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| autoCopy = async () => { | ||
| const { text } = this.props; | ||
|
|
||
| if (text) | ||
| await navigator.clipboard.writeText(text); | ||
| }; |
| <small | ||
| className={cn( | ||
| "rounded bg-primary px-1.5 py-0.5 text-[10px] font-semibold text-primary-foreground transition-opacity", | ||
| active ? "opacity-100" : "opacity-0", | ||
| )} | ||
| > | ||
| Copied! | ||
| </small> |
| {...props} | ||
| > | ||
| <span className="select-none text-muted-foreground">$</span> | ||
| <kbd className="max-w-full overflow-x-auto whitespace-nowrap bg-transparent"> |
| <button | ||
| className={cn( | ||
| "inline-flex max-w-full items-center gap-2 rounded-md border px-3 py-2 font-mono text-sm", | ||
| className, | ||
| )} | ||
| type="button" | ||
| tabIndex={0} | ||
| onClick={(event: MouseEvent<HTMLButtonElement>) => { | ||
| void this.autoCopy(); | ||
| onClick?.(event); | ||
| }} | ||
| onFocus={(event) => { | ||
| this.active = true; | ||
| onFocus?.(event); | ||
| }} | ||
| onBlur={(event) => { | ||
| this.active = false; | ||
| onBlur?.(event); | ||
| }} | ||
| {...props} | ||
| > |
TechQuery
left a comment
There was a problem hiding this comment.
@copilot 打补丁来开启 SWC 对最新版装饰器语法的编译,并移除 Babel 依赖包和配置,以提高性能,参考:
orch-js/orch-js@47b28ee
Done in commit Patch (
|
2f6d8b5 to
9889d1b
Compare
[optimize] update Upstream packages
9889d1b to
4f094d6
Compare
command-line public component and surface per-card install commands in demo page
This PR ports the CommandLine prompt UI into this repository as a public Shadcn registry component, and applies it to the showcase so each component card displays its install command on the second row.
New public component:
command-lineregistry/new-york/blocks/command-line/index.tsxas a class-based MobX component.registry/new-york/blocks/command-line/example.tsxfor demo usage.Registry integration
command-lineentry inregistry.jsonso it is distributable viashadcn-helper.Demo card upgrade (all components)
components/example/component-card.tsxto render a second-row command prompt:Showcase inclusion
app/page.tsxto include a dedicatedcommand-linecomponent card and example.Human changes