Skip to content

Update docs around the disabled prop and aria-disabled attribute#2946

Open
beaesguerra wants to merge 4 commits intomainfrom
aria-disabled-docs
Open

Update docs around the disabled prop and aria-disabled attribute#2946
beaesguerra wants to merge 4 commits intomainfrom
aria-disabled-docs

Conversation

@beaesguerra
Copy link
Member

@beaesguerra beaesguerra commented Jan 28, 2026

Summary:

Updating existing docs around the disabled prop across the components in the design system. We include details around how we will set the aria-disabled attribute internally so that the element remains focusable and is included in the tab order.

While going through the components that support a disabled prop, I found that the Checkbox and Radio components currently still use the disabled attribute instead of aria-disabled. I created WB-2218 for this!

Note: I also updated the prop docs descriptions defined in argTypes. I first tried to remove them so we could use the js docs for the props type, however, in the remaining cases, these descriptions wouldn't be auto-populated

Issue: WB-2204

Test plan:

Review updated docs make sense and disabled props across components are updated to explain the aria-disabled behaviour

@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: 520313a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@khanacademy/wonder-blocks-birthday-picker Patch
@khanacademy/wonder-blocks-search-field Patch
@khanacademy/wonder-blocks-date-picker Patch
@khanacademy/wonder-blocks-icon-button Patch
@khanacademy/wonder-blocks-clickable Patch
@khanacademy/wonder-blocks-dropdown Patch
@khanacademy/wonder-blocks-button Patch
@khanacademy/wonder-blocks-switch Patch
@khanacademy/wonder-blocks-cell Patch
@khanacademy/wonder-blocks-form Patch
@khanacademy/wonder-blocks-banner Patch
@khanacademy/wonder-blocks-card Patch
@khanacademy/wonder-blocks-modal Patch
@khanacademy/wonder-blocks-popover Patch
@khanacademy/wonder-blocks-accordion Patch
@khanacademy/wonder-blocks-link Patch
@khanacademy/wonder-blocks-pill Patch
@khanacademy/wonder-blocks-tooltip Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (df3275c) and published all packages with changesets to npm.

You can install the packages in frontend by running:

./dev/tools/deploy_wonder_blocks.js --tag="PR2946"

Packages can also be installed manually by running:

pnpm add @khanacademy/wonder-blocks-<package-name>@PR2946

…for the `disabled` props to include details about `aria-disabled` being set internally to keep an element focusable while in a disabled state
@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

Size Change: 0 B

