-
Notifications
You must be signed in to change notification settings - Fork 44
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
"CTA" component - Main PR #115
Conversation
(cloned from button, will need some tweaks)
(not fully working yet)
(may be fine tuned later)
🦋 Changeset detectedLatest commit: 1f543c4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This pull request is being automatically deployed with Vercel (learn more). hds-flight-website – ./🔍 Inspect: https://vercel.com/hashicorp/hds-flight-website/Ht2Tp1inJPA3uhR1L2zQqcEe4KkV hds-components – ./🔍 Inspect: https://vercel.com/hashicorp/hds-components/EMJfFwZayRy6YC15YpL18YpxxFcW |
…e users notice we’re using code from the “Button” component
(some tests were missing, some other had different description/order than the other)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
As discussed with @jesdavpet, we'll wait for @evankerrigan to come back from time off and review this PR too. |
@didoo & @jesdavpet: 👋 Just catching up from being off and I wanted to double-check if there was specific feedback that you were seeking from me? Not sure if I’m well-suited to offer any useful commentary on this PR’s code changes, but after reading the summary of the changes, it does sound like the proposed changes will offer us a way out of the challenges outlined here 🙌 |
@jesdavpet can you chime on this? (see @evankerrigan question above) |
For context: the (not sure what would be a viable alternative, any ideas @MelSumner @hashicorp/design-systems ?) |
I don't think those deprecations are a showstopper, they're somewhat "normal" in Ember as addons needs to make updates as Ember updates. I actually can't find one of the most common ones, Reporting it was good, I think it's just repeated cause so many instances of the component on the website. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching up on the discussion on this PR, looks like @evankerrigan has approved of these changes from Cloud design's perspective.
I haven't reviewed the implementation details for this HDS component, only the documented Ember component API, which looks good to me @didoo. 👍 Nice work!
📌 Summary
This is a follow-up of the discussion around the introduction of a "CTA (Call To Action)" element in the design system, where we came to the decision to introduce this specific (and controversial) component as
"a link that looks exactly as a primary button"
(if it's a button that looks like a button... it's a
Hds::Button
)Notice: we have not created a specific CRD (Components Requirement Document) for this component, because is mirroring existing components and would have been a bit of wasted time (we know almost everything about how this CTA component should look and work).
Why it's called "Link(To)::Cta"
Because technically is a link (and we don't want to call it
Button::Cta
, this would lead to even more misunderstanding.Plus, has to follow the same approach of the
Link(To)::Standalone
component, to be able to differentiate internal vs. external links (this is because of how the internals of Ember work).That said, there is a chance that the name in Figma may be slightly different (apart from the "CTA" part). Is something we have initially discussed with @heatherlarsen but we never came to a conclusion. But on the code side this is something that we strongly want to keep as is in this PR (unless we find strong reasons for having a different naming).
Differences with the
Button (primary)
componentDespite being very similar to the
Button
component, there are some important differences to take into account:color
argument is pre-selected as primary (it needs to stand out as "call to action")isIconOnly
option (this would go against being a "call to action")type
option (it's not a button element)isDisabled
option (links can't be disabled)space
key when selected (being a<a>
elements that resembles a button, it needs to to mimic the behaviour of a real<button>
element)🛠️ Detailed description
In this PR I have:
Link::Cta
andLinkTo::Cta
components as add-onsLink/LinkTo::Standalone
andButton
implementation in JSButton (primary)
using directly thehds-button
classes within theLink/LinkTo::CTA
componentspace
key event listener to the componentLink/LinkTo::Standalone
components documentation, for consistencyLink::CTA
andLinkTo::CTA
components in separate pagesLink/LinkTo::Standalone
andButton
components to be more in sync with theLink/LinkTo::Cta
ones (now they're all very similar and consistent in content and structure)Button
component to make sure users will notice we’re using code from the “Button” component (I've used this website to generate the ASCII art)Link/LinkTo::Standalone
for consistencyNotice:
Link::Standalone
and theButton
documentation pages: if you prefer I can move them to another PR (the reason I didn't is that now they are all very similar, with similar content and structure, so it's easier to compare in the same preview/deploy) _Alternative solutions
We considered the option to share the
Button
styling using re-usable Sass mixins (and did a spike in code too).The
button.scss
file would have looked something like this:but we concluded that it would have been too much abstraction, and the cons would have out-weighted the pros.
📸 Screenshots
🔗 External links
👀 How to review
👉 Review by files changed
Reviewer's checklist:
💬 Please consider using conventional comments when reviewing this PR.