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(StringFormatter): new component StringFormatter #4249

Merged
merged 14 commits into from
Feb 15, 2024
Merged

feat(StringFormatter): new component StringFormatter #4249

merged 14 commits into from
Feb 15, 2024

Conversation

jlongshore
Copy link
Contributor

@jlongshore jlongshore commented Feb 8, 2024

Contributes to issue 4224

Migrate StringFormatter from Products v1 / Security / StringFormatter to Products v2 as StringFormatter.

v1 References: GitHub, Storybook.

What did you change?

  • Modified structure slightly to match Products' standards

How did you test and verify your work?

  • Storybook review.
  • Tests migrated and added to.
  • Design review by Cameron Calder.

jlongshore and others added 6 commits February 6, 2024 14:52
updated css
Updated DefinitionTooltip import (incorrect name)
Small changes to V11 component
Minor changes to proptype comments
Added overrides for tooltip overlay size and position
Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit a79a770
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/65cbf28e90bc600008154d44
😎 Deploy Preview https://deploy-preview-4249--carbon-for-ibm-products.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.

jlongshore and others added 3 commits February 8, 2024 12:58
Added description to the component
Updated the docs mdx page
@jlongshore jlongshore added version: 2 Carbon 11 / v2 area: migration ➡️ Migration of Security package to IBM Products labels Feb 8, 2024
@jlongshore jlongshore marked this pull request as ready for review February 8, 2024 23:43
@jlongshore jlongshore requested a review from a team as a code owner February 8, 2024 23:43
Copy link
Contributor

@davidmenendez davidmenendez 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! have a few comments on the code and one regarding the style

Screenshot 2024-02-09 at 11 17 21 AM

the line-height here seems a bit small? i don't see any design documentation that's accompanying this, so i don't know for certain. this might be nothing, but i just wanted to point out that it looks a bit squished.

export let StringFormatter = React.forwardRef(
(
{
// The component props, in alphabetical order (for consistency).
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as before about cleaning up comments

ref={ref}
{
// Pass through any other property values as HTML attributes.
...rest
Copy link
Contributor

Choose a reason for hiding this comment

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

prop spreading should always be first in order to avoid the user possibly overwriting them

* Only used internally
*/

let StringFormatterContent = React.forwardRef(
Copy link
Contributor

Choose a reason for hiding this comment

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

as a general convention we should always separate components into their own files. this seems small enough that i don't think it's strictly necessary to have it's own dedicated file. i think this code could just be lumped back into StringFormatter. either way is completely fine.

Put subcomponent into its own file
@jlongshore
Copy link
Contributor Author

the line-height here seems a bit small? i don't see any design documentation that's accompanying this, so i don't know for certain. this might be nothing, but i just wanted to point out that it looks a bit squished.

Yep, this thing should just inherit the line height, color - that kinda stuff from its parent or be set with a class or something. I think for the stories we just did body-01 type style and a text-primary color

@jlongshore jlongshore added this pull request to the merge queue Feb 15, 2024
Merged via the queue into carbon-design-system:main with commit 74d67d0 Feb 15, 2024
13 checks passed
@jlongshore jlongshore deleted the stringformatter_v2_4224 branch February 15, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: migration ➡️ Migration of Security package to IBM Products status: waiting for maintainer 💬
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants