Skip to content

Commit 22ccfc9

Browse files
committed
chore: apply code review feedback awesomeness
1 parent 75c284c commit 22ccfc9

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

components/actionmenu/stories/actionmenu.stories.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ export default {
7575
tags: ["migrated"],
7676
};
7777

78-
/**
79-
* Action menu allows users to access and execute various commands or tasks related to their current workflow. It's typically triggered from an action button by user interaction.
80-
*
81-
* Note that the accessibility roles are different for an action menu compared to a normal menu. The action menu is a combination of a menu, popover, and action button.
82-
*/
8378
export const Default = ActionMenuGroup.bind({});
8479
Default.args = {
8580
triggerArgs: {
@@ -130,6 +125,8 @@ Default.args = {
130125
* By default, the menu is opened by pressing the trigger element or activating it via the <kbd>Space</kbd> or <kbd>Enter</kbd> keys. However, there may be cases where the trigger should perform a separate action on press such as selection, and should only display the menu when long pressed. For this use-case, the menu will only be opened when pressing and holding the trigger or by using the <kbd>Option</kbd> (Alt on Windows) + <kbd>Down arrow</kbd>/<kbd>Up arrow</kbd> keys while focusing the trigger.
131126
*
132127
* This example illustrates the expected visuals and states of the action menu for a trigger with both long press and short press behaviors.
128+
*
129+
* Please note that the long press functionality is not implemented in this documentation and the example serves only as a visual reference.
133130
*/
134131
export const LongPress = Template.bind({});
135132
LongPress.args = {
@@ -165,7 +162,7 @@ LongPress.parameters = {
165162
};
166163

167164
/**
168-
* Action menus can be positioned in four locals relative to the trigger but <u>only one menu can be triggered at a single time</u>.
165+
* Action menus can be positioned in four locals relative to the trigger but <em>only one menu can be triggered at a single time</em>.
169166
*/
170167
export const PlacementOptions = (args, context) => ArgGrid({
171168
Template,

components/actionmenu/stories/template.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Template as Menu } from "@spectrum-css/menu/stories/template.js";
33
import { Template as Popover } from "@spectrum-css/popover/stories/template.js";
44
import { getRandomId } from "@spectrum-css/preview/decorators";
55

6+
import "../index.css";
7+
68
export const Template = (
79
{
810
rootClass = "spectrum-ActionMenu",

components/coachmark/stories/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const CoachContainer = (
5252
<div class="spectrum-CoachMark-header" style=${styleMap({
5353
"--mod-popover-width": "0px",
5454
"--mod-popover-height": "0px",
55-
"--mod-popover-wrapper-spacing": "0px",
55+
"--spectrum-popover-animation-distance": "0px",
5656
})}>
5757
<div class="spectrum-CoachMark-title">${title}</div>
5858
${when(

components/popover/stories/template.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Template = ({
2121
if (isOpen) {
2222
if (["top", "bottom"].some((e) => position.startsWith(e))) {
2323
customWrapperStyles["min-inline-size"] = "var(--spectrum-popover-width)";
24-
customWrapperStyles["min-block-size"] = "calc(var(--spectrum-popover-height) + var(--spectrum-popover-trigger-height, 0px) + var(--mod-popover-wrapper-spacing, var(--spectrum-spacing-100) * 2))";
24+
customWrapperStyles["min-block-size"] = "calc(var(--spectrum-popover-height) + var(--spectrum-popover-trigger-height, 0px) + var(--spectrum-popover-animation-distance, var(--spectrum-spacing-100) * 2))";
2525
}
2626
else {
2727
customWrapperStyles["min-inline-size"] = "calc(var(--spectrum-popover-width) + var(--spectrum-popover-trigger-width, 0px))";
@@ -95,10 +95,10 @@ export const Popover = ({
9595
if (trigger) {
9696
// Translate the popover to the correct position, keeping the default spacing between the trigger and the popover in mind.
9797
if (position.startsWith("top")) {
98-
popoverAlignment["transform"] = "translateY(calc(var(--spectrum-popover-trigger-height, 0px) * -1 - var(--spectrum-spacing-100)))";
98+
popoverAlignment["transform"] = "translateY(calc(var(--spectrum-popover-trigger-height, 0px) * -1 - var(--spectrum-popover-animation-distance, var(--spectrum-spacing-100))))";
9999
}
100100
else if (position.startsWith("bottom")) {
101-
popoverAlignment["transform"] = "translateY(calc(var(--spectrum-popover-trigger-height, 0px) + var(--spectrum-spacing-100)))";
101+
popoverAlignment["transform"] = "translateY(calc(var(--spectrum-popover-trigger-height, 0px) + var(--spectrum-popover-animation-distance, var(--spectrum-spacing-100))))";
102102
}
103103

104104
// Position the popover to the correct position at the correct side of the trigger.

0 commit comments

Comments
 (0)