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

Add "Link::Inline" component (05) #231

Merged
merged 27 commits into from
May 19, 2022
Merged

Conversation

didoo
Copy link
Contributor

@didoo didoo commented Apr 19, 2022

📌 Summary

This PR intends to add the missing counter-part of the Link::Standalone (a link that's used in isolation, not inline with adjacent text) component: the Link::Inline (a link that's used within a body of text).

Why not use just a <a> element?

Because in this way:

  • we can use the "logic" provided by the Hds::Interactive component to handle the different kinds of Ember links we need to support (<a>, <LinkTo>, <LinkToExternal>)
  • we can control the colors (by design, only primary ("action" color) and secondary (dark gray) should be used)
  • we can control in detail the visual treatment of the interaction states (hover/active/focus)

🛠️ Detailed description

In this PR I have:

  • added Link::Inline component
    • to resolve some issues with whitespace (see below) I had to slightly modify the template of the Interactive component
  • added documentation page (preview here)
  • added tests (integration + percy)

🚨 Known issues

🔗 Links

TODOs


👀 How to review

👉 Review by files changed

Reviewer's checklist:

  • +1 Percy if applicable

💬 Please consider using conventional comments when reviewing this PR.

@changeset-bot
Copy link

changeset-bot bot commented Apr 19, 2022

⚠️ No Changeset found

Latest commit: 650b9aa

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
Copy link

vercel bot commented Apr 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
hds-components ✅ Ready (Inspect) Visit Preview May 19, 2022 at 4:19PM (UTC)
hds-flight-website ✅ Ready (Inspect) Visit Preview May 19, 2022 at 4:19PM (UTC)

@didoo didoo changed the title Spike link inline [WIP] Add "Link::Inline" component Apr 19, 2022
@didoo didoo changed the title [WIP] Add "Link::Inline" component [WIP] Add "Link::Inline" component (05) Apr 19, 2022
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 19, 2022 18:38 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components April 19, 2022 18:40 Inactive
@didoo didoo force-pushed the spike-unify-link-standalone branch 2 times, most recently from 6adf95c to 95f9a5c Compare April 20, 2022 15:52
@didoo didoo force-pushed the spike-link-inline branch from 4469dfd to 324d7e2 Compare April 20, 2022 18:52
@vercel vercel bot temporarily deployed to Preview – hds-components April 20, 2022 18:53 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 20, 2022 18:53 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 20, 2022 18:55 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components April 20, 2022 18:58 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 20, 2022 20:02 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components April 20, 2022 20:02 Inactive
@didoo didoo requested a review from a team April 21, 2022 07:58
@vercel vercel bot temporarily deployed to Preview – hds-components April 27, 2022 10:59 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 27, 2022 10:59 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 27, 2022 11:03 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components April 27, 2022 11:03 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website April 28, 2022 10:21 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components April 28, 2022 10:21 Inactive
@didoo didoo force-pushed the spike-unify-link-standalone branch from 92b39ce to 8c8e2ce Compare May 5, 2022 20:31
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 9, 2022 09:54 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 9, 2022 09:54 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 9, 2022 10:24 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 9, 2022 10:24 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 12, 2022 13:26 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 12, 2022 13:31 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 12, 2022 13:31 Inactive
@didoo
Copy link
Contributor Author

didoo commented May 12, 2022

I forgot that this won't be a component in Figma, so we'll need to add color styles/design tokens to Foreground for product designers.

For actions, we currently have --token-color-foreground-action --token-color-foreground-action-hover --token-color-foreground-action-active

what do you think about adding these? --token-color-foreground-action-secondary (neutral-700) --token-color-foreground-action-secondary-hover (neutral-600) --token-color-foreground-action-secondary-active (neutral-500)

@cveigt in theory yes, but in practice I have two counterpoints:

  • they're not really "semantic": in fact they're not used in the Link::Standalone(secondary)
  • we're introducing new "global" tokens (colors definitions), to solve the issue with only one small component; and following the suggestion it would mean add them here too:

screenshot_1441

what do you think @heatherlarsen ?

Copy link
Member

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

Technically this looks good – happy for it to be merged in the feature branch when the design comments are resolved.

@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 12, 2022 18:00 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 12, 2022 18:01 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 18, 2022 08:34 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 18, 2022 08:34 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 18, 2022 16:10 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 18, 2022 16:10 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-components May 18, 2022 17:45 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 18, 2022 17:45 Inactive
# Conflicts:
#	packages/components/addon/components/hds/interactive/index.hbs
#	packages/components/app/styles/@hashicorp/design-system-components.scss
#	packages/components/tests/acceptance/percy-test.js
#	packages/components/tests/dummy/app/templates/index.hbs
@vercel vercel bot temporarily deployed to Preview – hds-components May 19, 2022 11:08 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 19, 2022 11:08 Inactive
# Conflicts:
#	packages/components/tests/dummy/app/templates/index.hbs
@vercel vercel bot temporarily deployed to Preview – hds-components May 19, 2022 16:18 Inactive
@vercel vercel bot temporarily deployed to Preview – hds-flight-website May 19, 2022 16:19 Inactive
Copy link
Contributor

@cveigt cveigt left a comment

Choose a reason for hiding this comment

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

LGTM 👍 -I like how the focus ring ended up looking. It looks better in the browser than in Figma with the same offset.

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.

3 participants