Total Size: 115 kB

ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-accordion/dist/es/index.js 3 kB
packages/wonder-blocks-announcer/dist/es/index.js 1.74 kB
packages/wonder-blocks-badge/dist/es/index.js 2.02 kB
packages/wonder-blocks-banner/dist/es/index.js 2.01 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.92 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 755 B
packages/wonder-blocks-button/dist/es/index.js 4.25 kB
packages/wonder-blocks-card/dist/es/index.js 1.08 kB
packages/wonder-blocks-cell/dist/es/index.js 2.18 kB
packages/wonder-blocks-clickable/dist/es/index.js 2.6 kB
packages/wonder-blocks-core/dist/es/index.js 2.59 kB
packages/wonder-blocks-data/dist/es/index.js 5.48 kB
packages/wonder-blocks-date-picker/dist/es/index.js 4.82 kB
packages/wonder-blocks-dropdown/dist/es/index.js 19.5 kB
packages/wonder-blocks-form/dist/es/index.js 6.3 kB
packages/wonder-blocks-grid/dist/es/index.js 1.24 kB
packages/wonder-blocks-icon-button/dist/es/index.js 4 kB
packages/wonder-blocks-icon/dist/es/index.js 1.91 kB
packages/wonder-blocks-labeled-field/dist/es/index.js 3.48 kB
packages/wonder-blocks-layout/dist/es/index.js 1.63 kB
packages/wonder-blocks-link/dist/es/index.js 1.54 kB
packages/wonder-blocks-modal/dist/es/index.js 7.21 kB
packages/wonder-blocks-pill/dist/es/index.js 1.31 kB
packages/wonder-blocks-popover/dist/es/index.js 4.32 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.48 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.1 kB
packages/wonder-blocks-styles/dist/es/index.js 464 B
packages/wonder-blocks-switch/dist/es/index.js 1.55 kB
packages/wonder-blocks-tabs/dist/es/index.js 3.8 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.25 kB
packages/wonder-blocks-testing/dist/es/index.js 978 B
packages/wonder-blocks-theming/dist/es/index.js 384 B
packages/wonder-blocks-timing/dist/es/index.js 1.37 kB
packages/wonder-blocks-tokens/dist/es/index.js 5.01 kB
packages/wonder-blocks-toolbar/dist/es/index.js 906 B
packages/wonder-blocks-tooltip/dist/es/index.js 6.02 kB
packages/wonder-blocks-typography/dist/es/index.js 1.57 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-mioovvuvwt.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 91
Tests with visual changes 0
Total stories 772
Inherited (not captured) snapshots [TurboSnap] 369
Tests on the build 460

},
},
disabled: {
description: "Whether the cell is disabled.",
Copy link
Member Author

Choose a reason for hiding this comment

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

When I tried removing the description in the argtypes, the autodocs didn't include the jsdocs for the prop. I updated argtypes descriptions in these cases!

},
disabled: {
control: {type: "boolean"},
description: "Whether or not the action item is disabled.",
Copy link
Member Author

Choose a reason for hiding this comment

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

There are some cases where we were able to remove the description from the argtypes so that autodocs would pull the docs from the prop type instead!

Copy link
Member

Choose a reason for hiding this comment

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

yeah, it's tricky to find the root cause for this odd behavior. So far, I've noticed that jsdocs are not included automatically when props:

a) Are imported from a different file (e.g. type Props = AriaProps & CommonPropsFromAnotherFile)
b) Are using ReadOnly: type Props = ReadOnly<{...}>).
c) Are defined with discriminated union types (e.g. Clickable's type defs).

@beaesguerra beaesguerra marked this pull request as ready for review January 28, 2026 22:13
@khan-actions-bot khan-actions-bot requested a review from a team January 28, 2026 22:13
@khan-actions-bot
Copy link
Contributor

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/dirty-cheetahs-jog.md, __docs__/wonder-blocks-button/accessibility.mdx, __docs__/wonder-blocks-cell/compact-cell.argtypes.tsx, __docs__/wonder-blocks-clickable/clickable.argtypes.ts, __docs__/wonder-blocks-dropdown/action-item.argtypes.tsx, __docs__/wonder-blocks-dropdown/base-select.argtypes.ts, __docs__/wonder-blocks-dropdown/option-item.argtypes.tsx, __docs__/wonder-blocks-form/labeled-text-field.argtypes.ts, __docs__/wonder-blocks-form/text-field.argtypes.ts, packages/wonder-blocks-birthday-picker/src/components/birthday-picker.tsx, packages/wonder-blocks-button/src/util/button.types.ts, packages/wonder-blocks-cell/src/components/detail-cell.tsx, packages/wonder-blocks-cell/src/util/types.ts, packages/wonder-blocks-clickable/src/components/clickable.tsx, packages/wonder-blocks-date-picker/src/components/date-picker-input.tsx, packages/wonder-blocks-date-picker/src/components/date-picker.tsx, packages/wonder-blocks-dropdown/src/components/action-item.tsx, packages/wonder-blocks-dropdown/src/components/action-menu-opener-core.tsx, packages/wonder-blocks-dropdown/src/components/action-menu.tsx, packages/wonder-blocks-dropdown/src/components/dropdown-opener.tsx, packages/wonder-blocks-dropdown/src/components/multi-select.tsx, packages/wonder-blocks-dropdown/src/components/option-item.tsx, packages/wonder-blocks-dropdown/src/components/select-opener.tsx, packages/wonder-blocks-dropdown/src/components/single-select.tsx, packages/wonder-blocks-form/src/components/text-area.tsx, packages/wonder-blocks-icon-button/src/util/icon-button.types.ts, packages/wonder-blocks-search-field/src/components/search-field.tsx, packages/wonder-blocks-switch/src/components/switch.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot for improving the docs around this! we really needed to have more consistent docs 🚀

},
disabled: {
control: {type: "boolean"},
description: "Whether or not the action item is disabled.",
Copy link
Member

Choose a reason for hiding this comment

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

yeah, it's tricky to find the root cause for this odd behavior. So far, I've noticed that jsdocs are not included automatically when props:

a) Are imported from a different file (e.g. type Props = AriaProps & CommonPropsFromAnotherFile)
b) Are using ReadOnly: type Props = ReadOnly<{...}>).
c) Are defined with discriminated union types (e.g. Clickable's type defs).

Copy link
Member

Choose a reason for hiding this comment

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

suggestion: We probably don't need to bump a new version as the JSDocs are not included as part of the bundle created for consumers. This could be changed to create an empty changeset instead.

Here's an example of how a WB generated bundle looks like:

https://www.npmjs.com/package/@khanacademy/wonder-blocks-breadcrumbs?activeTab=code

Image

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh interesting, I thought we needed new versions released for the packages where we changed the component jsdocs, so that IDEs can use the updated docs for intellisense features! What do you think?

For the npm snapshot release for this PR, I see the updated jsdocs is included in the ts file (@khanacademy/wonder-blocks-button/dist/util/button.types.d.ts): https://www.npmjs.com/package/@khanacademy/wonder-blocks-button/v/0.0.0-PR2946-20260128221406?activeTab=code

image

Copy link
Member

Choose a reason for hiding this comment

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

Great point! this makes total sense :)

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.

3 participants