vtex / shoreline

VTEX Design System for back-office experiences. Currently available for internal usage at VTEX.
https://shoreline.vtex.com
24 stars 1 forks source link

Anchor Component #1966

Closed vaporwavie closed 2 months ago

vaporwavie commented 2 months ago

Problem

Currently, Shoreline offers Link, which is an agnostic hyperlink handler. It's fantastic and does the job well. My proposal would be also offering a opinionated version called Anchor, which would not only be wrapped around Link, but also provide a built-in layout, while allowing the user to customize it even more.

Solution

I've wrote a prototype for this Anchor component here. It uses the same design system seen on Faststore Webops, which had its layout recently refined to adequate the same styling seen on Shoreline.

Usage examples

You can also see below how it works on Webops:

https://github.com/user-attachments/assets/2aa942dc-c559-4ad5-b16a-d7aefe0b7c30

Dependencies

no deps

References

This was made together with @renatamottam to guarantee that we'd have the best possible outcome following the provided design system.

matheusps commented 2 months ago

@beatrizmilhomem, and @davicostalf... Can you take a look at this? Did you see this same behavior on other Admin applications?

davicostalf commented 2 months ago

@davicostalf I still haven't seen other scenarios like this. Maybe a tertiary button would work in this scenario 🤔

beatrizmilhomem commented 2 months ago

@renatamottam you explored using the tertiary button, right?

I still haven't seen other scenarios like this.

Neither did I.

renatamottam commented 2 months ago

I did some testing, we can compare it here:

image

Some potential improvements using this Anchor component:

beatrizmilhomem commented 2 months ago

I agree the custom link works better here!

beatrizmilhomem commented 2 months ago

@vaporwavie Me, @davicostalf, and @matheusps discussed the issue, and our conclusion was that it doesn't make sense to create a new component or even a variation of the Link component right now since there are no other application scenarios. But the proposal hasn't been discarded, and it could be interesting to start doing studies about that.