Skip to content

Conversation

@caseyisonit
Copy link
Contributor

Description

Motivation and context

Related issue(s)

  • fixes [Issue Number]

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result
  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

⚠️ No Changeset found

Latest commit: e54e1fe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5930

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

- Disabled state
- Loading/indeterminate state
- Error state
- Selected/active state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Selected/active state
- Selected/active state
- Readonly state

- Default/normal state
- Disabled state
- Loading/indeterminate state
- Error state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Error state
- Error state (valid or invalid)


Compare 2nd-gen against 1st-gen README.md for:

- [ ] Missing size options (xl is common)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does next gen have an xl size option?

- [ ] All size options documented with use cases
- [ ] All variant options documented with guidance
- [ ] Semantic variants have usage examples
- [ ] Non-semantic variants note 8-category limit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about the 8-category limit. Where is this info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s just what cursor came up with. We can modify that.

Copy link
Contributor

@nikkimk nikkimk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the addition of the cursor rules and the steps to simplify docs. I have added several suggestions to make sure we don't lose the quality and user experience of the documentation in the process of automating.

Comment on lines +19 to +20
### Essential sections

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Essential sections
### Section order
Main sections should follow the following order, skipping sections that are not applicable:
1. Installation
2. Anatomy
3. Options
4. States
5. Behaviors
6. Accessibility
### Essential sections

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think states should come before options but maybe we need to define these to be clear what we mean with those words

Comment on lines +25 to +28
5. **ANATOMY STORIES section** with visual separator (if applicable)
6. **STATES STORIES section** with visual separator (if applicable)
7. **OPTIONS STORIES section** with visual separator
8. **ACCESSIBILITY STORIES section** with visual separator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. **ANATOMY STORIES section** with visual separator (if applicable)
6. **STATES STORIES section** with visual separator (if applicable)
7. **OPTIONS STORIES section** with visual separator
8. **ACCESSIBILITY STORIES section** with visual separator
5. **ANATOMY STORIES section** with visual separator
6. **OPTIONS STORIES section** with visual separator (if applicable)
7. **STATES STORIES section** with visual separator (if applicable)
8. **BEHAVIORS STORIES section** with visual separator (if applicable)
9. **ACCESSIBILITY STORIES section** with visual separator (if applicable)

Comment on lines +42 to +48
## States

<SpectrumStories tag="states" />

## Options

<SpectrumStories tag="options" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## States
<SpectrumStories tag="states" />
## Options
<SpectrumStories tag="options" />
## Options
<SpectrumStories tag="options" />
## States
<SpectrumStories tag="states" />
## Behaviors
<SpectrumStories tag="behaviors" />

Comment on lines +72 to +82
// ──────────────────────────
// ANATOMY STORIES
// ──────────────────────────

// ──────────────────────────
// STATES STORIES
// ──────────────────────────

// ──────────────────────────
// OPTIONS STORIES
// ──────────────────────────
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ──────────────────────────
// ANATOMY STORIES
// ──────────────────────────
// ──────────────────────────
// STATES STORIES
// ──────────────────────────
// ──────────────────────────
// OPTIONS STORIES
// ──────────────────────────
// ──────────────────────────
// ANATOMY STORIES
// ──────────────────────────
// ──────────────────────────
// OPTIONS STORIES
// ──────────────────────────
// ──────────────────────────
// STATES STORIES
// ──────────────────────────
// ──────────────────────────
// BEHAVIORS STORIES
// ──────────────────────────

Comment on lines +172 to +203
### States stories

Stories demonstrating different states (if applicable):

```typescript
/**
* Description of this particular state.
*/
export const StateName: Story = {
render: (args) => html`
${template({ ...args /* state example */ })}
`,
tags: ['states'],
args: {},
};
```

### Options stories

Stories demonstrating variants, sizes, styles:

