#469

feat(shadcn): add target prop to Link

OpenAmronoswants to merge intofrom
  1. Link in @json-render/shadcn and @json-render/shadcn-svelte always opened in the same tab. A spec had no way to send the user to an external page without leaving the app.
  2. Link now takes target: "_self" | "_blank", nullable like the other optional props. With _blank it also sets rel="noopener noreferrer", so the opened page gets no window.opener and no referrer.
  3. Without target the rendered <a> is unchanged, so existing specs and model output keep working.
  4. The catalog description mentions _blank, so catalog.prompt() tells the model how to open a new tab. The shadcn and shadcn-svelte docs pages and skills list the new prop, and docs-baseline.json has the new hashes for the two docs pages.

Tests

  • New shadcn-svelte test: a _blank link renders target="_blank" and rel="noopener noreferrer".
  • @json-render/shadcn has no component tests, so I checked the built Link with renderToString: _blank renders target and rel, and null renders neither.
  • pnpm vitest run packages/shadcn-svelte: 7/7 pass.
  • check-types for both packages and their dependents, and lint for both packages, pass.

Written by Opus 5.5 (opus-5.5) through Sprocket.

Activity

2
vercel[bot]3d ago

@Amronos is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.