Skip to content

Commit

Permalink
chore(action-menu): update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Anish Ranjan committed Aug 2, 2023
1 parent 083042e commit dfa44f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 9 additions & 3 deletions packages/action-menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,16 @@ An `<sp-action-menu>` parent will ensure that the internal `<sp-menu>` features

## Adding tootip in action menu

Tooltip in action menu can be added via a slot. It can be attached to action menu by adding <sp-action-menu> and giving various parameters (e.g. placement, content, etc) as needed.
Tooltip in action menu can be attached via adding <sp-tooltip> and can be customized by using various parameters (e.g. placement, content, etc) as needed.

```html
<sp-action-menu
<sp-tooltip slot='tooltip' self-managed placement='bottom'>'Content'</sp-tooltip>`
<sp-action-menu>
<sp-tooltip slot="tooltip" self-managed placement="bottom">
Content
</sp-tooltip>
<span slot="label">Available shapes</span>
<sp-menu-item value="shape-1-square">Square</sp-menu-item>
<sp-menu-item value="shape-2-triangle">Triangle</sp-menu-item>
<sp-menu-item value="shape-3-parallelogram">Parallelogram</sp-menu-item>
</sp-action-menu>
```
2 changes: 1 addition & 1 deletion packages/action-menu/src/ActionMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') {
<sp-icon-more class="icon"></sp-icon-more>
</slot>
<slot name="label" ?hidden=${!this.hasLabel}></slot>
<slot name="tooltip" ?hidden=${this.open}></slot>
<slot name="tooltip"></slot>
`,
];
}
Expand Down
8 changes: 0 additions & 8 deletions packages/action-menu/stories/action-menu.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,6 @@ iconOnly.args = {
visibleLabel: '',
};

export const tooltipDescriptionAndPlacement = (
args: StoryArgs = {}
): TemplateResult => Template(args);
tooltipDescriptionAndPlacement.args = {
tooltipDescription: 'Dummy tooltip description on hovering action menu',
tooltipPlacement: 'bottom',
};

export const customIcon = (args: StoryArgs): TemplateResult => Template(args);
customIcon.args = {
customIcon: html`
Expand Down

0 comments on commit dfa44f5

Please sign in to comment.