diff --git a/2nd-gen/packages/swc/.storybook/decorators/static-colors-demo.ts b/2nd-gen/packages/swc/.storybook/decorators/static-colors-demo.ts index 09dadde98d..e9e4e402d4 100644 --- a/2nd-gen/packages/swc/.storybook/decorators/static-colors-demo.ts +++ b/2nd-gen/packages/swc/.storybook/decorators/static-colors-demo.ts @@ -18,7 +18,7 @@ import type { DecoratorFunction } from '@storybook/types'; /** * Static color background settings - matching spectrum-css gradients */ -const staticColorSettings = { +export const staticColorSettings = { black: 'linear-gradient(45deg, rgb(255 241 246), rgb(238 245 255))', white: 'linear-gradient(45deg, rgb(64 0 22), rgb(14 24 67))', } as const; diff --git a/2nd-gen/packages/swc/.storybook/preview.ts b/2nd-gen/packages/swc/.storybook/preview.ts index 73e4673e0a..65ecef797a 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'; @@ -248,6 +249,7 @@ const preview = { 'Tools vs packages', 'Writing migration guides', 'Focus management', + 'Changelog strategy', ], 'Style guide', [ @@ -330,7 +332,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 +365,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', @@ -382,6 +392,11 @@ const preview = { ['Rendering and styling migration analysis'], 'Field label', ['Rendering and styling migration analysis'], + 'Grid', + [ + 'Accessibility migration analysis', + 'Rendering and styling migration analysis', + ], 'Help text', ['Rendering and styling migration analysis'], 'Illustrated message', @@ -391,12 +406,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', @@ -424,6 +443,7 @@ const preview = { 'Popover', [ 'Accessibility migration analysis', + 'Migration plan', 'Rendering and styling migration analysis', ], 'Progress bar', 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 0000000000..e13e8b5792 --- /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 | `