RocketCommunicationsInc / astro

Astro UXDS is a collection of guidelines, patterns and components for designing space-based user interface applications.
https://astrouxds.com
Other
115 stars 25 forks source link

Feat(Tooltip): Tooltip Component #992

Closed FMorrison87 closed 1 year ago

FMorrison87 commented 1 year ago

Brief Description

This PR adds a new component, rux-tooltip. This new Tooltip component offers a solution for developers to display incidental, text-based information based on a set trigger. Guidance is provided to address what sorts of elements should be tooltip triggers, but it is up to the developer to decide ultimately. Tooltips display on hover over, or focus in. Tooltip provides modification options for display and functionality in the form of props:

JIRA Link

Tooltip Component

Related Issue

General Notes

Motivation and Context

This new component provides a new way for Astro developers to display incidental information when the user hovers over, or focuses in on a set trigger.

Issues and Limitations

Types of changes

Checklist

changeset-bot[bot] commented 1 year ago

πŸ¦‹ Changeset detected

Latest commit: e36fba7b989523f344aebd96c9532349c92ef9ef

The changes in this PR will be included in the next version bump.

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

netlify[bot] commented 1 year ago

Deploy Preview for astro-preview ready!

Name Link
Latest commit e36fba7b989523f344aebd96c9532349c92ef9ef
Latest deploy log https://app.netlify.com/sites/astro-preview/deploys/63c063fa257b0500081c1576
Deploy Preview https://deploy-preview-992--astro-preview.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 settings.

markacianfrani commented 1 year ago

not sure if this is an actual issue or not yet but if you double click 'trigger' in the basic/index.html, it'll select 'trigger' and the first word in the tooltip message.

Screen Shot 2023-01-03 at 4 35 54 PM

markacianfrani commented 1 year ago

Given this:

<div style="display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1rem;">
                <rux-tooltip message="content" open>
                    <div style="border: 2px solid red; padding: 1rem;">
                        Trigger 1
                    </div>
                </rux-tooltip>
                <div style="border: 2px solid red; padding: 1rem;">
                    Trigger 2
                </div>
                <div style="border: 2px solid red; padding: 1rem;">
                    Trigger 3
                </div>
        </div>

Screen Shot 2023-01-04 at 11 55 05 AM

I would expect Trigger 1 to be the same width as Trigger 2 and 3.

If I explicitly set a width on the light dom trigger element, I would expect it to be 150px but Trigger 1 is showing as 186px where 2/3 are 150.

<div style="display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1rem;">
                <rux-tooltip message="content" open>
                    <div style="border: 2px solid red; padding: 1rem; width: 150px;">
                        Trigger 1
                    </div>
                </rux-tooltip>
                <div style="border: 2px solid red; padding: 1rem; width: 150px;">
                    Trigger 2
                </div>
                <div style="border: 2px solid red; padding: 1rem; width: 150px;">
                    Trigger 3
                </div>
        </div>
markacianfrani commented 1 year ago

Screen Shot 2023-01-09 at 1 43 53 PM

currently seeing an ish w/ storybook where delay is undefined. not sure if it makes sense to mark delay as optional because it does have a default value (800). that might be irrelevant though. we might just have to change the type to number

markacianfrani commented 1 year ago

/update-snapshots