Skip to content

docs: Added more fidelity on typedocs comments for Box and Button - #2780

Merged
somerandomdude merged 6 commits into
v5-alphafrom
v5-component-typedocs
Aug 27, 2026
Merged

docs: Added more fidelity on typedocs comments for Box and Button#2780
somerandomdude merged 6 commits into
v5-alphafrom
v5-component-typedocs

Conversation

@somerandomdude

@somerandomdude somerandomdude commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adding more detailed typedoc comments for component props so they can be removed from documentation.


Note

Medium Risk
Mostly comment-only, but renaming DialogProps to ModalProps in dialog.props.ts without matching updates in Dialog.tsx would break types/exports if merged as-is.

Overview
Expands JSDoc on *.props.ts interfaces across the UI package so generated docs can carry prop descriptions instead of duplicating them elsewhere. One-line summaries become multi-line blocks with clearer wording and @remarks where behavior, accessibility, or validation matter (e.g. Box display vs Flex/Grid, form error props as visual-only, dialog open/onClose, Popover/Tooltip triggers and portals).

Dialog props also renames the exported interface from DialogProps to ModalProps in dialog.props.ts while prop docs for header, onClose, and open are rewritten. packages/ui/src/version.ts bumps to 500alpha6.

Reviewed by Cursor Bugbot for commit bfbede9. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bfbede9

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

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated (UTC)
icons Ignored Ignored Aug 27, 2026 9:15pm
sanity-ui-storybook Ignored Ignored Aug 27, 2026 9:15pm
sanity-ui-workshop Ignored Ignored Aug 27, 2026 9:15pm
ui-docs Ignored Ignored Aug 27, 2026 9:15pm

Request Review

as?: InteractiveAs<T>
/** Composite prop for setting padding and gap */
/**
* Sets padding and gap to specify its size.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’ve noticed we're describing composite props in several different ways — maybe best to make consistent?

Suggested change
* Sets padding and gap to specify its size.
* Composite prop that sets padding and gap

fullWidth?: Responsive<boolean>
/** Starting icon */
/**
* Shows an icon in the start position (left side in left-to-right languages).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, these icons won't flip position for RTL languages — any chance this could be construed to suggest otherwise?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should use the term start if they don't flip direction.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would tend to agree!

language?: string
/** CSS **font-size** property */
/**
* Font size and line height from the code scale.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reading this with 'line height' made me question if I needed to provide two values (font size and line height). Also not sure that consumers will know what the 'code scale' is — but I reckon they should be familiar with the idea that we have ramps for font size in general. Maybe just this?

Suggested change
* Font size and line height from the code scale.
* Font size

as?: T
/** CSS **font-size** property */
/**
* Font size and line height, drawn from the same scale as Label.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Font size and line height, drawn from the same scale as Label.
* Font size

/** Element to render */
/**
* Semantic heading element to render.
* @remarks Always set this explicitly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This remark makes me wonder why as is optional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we discussed making it required, but we haven't gotten to that yet.

onClose: React.ReactEventHandler<HTMLDialogElement>
/** Whether the modal is open; defaults to false. */
/**
* Controls the modal.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Controls the modal.
* Controls the modal’s open state

as?: T
/** CSS **font-size** property */
/**
* Font size and line height from the body text scale.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Font size and line height from the body text scale.
* Font size

export interface TooltipGroupProps<T extends React.ElementType = 'div'> {
/** Element to render */
/**
* HTML element to render as.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* HTML element to render as.
* HTML element to render

/** Focusable trigger element */
/**
* The trigger element.
* @remarks Tooltip clones it to attach `aria-describedby` and the `interestfor` attribute that opens the label.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering if the remark here is more implementation detail than the average consumer needs…?

export interface VisuallyHiddenProps<T extends React.ElementType = 'span'> {
/** Element to render */
/**
* HTML element to render.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some of these say 'HTML element' and some say 'HTML element or component' — should they all be the latter, or do some not take components?

@colepeters
colepeters force-pushed the v5-component-typedocs branch from e19d087 to bfbede9 Compare August 27, 2026 21:15
@somerandomdude
somerandomdude merged commit 036c9fd into v5-alpha Aug 27, 2026
10 of 14 checks passed
@somerandomdude
somerandomdude deleted the v5-component-typedocs branch August 27, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants