Skip to content

Commit 3c95b64

Browse files
caseyisonitnikkimkcdransfmarissahuysentruyt
authored
docs(storybook): comprehensive documentation infrastructure and component story migrations (#5916)
* initial stubbing (#5915) * chore: two ways of working with markdown files for guides * chore: cursor rule for migrating markdown to mdx if needed * chore: stubbed docs and ordered them * chore: lint fix * docs(a11y): added a11y guides to storybook (#5919) * docs(a11y): added a11y guides to storybook * docs(a11y): fixed typo * chore: two doc blocks to get custom docs added to the template (#5917) * chore: two doc blocks to get custom docs added to the template * chore: clean upa few things * chore: usage stories and descriptions for custom doc blocks * chore: streamlining tags in stories and created capitalize utility * chore: review fixes * chore: updated tags in stories to new pattern * docs: updated and formatted next-gen docs (#5924) * docs(progress-circle): updated and formatted progress circle dpcs * docs(divider): updated and formatted divider stories * docs(divider): added size args to stories * docs(status-ligt): updated status-light docs and stories * docs(progress-circle): added progress arg type for docs and stories * docs(divider): added description to stories and docs * docs(badge): added description to stories and docs * docs(status-light): made correction to docs * docs(status-light): made correction to docs * docs(badge): updated badge docs and stories * docs: fixed typos * docs: removed the 'usage' tag from stories * docs(assets): updates asset docs and stories * docs(asset): modified asset story (#5926) * docs: migrated contributor and project-planning docs (#5928) * docs(contributor-guides): mrigrated contributor guides * docs(contributor-docs): updated contributor docs to reflect storybook migration * docs(contributor-guides): updated based on new IA and use of storybook * docs(contributor-guides): fixed MDX errors * docs(contributor-guides): fixed TOC * docs(contributor-guides): fixed typo * docs(contributor-guides): fixed TOC * docs(project-planning): migrated project-planning docs to storybook * docs(project-planning): fixed typo * docs(guides): fixed links * docs: updated docs, decorators, and cursor rules (#5931) * chore: two doc blocks to get custom docs added to the template * chore: clean upa few things * chore: usage stories and descriptions for custom doc blocks * chore: streamlining tags in stories and created capitalize utility * chore: review fixes * chore: updated tags in stories to new pattern * chore: styling sturf and starting decorators * chore: all kinds of improvements * chore: working on static primary story but got smart links working * chore: clean up format and doc blocks * chore: migrated all 2nd gen to new format, made rules, working on styles * chore: removed tag from testing * chore: remove console logs * docs: updates rules for stories to include sections in the prescribed order * docs: updated rules to remove "demo" class recommendations for headings * docs: update exclusions for TOC headings in previews * docs: added rule to require that all stories are accessible * docs: status-light updates stories based on revised rules * docs: added additional styling parameters to flex layout decorator * docs: updated preview for better source code in docs * docs(status-light): updated status light based on new rules * docs(badge): updated docs according to updated rules * docs: updated flex-layout decorator for addtional styling options * docs: added a static colors decorator that displays both satic colors as a single story * docs: added a static colors decorator that displays both satic colors as a single story * docs: update rules to include static colors decorator * docs(divider): updated divider based on updated rules * docs: added a simple static colors exmaple to rules * docs(progress-circle): updated progress circle docs according to updated rules * docs(divider): simplified static colors story for divder and updated rules --------- Co-authored-by: Casey Eickhoff <ceickhoff@adobe.com> * garage week: docs rocks refinements (#5934) * docs: updated flex-layout decorator to opt-in * docs: updating stories * docs: updated stories and section order * docs: updated rules * docs: updated contributor docs for migrating stories * docs: updated documentation * docs: updated documentation * Merge branch 'garage-week/docs-rocks' of github.com:adobe/spectrum-web-components into nikkimk/docs-rocks-refinements * docs: updated docs and rules to include picsum photos * docs: removed static-color-wrapper helper * docs: fixed sorting of getting started docs * docs: Kari's edits (#5938) * docs: updated about SWC with Kari's edits * docs: renamed get-started to about-swc * docs: fixed table import * docs: added documentation styl guide to style guides * docs: make next round of Kari's edits (#5939) * chore: clean up patterns (#5935) * chore: fix weird react error, remove unused assets * chore: removed unused helper and update docs * chore: clean up a little, test the template pattern with slots * chore: adobt size arg fix from ruben and clean up * chore: direction addon in toolbar and some global controls * chore: status light story cleanup * chore: story clean up * chore: clean up and stories with types * chore: applying cleaner pattern * chore: fix broken badge type * chore: update rules and final styling * chore: clean up of flex styling * chore: progress circle clean * chore: asset and divider clean * chore: doc clean up with new patterns * chore: docs have pretty pictures and source code is linted * chore: the final pass * docs: moved docs to learn-about-swc * chore: apply suggestions from code review Co-authored-by: Nikki Massaro <5090492+nikkimk@users.noreply.github.com> * chore: the final final pass --------- Co-authored-by: Nikki Massaro <massaro@adobe.com> Co-authored-by: Nikki Massaro <5090492+nikkimk@users.noreply.github.com> * chore: tiny fixes and copywright lint fix * Update .vscode/local-extensions/README.md Co-authored-by: cdransf <445732+cdransf@users.noreply.github.com> * chore: markdown table applied * chore: update copywright * Apply suggestions from code review Co-authored-by: Marissa Huysentruyt <69602589+marissahuysentruyt@users.noreply.github.com> * chore(docs): removed guides for now * chore: removed unused image * docs: fixed typo Co-authored-by: Marissa Huysentruyt <69602589+marissahuysentruyt@users.noreply.github.com> * docs: removed a11y guides from CONTRIBUTOR-DOCS GitHub MD files * docs: fixed links * chore: status light types fix * chore: resolved all coversations * chore: revert status light type change * chore: yay styles work again * chore: remove css from stories doc rule * chore: combine mdx settings * Update 2nd-gen/packages/swc/components/badge/stories/badge.stories.ts Co-authored-by: Marissa Huysentruyt <69602589+marissahuysentruyt@users.noreply.github.com> * chore: fully templatizedddd baby --------- Co-authored-by: Nikki Massaro <5090492+nikkimk@users.noreply.github.com> Co-authored-by: Nikki Massaro <massaro@adobe.com> Co-authored-by: cdransf <445732+cdransf@users.noreply.github.com> Co-authored-by: Marissa Huysentruyt <69602589+marissahuysentruyt@users.noreply.github.com>
1 parent d278fc1 commit 3c95b64

File tree

134 files changed

+5062
-843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+5062
-843
lines changed

.cursor/rules/stories-documentation.mdc

Lines changed: 829 additions & 0 deletions
Large diffs are not rendered by default.

.cursor/rules/stories-format.mdc

Lines changed: 666 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Storybook MDX conversion
2+
3+
Converts markdown files to MDX format compatible with Storybook rendering.
4+
5+
## When to apply
6+
7+
Apply this rule when converting `.md` files to `.mdx` files for display in Storybook, particularly for documentation pages in the 2nd-gen SWC Storybook guides.
8+
9+
## Conversion steps
10+
11+
### 1. File extension and imports
12+
13+
- Change file extension from `.md` to `.mdx`
14+
- Add Storybook imports at the top of the file:
15+
16+
```typescript
17+
import { Meta } from '@storybook/addon-docs/blocks';
18+
```
19+
20+
- Add a blank line after imports
21+
22+
### 2. Meta tag
23+
24+
- Add a `<Meta title="Your Title Here" />` tag after the imports
25+
- The title should match the document's main heading
26+
- Add a blank line after the Meta tag
27+
28+
### 3. Convert HTML comments to JSX comments
29+
30+
Replace HTML comments with JSX-style comments:
31+
32+
**Before (Markdown):**
33+
34+
```markdown
35+
<!-- Document title (editable) -->
36+
```
37+
38+
**After (MDX):**
39+
40+
```mdx
41+
{/* Document title (editable) */}
42+
```
43+
44+
### 4. Preserve all other content
45+
46+
- Keep all markdown syntax as-is (headings, lists, links, code blocks, etc.)
47+
- Keep all `<details>` and `<summary>` HTML elements unchanged
48+
- Keep all list formatting and indentation unchanged
49+
- Preserve all relative link paths (e.g., `./01_contributor-guides/README.md`)
50+
- Do not modify any content within `<details>` blocks or navigation lists
51+
52+
## Example transformation
53+
54+
**Before (README.md):**
55+
56+
```markdown
57+
<!-- Document title (editable) -->
58+
59+
# Contributor Documentation
60+
61+
<!-- Generated TOC - DO NOT EDIT -->
62+
63+
<details open>
64+
<summary><strong>In this doc</strong></summary>
65+
66+
- [About Spectrum Web Components](#about-spectrum-web-components)
67+
68+
</details>
69+
70+
<!-- Document content (editable) -->
71+
72+
## About Spectrum Web Components
73+
74+
Content here...
75+
```
76+
77+
**After (README.mdx):**
78+
79+
```mdx
80+
import { Meta } from '@storybook/addon-docs/blocks';
81+
82+
<Meta title="Contributor Documentation" />
83+
{/* Document title (editable) */}
84+
85+
# Contributor Documentation
86+
87+
{/* Generated TOC - DO NOT EDIT */}
88+
89+
<details open>
90+
<summary><strong>In this doc</strong></summary>
91+
92+
- [About Spectrum Web Components](#about-spectrum-web-components)
93+
94+
</details>
95+
96+
{/* Document content (editable) */}
97+
98+
## About Spectrum Web Components
99+
100+
Content here...
101+
```
102+
103+
## Critical rules
104+
105+
1. **Only add imports and Meta tag** - Do not modify any other structural elements
106+
2. **Preserve exact formatting** - Keep all whitespace, indentation, and line breaks
107+
3. **Convert ALL HTML comments** - Every `<!-- comment -->` must become `{/* comment */}`
108+
4. **Keep markdown links** - Do not convert `.md` links to `.mdx` (Storybook may need the original paths)
109+
5. **Blank lines matter** - Maintain blank line after imports and after Meta tag
110+
111+
## Common mistakes to avoid
112+
113+
❌ Don't change the document's heading structure
114+
❌ Don't modify navigation lists or TOC content
115+
❌ Don't convert markdown to JSX (keep lists as markdown lists)
116+
❌ Don't add extra formatting or styling
117+
❌ Don't forget to convert ALL HTML comments to JSX comments

.vscode/extensions.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"recommendations": ["runem.lit-plugin"]
2+
"recommendations": [
3+
"runem.lit-plugin",
4+
"bierner.jsdoc-markdown-highlighting"
5+
]
36
}

.vscode/local-extensions/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Installing local extensions in Cursor
2+
3+
The extensions in this directory are not available in Cursor but are in VSCode. The `vsix` file can be uploaded to Cursor locally to install the extension for usage.
4+
5+
The following steps will get you started:
6+
7+
1. Go to cursor, hit Cmd + Shift + P
8+
2. Search for “Extensions: Install from VSIX…”
9+
3. Select the extension file from this directory and install
Binary file not shown.

.vscode/settings.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"[mdx]": {
33
"editor.wordWrapColumn": 120,
4-
"editor.wordWrap": "bounded"
4+
"editor.wordWrap": "bounded",
5+
"editor.codeActionsOnSave": {
6+
"source.organizeImports": "never"
7+
}
58
},
69
"[markdown]": {
710
"editor.wordWrapColumn": 120,
@@ -39,5 +42,11 @@
3942
},
4043
"typescript.tsdk": "node_modules/typescript/lib",
4144
"lit-plugin.strict": true,
42-
"cSpell.words": ["activedescendant", "coachmark", "valuetext"]
45+
"cSpell.words": [
46+
"activedescendant",
47+
"AUTODOCS",
48+
"coachmark",
49+
"effectful",
50+
"valuetext"
51+
]
4352
}

