Skip to content

Conversation

@mirka
Copy link
Member

@mirka mirka commented May 27, 2025

Closes DS-236

Proposed Changes

Adds the package reference for @wordpress/components to the DS site.

Components reference

Based on the component audit we did as a group in late 2024, I updated and verified all the links and information, and edited the content to be relevant to consumers from A8C.

Why are these changes being made?

To provide basic usage guidance on @wordpress/components components as we work on the new components library.

Testing Instructions

yarn && cd apps/design-system-docs and yarn start.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@mirka mirka self-assigned this May 27, 2025
@matticbot
Copy link
Contributor

matticbot commented May 27, 2025

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@mirka mirka changed the title [WIP] DS Site: Add @wordpress/components reference DS Site: Add @wordpress/components reference Jun 6, 2025
mirka added 2 commits June 7, 2025 01:40
# Conflicts:
#	apps/design-system-docs/package.json
@mirka mirka marked this pull request as ready for review June 6, 2025 16:52
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

Design System Reference Site Preview:

https://bf3ad454-preview.a8cds.workers.dev

(Latest commit: 998308b)

@matticbot
Copy link
Contributor

matticbot commented Jun 6, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • design-system-docs
  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug ds-wp-components on your sandbox.

Copy link
Member Author

@mirka mirka Jun 6, 2025

Choose a reason for hiding this comment

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

Please excuse the raw markdown output for the notes column in this MVP 😇

Copy link
Member

Choose a reason for hiding this comment

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

Related: I similarly needed to format raw Markdown in #103561 and opted to include react-markdown as used elsewhere in the project. Can be a future item.

@mirka mirka requested a review from a team June 6, 2025 17:05
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 6, 2025
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Nice 👍 LGTM

Copy link
Member

Choose a reason for hiding this comment

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

Related: I similarly needed to format raw Markdown in #103561 and opted to include react-markdown as used elsewhere in the project. Can be a future item.

Comment on lines 6 to 8
if ( ! href ) {
return null;
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: IMO, it'd make more sense to have WPComponentsTable avoid rendering IconLink if the link is empty, rather than handling that here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 5280683 👍

Comment on lines 6 to 7
return (
<Tooltip text={ statuses.find( ( s ) => s.value === status )?.label }>
Copy link
Member

Choose a reason for hiding this comment

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

Since we're using the corresponding statuses value 3 times, maybe we ought to assign a variable?

Suggested change
return (
<Tooltip text={ statuses.find( ( s ) => s.value === status )?.label }>
const { label, icon } = statuses.find( ( s ) => s.value === status )!;
return (
<Tooltip text={ label }>

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, fixed in 998308b.

Comment on lines 7 to 10
<Tooltip text={ statuses.find( ( s ) => s.value === status )?.label }>
<div
className={ styles[ 'status-indicator' ] }
aria-label={ statuses.find( ( s ) => s.value === status )?.label }
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to have both text= and aria-label= ? Is the Tooltip not already handling the accessible name / description?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great question. Short answer is yes, we need both here because Tooltip only applies an accessible description on focus, and screen readers can read this icon without it being focused.

The long answer is more interesting. At some point we discovered that a tooltip probably shouldn't be adding an accessible string by default. That was reported up to Ariakit, and now Ariakit doesn't do that anymore (ariakit/ariakit#3242). We haven't been able to propagate those new defaults to Gutenberg itself yet though, due to back compat (WordPress/gutenberg#66021).

@mirka mirka merged commit ec3277f into trunk Jun 9, 2025
11 of 12 checks passed
@mirka mirka deleted the ds-wp-components branch June 9, 2025 23:37
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 9, 2025
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