spartan
spartan copied to clipboard
docs(tooltip): add simple string tooltip example
#371
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
- [ ] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [x] Documentation content changes
- [ ] Other... Please describe:
Which package are you modifying?
- [ ] accordion
- [ ] alert
- [ ] alert-dialog
- [ ] aspect-ratio
- [ ] avatar
- [ ] badge
- [ ] button
- [ ] calendar
- [ ] card
- [ ] checkbox
- [ ] collapsible
- [ ] combobox
- [ ] command
- [ ] context-menu
- [ ] data-table
- [ ] date-picker
- [ ] dialog
- [ ] dropdown-menu
- [ ] hover-card
- [ ] icon
- [ ] input
- [ ] label
- [ ] menubar
- [ ] navigation-menu
- [ ] pagination
- [ ] popover
- [ ] progress
- [ ] radio-group
- [ ] scroll-area
- [ ] select
- [ ] separator
- [ ] sheet
- [ ] skeleton
- [ ] slider
- [ ] sonner
- [ ] spinner
- [ ] switch
- [ ] table
- [ ] tabs
- [ ] textarea
- [ ] toast
- [ ] toggle
- [x] tooltip
- [ ] typography
What is the current behavior?
Closes #371
What is the new behavior?
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Maybe it is better to name something like "Default" to "Template tooltip" and "Simple" to "String tooltip"?
Thanks for your work on this @OlegSuncrown!
I think I would go with Simple Tooltip and Custom Tooltip. What do you think?
Also, this is not a blocker for docs, but I am wondering if we should add another selector to the TooltipTrigger so one could do something like [hlmTooltipShowing]="'Simple text goes here'".
What do you think?
@goetzrobin Thanks for what you are doing. I can change on Simple Tooltip and Custom Tooltip?
Also, this is not a blocker for docs, but I am wondering if we should add another selector to the TooltipTrigger so one could do something like [hlmTooltipShowing]="'Simple text goes here'".
What do you think?
I think we could rename [hlmTooltipTrigger] on something like [tooltipContent], and do it similar to PrimeNg ?
Thanks for your work on this @OlegSuncrown!
I think I would go with Simple Tooltip and Custom Tooltip. What do you think?
Also, this is not a blocker for docs, but I am wondering if we should add another selector to the TooltipTrigger so one could do something like [hlmTooltipShowing]="'Simple text goes here'".
What do you think?
This means that an additional input is needed, or is there a trick to use the one input for both selectors? To Me the PR looks good.
Thanks for your work on this @OlegSuncrown! I think I would go with Simple Tooltip and Custom Tooltip. What do you think? Also, this is not a blocker for docs, but I am wondering if we should add another selector to the TooltipTrigger so one could do something like [hlmTooltipShowing]="'Simple text goes here'". What do you think?
This means that an additional input is needed, or is there a trick to use the one input for both selectors? To Me the PR looks good.
No I agree that we would need two inputs
This means that an additional input is needed, or is there a trick to use the one input for both selectors? To Me the PR looks good.
No I agree that we would need two inputs
@goetzrobin @elite-benni sorry for my late answer. It looks like new input is not required, from what I see, this is already working:
pass template as import
<button [hlmTooltipTrigger]="template" hlmBtn variant="outline">Open Html</button>
<ng-template #template>
<div class="flex items-center">
My html tooltip
<hlm-icon class="ml-2" size="sm" name="lucidePlus" />
</div>
</ng-template>
pass string as import
<button [hlmTooltipTrigger]="'My string tooltip'"hlmBtn variant="outline">
Open String
</button>
And if you like this version, I think this <hlm-tooltip></hlm-tooltip> can be removed at all.