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: [DS-209] Tooltip #517

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Feat: [DS-209] Tooltip #517

wants to merge 5 commits into from

Conversation

vicky-comeau
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Oct 29, 2024

🦋 Changeset detected

Latest commit: 1a6b0b0

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

This PR includes changesets to release 2 packages
Name Type
@hopper-ui/components Patch
basic Patch

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

Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for wl-hopper ready!

Name Link
🔨 Latest commit 1a6b0b0
🔍 Latest deploy log https://app.netlify.com/sites/wl-hopper/deploys/672a468e24069f00081c9933
😎 Deploy Preview https://deploy-preview-517--wl-hopper.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.

@vicky-comeau vicky-comeau marked this pull request as ready for review October 29, 2024 18:15
Copy link
Contributor

github-actions bot commented Oct 29, 2024

View Storybook

export const DisabledTrigger = {
render: args => (
<TooltipTrigger>
<PassiveTrigger data-testid="passive-trigger">
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to automatically detect something like this and add the wrapper inside the tooltip trigger^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm it would be ideal. off the top of my head I don't know, but I can check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as an update, I didn't find a way.

<TooltipTrigger>
<ListBox selectionMode="multiple">
<ListBoxItem id="1" isDisabled position="relative">
<PassiveTrigger data-testid="passive-trigger" width="auto" position="absolute" top="0" bottom="0" right="0" left="0" />
Copy link
Member

Choose a reason for hiding this comment

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

Oh no this synthax is really not appropriate for our DS.
i was expecting something a lot more similar to Orbiter

<Select placeholder="Planets">
    <TooltipTrigger>
        <ListBoxItem key="earth">Earth</ListBoxItem>
        <Tooltip>Home sweet home!</Tooltip>
    </TooltipTrigger>
    <TooltipTrigger>
        <ListBoxItem key="jupiter">Jupiter</ListBoxItem >
        <Tooltip>The fourth-brightest object in the sky</Tooltip>
    </TooltipTrigger>
    <TooltipTrigger>
        <ListBoxItem key="mars">Mars</ListBoxItem >
        <Tooltip>See you in 2026</Tooltip>
    </TooltipTrigger>
</Select>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you can't have anything between a list item and ListBox.
Also, when I put TooltipTrigger inside the ListBoxitem, there was also an error.
I can try again to see if there's anything to be done, but I'm not sure.

Copy link
Member

Choose a reason for hiding this comment

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

There is lots of possible solution for this.

We can put the tooltip trigger inside the content ourselve inside the ListboxItem component
We can create a ListBoxItemTooltipTrigger component that is an item with a tooltip
We can drop to the hook level and create our own ListboxItem if necessary.

It's a matter of making a plan and investigating the different avenues.

...styleProp
};

return (
Copy link
Member

Choose a reason for hiding this comment

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

This passive trigger is not focusable and has no focusable style. This lack of accessibility + mobile usage should be reflected in the jsdoc and in the documentation.

}
} satisfies Story;

export const DisabledListItem = {
Copy link
Member

Choose a reason for hiding this comment

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

This story should be in the listbox.stories.tsx. Tooltip is going to be used in other components

@vicky-comeau vicky-comeau marked this pull request as draft November 5, 2024 16:23
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.

4 participants