From 5b0541243a89473f6367fcf5fd0199f7595f6e6e Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Mon, 24 Jul 2023 18:43:52 +0530 Subject: [PATCH 01/19] feat: action menu tooltip --- packages/action-menu/src/ActionMenu.ts | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index b5aa70749b..af2e3395e3 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -23,6 +23,7 @@ import '@spectrum-web-components/action-button/sp-action-button.js'; import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js'; import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js'; import actionMenuStyles from './action-menu.css.js'; +import { Placement } from '@spectrum-web-components/overlay'; /** * @element sp-action-menu @@ -42,6 +43,12 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { @property({ type: String }) public override selects: undefined | 'single' = undefined; + @property({ type: String }) + public tooltip_description = null; + + @property({ type: String }) + public tooltip_placement: Placement = 'none'; + protected override listRole: 'listbox' | 'menu' = 'menu'; protected override itemRole = 'menuitem'; private get hasLabel(): boolean { @@ -59,6 +66,26 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { ]; } + private renderTooltipPanel(): TemplateResult { + // change function name + if ( + this.tooltip_description != null && + this.tooltip_placement != 'none' + ) + return html` + + ${this.tooltip_description} + + `; + else if (this.tooltip_description != null) + return html` + + ${this.tooltip_description} + + `; + else return html``; + } + protected override render(): TemplateResult { return html` - ${this.buttonContent} + ${this.buttonContent} ${this.renderTooltipPanel()} `; } From 46d9dcc2da9348fc9f9bb5a739959514c09a514e Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Tue, 25 Jul 2023 15:31:44 +0530 Subject: [PATCH 02/19] feat: storybook changes --- packages/action-menu/src/ActionMenu.ts | 11 ++-- .../stories/action-menu.stories.ts | 52 +++++++++++++++++++ packages/action-menu/stories/index.ts | 4 ++ 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index af2e3395e3..d96ca7bd89 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -44,7 +44,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { public override selects: undefined | 'single' = undefined; @property({ type: String }) - public tooltip_description = null; + public tooltip_description = 'none'; @property({ type: String }) public tooltip_placement: Placement = 'none'; @@ -66,10 +66,9 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { ]; } - private renderTooltipPanel(): TemplateResult { - // change function name + private renderTooltip(): TemplateResult { if ( - this.tooltip_description != null && + this.tooltip_description != 'none' && this.tooltip_placement != 'none' ) return html` @@ -77,7 +76,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { ${this.tooltip_description} `; - else if (this.tooltip_description != null) + else if (this.tooltip_description != 'none') return html` ${this.tooltip_description} @@ -103,7 +102,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { @focus=${this.onButtonFocus} ?disabled=${this.disabled} > - ${this.buttonContent} ${this.renderTooltipPanel()} + ${this.buttonContent} ${this.renderTooltip()} `; } diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index bda0badeb9..011782dc42 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -57,6 +57,47 @@ export default { }, control: 'text', }, + tooltip_description: { + name: 'tooltip description', + type: { name: 'string', required: false }, + description: 'Tooltip description', + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'none' }, + }, + control: { + type: 'text', + }, + }, + tooltip_placement: { + name: 'tooltip placement', + type: { name: 'string', required: false }, + description: 'Tooltip Placement.', + table: { + defaultValue: { summary: 'none' }, + }, + control: { + options: [ + 'auto', + 'auto-start', + 'auto-end', + 'top', + 'bottom', + 'right', + 'left', + 'top-start', + 'top-end', + 'bottom-start', + 'bottom-end', + 'right-start', + 'right-end', + 'left-start', + 'left-end', + 'none', + ], + type: 'select', + }, + }, quiet: { name: 'quiet', type: { name: 'boolean', required: false }, @@ -75,6 +116,7 @@ export default { disabled: false, open: false, quiet: false, + tooltip_description: 'none', }, }; @@ -86,6 +128,8 @@ interface StoryArgs { selects?: 'single'; selected?: boolean; quiet?: boolean; + tooltip_description?: string | 'none'; + tooltip_placement?: string | 'none'; } const Template = (args: StoryArgs = {}): TemplateResult => @@ -114,6 +158,14 @@ iconOnly.args = { visibleLabel: '', }; +export const tooltip_description_placement = ( + args: StoryArgs = {} +): TemplateResult => Template(args); +tooltip_description_placement.args = { + tooltip_description: 'none', + tooltip_placement: 'none', +}; + export const customIcon = (args: StoryArgs): TemplateResult => Template(args); customIcon.args = { customIcon: html` diff --git a/packages/action-menu/stories/index.ts b/packages/action-menu/stories/index.ts index 9ec348cb5a..e01c967ab6 100644 --- a/packages/action-menu/stories/index.ts +++ b/packages/action-menu/stories/index.ts @@ -27,6 +27,8 @@ export const ActionMenuMarkup = ({ size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl', selects = '' as 'single', selected = false, + tooltip_description = 'none', + tooltip_placement = 'none', } = {}): TemplateResult => { return html` Date: Wed, 26 Jul 2023 17:45:33 +0530 Subject: [PATCH 03/19] feat(action-menu): tooltip slot --- packages/action-menu/src/ActionMenu.ts | 30 ++----------------- .../stories/action-menu.stories.ts | 9 +++--- packages/action-menu/stories/index.ts | 9 +++--- 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index d96ca7bd89..4a2957abfd 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -23,7 +23,7 @@ import '@spectrum-web-components/action-button/sp-action-button.js'; import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js'; import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js'; import actionMenuStyles from './action-menu.css.js'; -import { Placement } from '@spectrum-web-components/overlay'; +import '@spectrum-web-components/tooltip/sp-tooltip.js'; /** * @element sp-action-menu @@ -43,12 +43,6 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { @property({ type: String }) public override selects: undefined | 'single' = undefined; - @property({ type: String }) - public tooltip_description = 'none'; - - @property({ type: String }) - public tooltip_placement: Placement = 'none'; - protected override listRole: 'listbox' | 'menu' = 'menu'; protected override itemRole = 'menuitem'; private get hasLabel(): boolean { @@ -62,29 +56,11 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { + `, ]; } - private renderTooltip(): TemplateResult { - if ( - this.tooltip_description != 'none' && - this.tooltip_placement != 'none' - ) - return html` - - ${this.tooltip_description} - - `; - else if (this.tooltip_description != 'none') - return html` - - ${this.tooltip_description} - - `; - else return html``; - } - protected override render(): TemplateResult { return html` - ${this.buttonContent} ${this.renderTooltip()} + ${this.buttonContent} `; } diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index 011782dc42..bd3338d52e 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -74,7 +74,7 @@ export default { type: { name: 'string', required: false }, description: 'Tooltip Placement.', table: { - defaultValue: { summary: 'none' }, + defaultValue: { summary: 'bottom' }, }, control: { options: [ @@ -116,7 +116,8 @@ export default { disabled: false, open: false, quiet: false, - tooltip_description: 'none', + tooltip_description: 'Dummy tooltip description on hovering the menu', + tooltip_placement: 'bottom', }, }; @@ -162,8 +163,8 @@ export const tooltip_description_placement = ( args: StoryArgs = {} ): TemplateResult => Template(args); tooltip_description_placement.args = { - tooltip_description: 'none', - tooltip_placement: 'none', + tooltip_description: 'Dummy tooltip description on hovering the menu', + tooltip_placement: 'bottom', }; export const customIcon = (args: StoryArgs): TemplateResult => Template(args); diff --git a/packages/action-menu/stories/index.ts b/packages/action-menu/stories/index.ts index e01c967ab6..6b75ecf549 100644 --- a/packages/action-menu/stories/index.ts +++ b/packages/action-menu/stories/index.ts @@ -27,8 +27,8 @@ export const ActionMenuMarkup = ({ size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl', selects = '' as 'single', selected = false, - tooltip_description = 'none', - tooltip_placement = 'none', + tooltip_description = 'Dummy tooltip description on hovering the menu', + tooltip_placement = 'bottom', } = {}): TemplateResult => { return html` Save Selection Make Work Path + ${tooltip_description + ? html`${tooltip_description} `; }; From e88b4e2d20d8e6da0b6eafebea0bf7a9687126a1 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 26 Jul 2023 17:48:36 +0530 Subject: [PATCH 04/19] feat(action-menu): removed extra import --- packages/action-menu/src/ActionMenu.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index 4a2957abfd..aa9ab23100 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -23,7 +23,6 @@ import '@spectrum-web-components/action-button/sp-action-button.js'; import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js'; import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js'; import actionMenuStyles from './action-menu.css.js'; -import '@spectrum-web-components/tooltip/sp-tooltip.js'; /** * @element sp-action-menu From 76cd9d36d5de925b26a9368424089fb08335e9f6 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 26 Jul 2023 17:51:16 +0530 Subject: [PATCH 05/19] feat(action-menu): removed extra import --- packages/action-menu/src/ActionMenu.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index aa9ab23100..aa07e0da83 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -23,7 +23,6 @@ import '@spectrum-web-components/action-button/sp-action-button.js'; import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js'; import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js'; import actionMenuStyles from './action-menu.css.js'; - /** * @element sp-action-menu * From 764d7622eaa2446e8073341bef44a6d5ca6de9ca Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Thu, 27 Jul 2023 11:20:18 +0530 Subject: [PATCH 06/19] feat(action-menu): fixed comments --- packages/action-menu/README.md | 10 ++++++++ .../stories/action-menu.stories.ts | 24 +++++++++---------- packages/action-menu/stories/index.ts | 17 +++++++++---- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/packages/action-menu/README.md b/packages/action-menu/README.md index df4191f487..b3c839ef24 100644 --- a/packages/action-menu/README.md +++ b/packages/action-menu/README.md @@ -245,3 +245,13 @@ When `selects` is set to `single`, the `` element will maintain ## Accessibility An `` parent will ensure that the internal `` features a role of `listbox` and contains children with the role `option`. Upon focusing the `` using `ArrowDown` will also open the menu while throwing focus into first selected (or unselected when none are selected) menu item to assist in selecting of a new value. + +## Adding tootip in action menu + +Tooltip in action menu can be added via a slot. It can be attached to action menu by adding and giving various parameters (e.g. placement, content, etc) as needed. + +```html +'Content'` + +``` diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index bd3338d52e..99ac709fd7 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -57,8 +57,8 @@ export default { }, control: 'text', }, - tooltip_description: { - name: 'tooltip description', + tooltipDescription: { + name: 'Tooltip Description', type: { name: 'string', required: false }, description: 'Tooltip description', table: { @@ -69,8 +69,8 @@ export default { type: 'text', }, }, - tooltip_placement: { - name: 'tooltip placement', + tooltipPlacement: { + name: 'Tooltip Placement', type: { name: 'string', required: false }, description: 'Tooltip Placement.', table: { @@ -116,8 +116,8 @@ export default { disabled: false, open: false, quiet: false, - tooltip_description: 'Dummy tooltip description on hovering the menu', - tooltip_placement: 'bottom', + tooltipDescription: 'Dummy tooltip description on hovering action menu', + tooltipPlacement: 'bottom', }, }; @@ -129,8 +129,8 @@ interface StoryArgs { selects?: 'single'; selected?: boolean; quiet?: boolean; - tooltip_description?: string | 'none'; - tooltip_placement?: string | 'none'; + tooltipDescription?: string | 'none'; + tooltipPlacement?: string | 'none'; } const Template = (args: StoryArgs = {}): TemplateResult => @@ -159,12 +159,12 @@ iconOnly.args = { visibleLabel: '', }; -export const tooltip_description_placement = ( +export const tooltipDescriptionAndPlacement = ( args: StoryArgs = {} ): TemplateResult => Template(args); -tooltip_description_placement.args = { - tooltip_description: 'Dummy tooltip description on hovering the menu', - tooltip_placement: 'bottom', +tooltipDescriptionAndPlacement.args = { + tooltipDescription: 'Dummy tooltip description on hovering action menu', + tooltipPlacement: 'bottom', }; export const customIcon = (args: StoryArgs): TemplateResult => Template(args); diff --git a/packages/action-menu/stories/index.ts b/packages/action-menu/stories/index.ts index 6b75ecf549..0788f2db68 100644 --- a/packages/action-menu/stories/index.ts +++ b/packages/action-menu/stories/index.ts @@ -15,6 +15,7 @@ import '@spectrum-web-components/action-menu/sp-action-menu.js'; import '@spectrum-web-components/icon/sp-icon.js'; import '@spectrum-web-components/menu/sp-menu-divider.js'; import '@spectrum-web-components/menu/sp-menu-item.js'; +import '@spectrum-web-components/tooltip/sp-tooltip.js'; export const ActionMenuMarkup = ({ ariaLabel = 'More Actions', @@ -27,8 +28,8 @@ export const ActionMenuMarkup = ({ size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl', selects = '' as 'single', selected = false, - tooltip_description = 'Dummy tooltip description on hovering the menu', - tooltip_placement = 'bottom', + tooltipDescription = 'Dummy tooltip description on hovering action menu', + tooltipPlacement = 'bottom', } = {}): TemplateResult => { return html` Save Selection Make Work Path - ${tooltip_description - ? html`${tooltip_description} + ${tooltipDescription} + + ` : html``} `; From f62d23eb5037dd2051b60dd57e7cae0b3c4ae5fb Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Thu, 27 Jul 2023 11:26:53 +0530 Subject: [PATCH 07/19] feat(action-menu): added slot description --- packages/action-menu/src/ActionMenu.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index aa07e0da83..6428212105 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -29,6 +29,7 @@ import actionMenuStyles from './action-menu.css.js'; * @slot - menu items to be listed in the Action Menu * @slot icon - The icon to use for Action Menu * @slot label - The label to use on for the Action Menu + * @slot tooltip - Tooltip to use on for the Action menu * @attr selects - By default `sp-action-menu` does not manage a selection. If * you'd like for a selection to be held by the `sp-menu` that it presents in * its overlay, use `selects="single" to activate this functionality. From 2adbfb2d8f9fd228e4a83ded4ce44a32f717b760 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Thu, 27 Jul 2023 11:37:24 +0530 Subject: [PATCH 08/19] feat(action-menu): space fixed --- packages/action-menu/src/ActionMenu.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index 6428212105..c1e6643921 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -23,6 +23,7 @@ import '@spectrum-web-components/action-button/sp-action-button.js'; import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js'; import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js'; import actionMenuStyles from './action-menu.css.js'; + /** * @element sp-action-menu * From 083042e16a72d0ee5c92723e8c1f191ab8c67aa3 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Tue, 1 Aug 2023 21:51:33 +0530 Subject: [PATCH 09/19] chore(action-menu): hide slot when not needed --- packages/action-menu/src/ActionMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index c1e6643921..15d2bfbcc5 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -56,7 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { - + `, ]; } From dfa44f568789524b30972f5e86189be4a65cecd4 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 10:36:57 +0530 Subject: [PATCH 10/19] chore(action-menu): update comments --- packages/action-menu/README.md | 12 +++++++++--- packages/action-menu/src/ActionMenu.ts | 2 +- packages/action-menu/stories/action-menu.stories.ts | 8 -------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/action-menu/README.md b/packages/action-menu/README.md index b3c839ef24..de12bfd5aa 100644 --- a/packages/action-menu/README.md +++ b/packages/action-menu/README.md @@ -248,10 +248,16 @@ An `` parent will ensure that the internal `` 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 and giving various parameters (e.g. placement, content, etc) as needed. +Tooltip in action menu can be attached via adding and can be customized by using various parameters (e.g. placement, content, etc) as needed. ```html -'Content'` + + + Content + + Available shapes + Square + Triangle + Parallelogram ``` diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index 15d2bfbcc5..c1e6643921 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -56,7 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { - + `, ]; } diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index 99ac709fd7..84c81a8c6b 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -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` From 70a29ef1813c6e6aa012b14f25a4f7b8f0c991e5 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 11:16:16 +0530 Subject: [PATCH 11/19] chore(action-menu): update hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94b6b483bb..abf4fb8afa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ executors: parameters: current_golden_images_hash: type: string - default: 32141e5454098a538a4ce6921c9367e2f4922f67 + default: 971a6f9ac47cecdc34d13c218b9dcc8b4eab441d wireit_cache_name: type: string default: wireit From 5e2cb1d1a952781b95d8a9e5c12eb0ee92cc7b90 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 13:17:24 +0530 Subject: [PATCH 12/19] chore(action-menu): added hide slot --- packages/action-menu/src/ActionMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index c1e6643921..15d2bfbcc5 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -56,7 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { - + `, ]; } From c7be21d53675c0cc0750d1f7881d2eca86333454 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 13:37:09 +0530 Subject: [PATCH 13/19] chore(action-menu): comment added --- packages/action-menu/src/ActionMenu.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index 15d2bfbcc5..4851b443b8 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -49,6 +49,11 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { return this.slotHasContent; } + /** + * Remove ?hidden=${this.open} in tooltip slot once overlay issue for + * action menu is fixed. + * [Issue]: Tooltip opening when hovering on menu items. + */ protected override get buttonContent(): TemplateResult[] { return [ html` From 751936114299d6cadb90e51e83b5f6b395fe7738 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 18:53:49 +0530 Subject: [PATCH 14/19] chore(action-menu): removed hidden in slot --- packages/action-menu/src/ActionMenu.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/action-menu/src/ActionMenu.ts b/packages/action-menu/src/ActionMenu.ts index 4851b443b8..c1e6643921 100644 --- a/packages/action-menu/src/ActionMenu.ts +++ b/packages/action-menu/src/ActionMenu.ts @@ -49,11 +49,6 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { return this.slotHasContent; } - /** - * Remove ?hidden=${this.open} in tooltip slot once overlay issue for - * action menu is fixed. - * [Issue]: Tooltip opening when hovering on menu items. - */ protected override get buttonContent(): TemplateResult[] { return [ html` @@ -61,7 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { - + `, ]; } From 0daed21ab8929e17ec1d62354e4aae4f4f25ef67 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 19:34:32 +0530 Subject: [PATCH 15/19] chore(action-menu): remove visible label --- packages/action-menu/stories/action-menu.stories.ts | 12 ++++++++++-- packages/action-menu/stories/index.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index 84c81a8c6b..9004be3c95 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -63,7 +63,7 @@ export default { description: 'Tooltip description', table: { type: { summary: 'string' }, - defaultValue: { summary: 'none' }, + defaultValue: { summary: '' }, }, control: { type: 'text', @@ -116,7 +116,7 @@ export default { disabled: false, open: false, quiet: false, - tooltipDescription: 'Dummy tooltip description on hovering action menu', + tooltipDescription: '', tooltipPlacement: 'bottom', }, }; @@ -159,6 +159,14 @@ iconOnly.args = { visibleLabel: '', }; +export const tooltipDescriptionAndPlacement = ( + args: StoryArgs = {} +): TemplateResult => Template(args); +tooltipDescriptionAndPlacement.args = { + tooltipDescription: '', + tooltipPlacement: 'bottom', +}; + export const customIcon = (args: StoryArgs): TemplateResult => Template(args); customIcon.args = { customIcon: html` diff --git a/packages/action-menu/stories/index.ts b/packages/action-menu/stories/index.ts index 0788f2db68..d58192804d 100644 --- a/packages/action-menu/stories/index.ts +++ b/packages/action-menu/stories/index.ts @@ -28,7 +28,7 @@ export const ActionMenuMarkup = ({ size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl', selects = '' as 'single', selected = false, - tooltipDescription = 'Dummy tooltip description on hovering action menu', + tooltipDescription = '', tooltipPlacement = 'bottom', } = {}): TemplateResult => { return html` From eabefcfa2dce62330610e4ec94ffda8268049a81 Mon Sep 17 00:00:00 2001 From: Anish Ranjan Date: Wed, 2 Aug 2023 19:47:57 +0530 Subject: [PATCH 16/19] chore(action-menu): update golden hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index abf4fb8afa..b23129437b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ executors: parameters: current_golden_images_hash: type: string - default: 971a6f9ac47cecdc34d13c218b9dcc8b4eab441d + default: 0daed21ab8929e17ec1d62354e4aae4f4f25ef67 wireit_cache_name: type: string default: wireit From 0ed74a69eed08d6b68c1913c37feb81fe6dca260 Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Wed, 2 Aug 2023 11:00:49 -0400 Subject: [PATCH 17/19] chore: accept code review --- packages/action-menu/stories/action-menu.stories.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/action-menu/stories/action-menu.stories.ts b/packages/action-menu/stories/action-menu.stories.ts index 9004be3c95..9e5f24e21e 100644 --- a/packages/action-menu/stories/action-menu.stories.ts +++ b/packages/action-menu/stories/action-menu.stories.ts @@ -163,7 +163,8 @@ export const tooltipDescriptionAndPlacement = ( args: StoryArgs = {} ): TemplateResult => Template(args); tooltipDescriptionAndPlacement.args = { - tooltipDescription: '', + tooltipDescription: 'Your tooltip string here', + visibleLabel: '', tooltipPlacement: 'bottom', }; From cd53a8bef8c501a645314ee8e81cd1136c0e77e0 Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Wed, 2 Aug 2023 11:11:18 -0400 Subject: [PATCH 18/19] ci: update golden images hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b23129437b..bc0e28fda4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ executors: parameters: current_golden_images_hash: type: string - default: 0daed21ab8929e17ec1d62354e4aae4f4f25ef67 + default: [0ed74a69eed08d6b68c1913c37feb81fe6dca260](https://967c433261880f46b944fdaf1a4287b4--spectrum-web-components.netlify.app/review/#) wireit_cache_name: type: string default: wireit From 5b1f77ab7beb076937407cdd082a4f2c1b0e1120 Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Wed, 2 Aug 2023 11:12:30 -0400 Subject: [PATCH 19/19] ci: update golden images hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc0e28fda4..9bf0497046 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ executors: parameters: current_golden_images_hash: type: string - default: [0ed74a69eed08d6b68c1913c37feb81fe6dca260](https://967c433261880f46b944fdaf1a4287b4--spectrum-web-components.netlify.app/review/#) + default: 0ed74a69eed08d6b68c1913c37feb81fe6dca260 wireit_cache_name: type: string default: wireit