Skip to content

Commit

Permalink
feat(rich-tooltip): rename actiontext prop
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielduete committed Feb 12, 2025
1 parent a3580fa commit bcadb0a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export namespace Components {
}
interface AtomRichTooltip {
"action": 'hover' | 'click';
"actiontext": string;
"actionText": string;
"element": string;
"placement": | 'top'
| 'top-start'
Expand Down Expand Up @@ -645,7 +645,7 @@ declare global {
new (): HTMLAtomPaginationElement;
};
interface HTMLAtomRichTooltipElementEventMap {
"buttonaction": void;
"buttonAction": void;
}
interface HTMLAtomRichTooltipElement extends Components.AtomRichTooltip, HTMLStencilElement {
addEventListener<K extends keyof HTMLAtomRichTooltipElementEventMap>(type: K, listener: (this: HTMLAtomRichTooltipElement, ev: AtomRichTooltipCustomEvent<HTMLAtomRichTooltipElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -1020,9 +1020,9 @@ declare namespace LocalJSX {
}
interface AtomRichTooltip {
"action"?: 'hover' | 'click';
"actiontext"?: string;
"actionText"?: string;
"element"?: string;
"onButtonaction"?: (event: AtomRichTooltipCustomEvent<void>) => void;
"onButtonAction"?: (event: AtomRichTooltipCustomEvent<void>) => void;
"placement"?: | 'top'
| 'top-start'
| 'top-end'
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/components/rich-tooltip/rich-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export class AtomRichTooltip {
| 'left' = 'top'
@Prop() action: 'hover' | 'click' = 'hover'
@Prop() title?: string
@Prop() actiontext: string
@Prop() actionText: string

@Event() buttonaction: EventEmitter<void>
@Event() buttonAction: EventEmitter<void>

render() {
return (
Expand All @@ -46,9 +46,9 @@ export class AtomRichTooltip {
<p class='text'>
<slot />
</p>
{this.action === 'click' && this.actiontext && (
<p class='action' onClick={() => this.buttonaction.emit()}>
{this.actiontext}
{this.action === 'click' && this.actionText && (
<p class='action' onClick={() => this.buttonAction.emit()}>
{this.actionText}
</p>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ export const RichTooltipStoryArgs = {
category: Category.PROPERTIES,
},
},
actiontext: {
actionText: {
control: 'text',
description: 'Determines a text for action button.',
table: {
category: Category.PROPERTIES,
},
},
buttonaction: {
buttonAction: {
description:
'Event emitted when the action button is clicked. Action needs to be click to show the button.',
table: {
Expand Down Expand Up @@ -112,6 +112,6 @@ export const RichTooltipComponentArgs = {
text: 'Supporting line text lorem ipsum dolor sit amet, consectetur',
action: 'hover',
title: 'Title',
actiontext: 'Action Button',
actionText: 'Action Button',
open: false,
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const createRichTooltip = (args, buttonText = 'hover') => {
element="${args.element}"
title="${args.title}"
action="${args.action}"
actiontext="${args.actiontext}"
buttonaction="${args.buttonaction}"
action-text="${args.actionText}"
button-action="${args.buttonAction}"
open="${args.open}"
>
${args.text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ const createTooltip = (args, buttonText = 'Hover') => (
element={args.element}
title={args.title}
action={args.action}
actiontext={args.actiontext}
buttonaction={args.buttonaction}
actionText={args.actiontext}
open={args.open}
>
{args.text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const createTooltip = (args, buttonText = 'Hover') => ({
:element="args.element"
:title="args.title"
:action="args.action"
:actiontext="args.actiontext"
:buttonaction="args.buttonaction"
:actionText="args.actiontext"
:open="args.open"
>
{{ args.text }}
Expand Down

0 comments on commit bcadb0a

Please sign in to comment.