Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(React): update more components to use Text, improve RTL support #14679

Merged

Conversation

tw15egan
Copy link
Member

Refs #14477
Refs #7264

Adds in more support for RTL mode by utilizing the Text component under the hood wherever we render visible text. Also sets the TextDirection at the root level of the story.

Changelog

New

  • Sets the TextDirection at the root level based on the Text Direction dropdown in storybook

Changed

  • Changed visible text nodes to use the Text component

Testing / Reviewing

Ensure there are no regressions when viewing the components in RTL or LTR mode

@netlify
Copy link

netlify bot commented Sep 18, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit ba9527a
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/651d816e086c610008ff9eec
😎 Deploy Preview https://deploy-preview-14679--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Sep 18, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 4347788
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6508a4b9e6580d0008f5b8bf
😎 Deploy Preview https://deploy-preview-14679--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Sep 18, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit ba9527a
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/651d816ea545ce0007b6475b
😎 Deploy Preview https://deploy-preview-14679--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
import React, { ReactNode, useEffect, useMemo, useRef } from 'react';
import { TextDirectionContext } from './TextDirectionContext';

export type TextDir = 'ltr' | 'rtl' | 'auto';
export type TextDir = 'ltr' | 'rtl' | 'auto' | string;
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed to add string because some components that were changed to Text were spreading ...other. This was causing TypeScript errors because the types for dir are string | undefined on ComponentProps (ListItem was throwing this)

@tw15egan tw15egan marked this pull request as ready for review September 22, 2023 15:51
@tw15egan tw15egan requested a review from a team as a code owner September 22, 2023 15:51
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Code looks good, though I still need to take a glance through the storybook on all these. Just one question below about the default.

packages/react/src/components/Text/Text.tsx Show resolved Hide resolved
Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

looks good 🔥

@tw15egan tw15egan added this pull request to the merge queue Oct 17, 2023
Merged via the queue into carbon-design-system:main with commit 5d00063 Oct 18, 2023
17 checks passed
@tw15egan tw15egan deleted the add-text-to-more-components branch October 18, 2023 04:10
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