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: add tip slot to customize tip content #7150

Merged
merged 4 commits into from May 13, 2024

Conversation

lstocchi
Copy link
Contributor

@lstocchi lstocchi commented May 10, 2024

What does this PR do?

This PR adds a tip slot so that one can customize the tip content.
In AI Lab we can use it to show the content multiline instead of a single line

Screenshot / video of UI

An example is the output i want to have in AI Lab.
tip_custom

What issues does this PR fix or reference?

N/A

How to test this PR?

run tests

  • Tests are covering the bug fix or the new feature

Copy link
Contributor

@axel7083 axel7083 left a comment

Choose a reason for hiding this comment

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

I am wondering if we should not use a so we could put whatever we want without being limited to text

@deboer-tim
Copy link
Collaborator

I assume you meant 'slot'. If so, +1. We may want more interesting tooltips in the future (e.g. include image or link) so slot would give more flexibility.

@lstocchi
Copy link
Contributor Author

Not sure to get it. Do you want something like?

<div class="relative inline-block">
  <span class="group tooltip-slot {$$props.class}">
    <slot />
  </span>
  <div
    class="whitespace-nowrap absolute tooltip opacity-0 inline-block transition-opacity duration-150 ease-in-out pointer-events-none z-[10]"
    class:left="{left}"
    class:right="{right}"
    class:bottom="{bottom}"
    class:top="{top}"
    class:top-left="{topLeft}"
    class:top-right="{topRight}"
    class:bottom-left="{bottomLeft}"
    class:bottom-right="{bottomRight}">
    <slot name="tip" />
  </div>
</div>

@lstocchi lstocchi force-pushed the tooltip_1 branch 2 times, most recently from 77b1330 to 15b3b03 Compare May 13, 2024 08:39
@lstocchi
Copy link
Contributor Author

@benoitf @axel7083 updated

@lstocchi lstocchi requested review from benoitf and axel7083 May 13, 2024 08:41
@lstocchi lstocchi changed the title feat: allow to add custom classes to tip feat: add tip slot to customize tip content May 13, 2024
@lstocchi lstocchi requested a review from axel7083 May 13, 2024 13:30
Copy link
Contributor

@axel7083 axel7083 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for taking the time to make the change! 🚀

@lstocchi lstocchi merged commit 17d4db0 into containers:main May 13, 2024
8 checks passed
@lstocchi lstocchi deleted the tooltip_1 branch May 13, 2024 14:19
@podman-desktop-bot podman-desktop-bot added this to the 1.11.0 milestone May 13, 2024
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.

None yet

5 participants