1st-gen/packages/dialog/src/DialogBase.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ import {
2020
} from '@spectrum-web-components/base';
2121
import { property } from '@spectrum-web-components/base/src/decorators.js';
2222

23-
import '@spectrum-web-components/underlay/sp-underlay.js';
2423
import '@spectrum-web-components/button/sp-button.js';
24+
import '@spectrum-web-components/underlay/sp-underlay.js';
2525

2626
// Leveraged in build systems that use aliasing to prevent multiple registrations: https://github.com/adobe/spectrum-web-components/pull/3225
27+
// eslint-disable-next-line import/no-extraneous-dependencies
2728
import '@spectrum-web-components/dialog/sp-dialog.js';
2829
import modalWrapperStyles from '@spectrum-web-components/modal/src/modal-wrapper.css.js';
2930
import modalStyles from '@spectrum-web-components/modal/src/modal.css.js';
30-
import { Dialog } from './Dialog.js';
3131
import { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared';
3232
import { firstFocusableIn } from '@spectrum-web-components/shared/src/first-focusable-in.js';
33+
import { Dialog } from './Dialog.js';
3334

3435
/**
3536
* @element sp-dialog-base

1st-gen/packages/dialog/src/DialogWrapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import '@spectrum-web-components/button/sp-button.js';
2323
import '@spectrum-web-components/underlay/sp-underlay.js';
2424

2525
// Leveraged in build systems that use aliasing to prevent multiple registrations: https://github.com/adobe/spectrum-web-components/pull/3225
26+
// eslint-disable-next-line import/no-extraneous-dependencies
2627
import '@spectrum-web-components/dialog/sp-dialog.js';
2728
import { Dialog } from './Dialog.js';
2829
import { DialogBase } from './DialogBase.js';

2nd-gen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This workspace contains the second generation of Spectrum Web Components, built
77
- **[@spectrum-web-components/core](./packages/core)** - Abstract base classes providing shared functionality
88
- **[@adobe/swc](./packages/swc)** - Concrete component implementations with styling
99

10-
## Getting Started
10+
## About SWC
1111

1212
```bash
1313
# Install dependencies from repository root

0 commit comments

Comments
 (0)