```typescript
/**
* Description of this option/variant.
*/
export const OptionName: Story = {
render: () => html`
${/* examples */}
`,
tags: ['options'],
};
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### States stories
Stories demonstrating different states (if applicable):
```typescript
/**
* Description of this particular state.
*/
export const StateName: Story = {
render: (args) => html`
${template({ ...args /* state example */ })}
`,
tags: ['states'],
args: {},
};
```
### Options stories
Stories demonstrating variants, sizes, styles:
```typescript
/**
* Description of this option/variant.
*/
export const OptionName: Story = {
render: () => html`
${/* examples */}
`,
tags: ['options'],
};
```
### Options stories
Stories demonstrating variants, sizes, styles:
```typescript
/**
* Description of this option/variant.
*/
export const OptionName: Story = {
render: () => html`
${/* examples */}
`,
tags: ['options'],
};
```
### States stories
Stories demonstrating different states (if applicable):
```typescript
/**
* Description of this particular state.
*/
export const StateName: Story = {
render: (args) => html`
${template({ ...args /* state example */ })}
`,
tags: ['states'],
args: {},
};
```
### Behaviors stories
Stories demonstrating different behaviors (if applicable):
```typescript
/**
* Description of this particular behavior.
*/
export const StateName: Story = {
render: (args) => html`
${template({ ...args /* behavior example */ })}
`,
tags: ['behaviors'],
args: {},
};
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behaviors stories should include things like methods, events, interaction, or anything the component does automatically, like truncation or text wrapping.

* Badges come in four sizes to fit various contexts:
*/
export const SemanticVariants: Story = {
export const Sizes: Story = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array mapping is showing up in the docs code snippet instead of the rendered HTML, so what if we try this?

Suggested change
export const Sizes: Story = {
const sizesTemplate = CONTAINER(Badge.VALID_SIZES.map(
(size) => html`
<swc-badge size=${size as BadgeSize}
>${capitalize(size)}</swc-badge
>
`
));
export const Sizes: Story = {

export const SemanticVariants: Story = {
export const Sizes: Story = {
render: () =>
CONTAINER(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CONTAINER(
sizesTemplate

Comment on lines +128 to 135
Badge.VALID_SIZES.map(
(size) => html`
<swc-badge size=${size as BadgeSize}
>${capitalize(size)}</swc-badge
>
`
)
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Badge.VALID_SIZES.map(
(size) => html`
<swc-badge size=${size as BadgeSize}
>${capitalize(size)}</swc-badge
>
`
)
),

* When the text is too long for the horizontal space available, it wraps to form another line.
*/
export const Sizes: Story = {
export const TextWrapping: Story = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is automatically done and not something consumers can control with the API, it should really move to behaviors.

/**
* When a badge's label is too long for the available horizontal space, it wraps to form another line. Text wrapping can be enforced when a `max-inline-size` is applied to the badge.
*/
export const Textwrapping: Story = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is automatically done and not something consumers can control with the API, it should really move to behaviors.

@nikkimk nikkimk self-requested a review December 10, 2025 16:31
@caseyisonit caseyisonit marked this pull request as ready for review December 10, 2025 17:46
@caseyisonit caseyisonit requested a review from a team as a code owner December 10, 2025 17:46
* - Secondary element description (optional)
* - Additional elements
*
* Components can contain X, Y, or both.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what X and Y are here.

- [ ] States section if component has states
- [ ] Disabled state documented if supported
- [ ] Accessibility Features section with numbered list
- [ ] Accessibility Best Practices section with bullet points
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be Accessibility features and Accessibility best practices?

@@ -0,0 +1,9 @@
# Installing local extensions in Cursor

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
The extensions in this directory are not available in Cursor but are in VSCode. The `vsix` file can be imported into Cursor.


1. Go to cursor, hit Cmd + Shift + P
2. Search for “Extensions: Install from VSIX…”
3. Select the extension file from this directory and download
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Select the extension file from this directory and download
3. Select the extension file from this directory

},
},
tags: ['!autodocs', '!dev'],
tags: ['!autodocs', '!dev'], // We only want the playground stories to be visible in the docs and sidenav. Since a majority of our stories are tagged with '!autodocs' and '!dev', we set those tags globally. We can opt in to visibility by adding the 'autodocs' or 'dev' tags to individual stories.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants