diff --git a/2nd-gen/packages/swc/.storybook/preview-head.html b/2nd-gen/packages/swc/.storybook/preview-head.html index bfd12babc7e..460dace092c 100644 --- a/2nd-gen/packages/swc/.storybook/preview-head.html +++ b/2nd-gen/packages/swc/.storybook/preview-head.html @@ -251,4 +251,27 @@ display: inline-block; } } + + .link-samples { + #storybook-root & { + background-color: var(--swc-gray-25); + padding: 1.5rem; + } + + &.link-samples--grid { + display: grid; + gap: 1rem; + } + + .link-row { + display: grid; + gap: 0.5rem; + } + + .link-meta { + display: flex; + align-items: last baseline; + gap: 0.5rem; + } + } diff --git a/2nd-gen/packages/swc/.storybook/preview.ts b/2nd-gen/packages/swc/.storybook/preview.ts index 73e4673e0ab..4f41ead0d92 100644 --- a/2nd-gen/packages/swc/.storybook/preview.ts +++ b/2nd-gen/packages/swc/.storybook/preview.ts @@ -27,6 +27,7 @@ import { transformDocsSource } from './utils/docs-source-transform.js'; import '../stylesheets/swc.css'; import '../stylesheets/typography.css'; +import '../stylesheets/link.css'; import '../stylesheets/global/global-elements.css'; import './assets/preview.css'; @@ -330,7 +331,10 @@ const preview = { 'Rendering and styling migration analysis', ], 'Action button', - ['Rendering and styling migration analysis'], + [ + 'Accessibility migration analysis', + 'Rendering and styling migration analysis', + ], 'Action group', ['Rendering and styling migration analysis'], 'Action menu', @@ -360,9 +364,14 @@ const preview = { 'Rendering and styling migration analysis', ], 'Button group', - ['Rendering and styling migration analysis'], + [ + 'Accessibility migration analysis', + 'Rendering and styling migration analysis', + ], 'Checkbox', ['Rendering and styling migration analysis'], + 'Close button', + ['Accessibility migration analysis'], 'Color field', ['Rendering and styling migration analysis'], 'Color loupe', @@ -391,12 +400,16 @@ const preview = { 'Rendering and styling migration analysis', ], 'Infield button', - ['Rendering and styling migration analysis'], + [ + 'Accessibility migration analysis', + 'Rendering and styling migration analysis', + ], 'Infield progress circle', ['Rendering and styling migration analysis'], 'Link', [ 'Accessibility migration analysis', + 'Migration plan', 'Rendering and styling migration analysis', ], 'Menu', diff --git a/2nd-gen/packages/swc/components/link/migration-guide.mdx b/2nd-gen/packages/swc/components/link/migration-guide.mdx new file mode 100644 index 00000000000..e13e8b5792e --- /dev/null +++ b/2nd-gen/packages/swc/components/link/migration-guide.mdx @@ -0,0 +1,137 @@ +import { Meta } from '@storybook/addon-docs/blocks'; + + + +# Link migration guide + +Spectrum 2 delivers links as **native `` elements** with CSS — there is no `swc-link` custom element. Replace `` with semantic anchors and the styles documented below. + +## Installation + +```bash +# Remove +yarn remove @spectrum-web-components/link + +# Add +yarn add @adobe/spectrum-wc +``` + +## Stylesheets + +| Stylesheet | Import | Purpose | +| ---------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------- | +| `typography.css` | `@adobe/spectrum-wc/typography.css` | Default link appearance inside **`.swc-Typography--prose`** and **`.swc-Typography--links`** | +| `link.css` | `@adobe/spectrum-wc/link.css` | BEM modifier classes for standalone / secondary / quiet / static-color anchors | +| `global-link.css` (optional) | `@adobe/spectrum-wc/global-link.css` | Opt-in baseline for **bare** `` without classes | + +> Default in-body and link-list styling ships with **Typography** — see the [Typography migration guide](../typography/migration-guide.mdx) for prose and wrapper patterns. This guide covers explicit link modifiers and migrating from `sp-link`. + +```js +// Prose / link lists (typography wrappers style unclassed anchors) +import '@adobe/spectrum-wc/typography.css'; + +// Explicit modifiers on individual anchors +import '@adobe/spectrum-wc/link.css'; +``` + +## What changed + +### Architecture + +| Area | Spectrum 1 (`sp-link`) | Spectrum 2 | +| -------------------- | --------------------------------------------- | ---------------------------------------------------- | +| Element | `` shadow host | Native `` | +| Presentation | `variant`, `quiet`, `static-color` attributes | BEM classes on `` (and typography wrappers) | +| In-body copy | Per-link custom element | `` inside `.swc-Typography--prose` | +| Link lists / footers | `sp-link` in lists | `