Skip to content

Commit

Permalink
feat(rich-tooltip): change name prop title
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielduete committed Feb 14, 2025
1 parent 7f491d0 commit c2cfe3a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export namespace Components {
"action": 'hover' | 'click';
"actionText"?: string;
"element": string;
"label"?: string;
"placement": | 'top'
| 'top-start'
| 'top-end'
Expand All @@ -239,7 +240,6 @@ export namespace Components {
| 'bottom-end'
| 'right'
| 'left';
"title"?: string;
}
interface AtomSelect {
"disabled"?: boolean;
Expand Down Expand Up @@ -1026,6 +1026,7 @@ declare namespace LocalJSX {
"action"?: 'hover' | 'click';
"actionText"?: string;
"element"?: string;
"label"?: string;
"onButtonAction"?: (event: AtomRichTooltipCustomEvent<void>) => void;
"placement"?: | 'top'
| 'top-start'
Expand All @@ -1035,7 +1036,6 @@ declare namespace LocalJSX {
| 'bottom-end'
| 'right'
| 'left';
"title"?: string;
}
interface AtomSelect {
"disabled"?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('AtomRichTooltip', () => {
open = false
) => `
<button id="${id}" aria-describedby="${id}--tooltip">Hover</button>
<atom-rich-tooltip id="${id}--tooltip" element="${id}" open="${open}" action="${action}" title="Test Title" actiontext="Click me">Tooltip content</atom-rich-tooltip>
<atom-rich-tooltip id="${id}--tooltip" element="${id}" open="${open}" action="${action}" label="Test Title" actiontext="Click me">Tooltip content</atom-rich-tooltip>
`

it('should render correctly', async () => {
Expand All @@ -19,7 +19,7 @@ describe('AtomRichTooltip', () => {
})

expect(page.root).toEqualHtml(`
<atom-rich-tooltip id="test-element--tooltip" element="test-element" open="false" action="hover" title="Test Title" actiontext="Click me" role="tooltip">
<atom-rich-tooltip id="test-element--tooltip" element="test-element" open="false" action="hover" label="Test Title" actiontext="Click me" role="tooltip">
<mock:shadow-root>
<atom-tooltip element="test-element" placement="top" action="hover" class="rich-tooltip">
<div class="rich-tooltip__content">
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/rich-tooltip/rich-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class AtomRichTooltip {
| 'right'
| 'left' = 'top'
@Prop() action: 'hover' | 'click' = 'hover'
@Prop() title?: string
@Prop() label?: string
@Prop() actionText?: string

@Event() buttonAction?: EventEmitter<void>
Expand All @@ -42,7 +42,7 @@ export class AtomRichTooltip {
class='rich-tooltip'
>
<div class='rich-tooltip__content'>
{this.title && <h1 class='title'>{this.title}</h1>}
{this.label && <h1 class='title'>{this.label}</h1>}
<p class='text'>
<slot />
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const RichTooltipStoryArgs = {
category: Category.PROPERTIES,
},
},
title: {
label: {
control: 'text',
description: 'Determines a title for tooltip.',
table: {
Expand Down Expand Up @@ -111,7 +111,7 @@ export const RichTooltipComponentArgs = {
placement: 'top',
text: 'Supporting line text lorem ipsum dolor sit amet, consectetur',
action: 'hover',
title: 'Title',
label: 'Title',
actionText: 'Action Button',
open: false,
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const createRichTooltip = (args, buttonText = 'hover') => {
id="atom-rich-tooltip"
placement="${args.placement}"
element="${buttonText}"
title="${args.title}"
label="${args.label}"
action="${args.action}"
action-text="${args.actionText}"
button-action="${args.buttonAction}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const createRichTooltip = (args, buttonText = 'Hover') => (
id='atom-rich-tooltip'
placement={args.placement}
element={buttonText}
title={args.title}
label={args.label}
action={args.action}
actionText={args.actionText}
open={args.open}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const createRichTooltip = (args, buttonText = 'Hover') => (
id='atom-rich-tooltip'
placement={args.placement}
element={buttonText}
tooltipTitle={args.tooltipTitle}
label={args.label}
action={args.action}
actiontext={args.actiontext}
actionText={args.actionText}
open={args.open}
>
{args.text}
Expand Down

0 comments on commit c2cfe3a

Please sign in to comment.