Skip to content

Commit f0fae60

Browse files
authored
fix(menu): disabled color for value text and add disabled stories (#2579)
- Updates two existing stories to include a disabled menu item with the Switch input. - Updates disabled styles so that the value area text also appears with the disabled content color when the menu item is disabled. Noticed when updating the stories and confirmed on newer design spec.
1 parent eac9b74 commit f0fae60

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

components/menu/index.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,8 @@ governing permissions and limitations under the License.
779779
background-color: transparent;
780780

781781
.spectrum-Menu-itemLabel,
782-
.spectrum-Menu-sectionHeading {
782+
.spectrum-Menu-sectionHeading,
783+
.spectrum-Menu-itemValue {
783784
color: var(--highcontrast-menu-item-color-disabled, var(--mod-menu-item-label-content-color-disabled, var(--spectrum-menu-item-label-content-color-disabled)));
784785
}
785786

@@ -797,7 +798,8 @@ governing permissions and limitations under the License.
797798
background-color: transparent;
798799

799800
.spectrum-Menu-itemLabel,
800-
.spectrum-Menu-sectionHeading {
801+
.spectrum-Menu-sectionHeading,
802+
.spectrum-Menu-itemValue {
801803
color: var(--highcontrast-menu-item-color-disabled, var(--mod-menu-item-label-content-color-disabled, var(--spectrum-menu-item-label-content-color-disabled)));
802804
}
803805

components/menu/stories/menu.stories.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ WithActions.args = {
328328
{
329329
label: "Subtract",
330330
},
331+
{
332+
label: "Example of a disabled menu item",
333+
isDisabled: true,
334+
},
331335
],
332336
};
333337

@@ -348,6 +352,11 @@ WithValueAndActions.args = {
348352
label: "Subtract",
349353
value: "Value"
350354
},
355+
{
356+
label: "Example of a disabled menu item",
357+
value: "Value",
358+
isDisabled: true,
359+
},
351360
],
352361
};
353362

components/menu/stories/template.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { html } from "lit";
22
import { classMap } from "lit/directives/class-map.js";
3-
import { styleMap } from "lit/directives/style-map.js";
43
import { ifDefined } from "lit/directives/if-defined.js";
4+
import { styleMap } from "lit/directives/style-map.js";
55
import { when } from "lit/directives/when.js";
66

77
import { Template as Checkbox } from "@spectrum-css/checkbox/stories/template.js";
@@ -109,6 +109,7 @@ export const MenuItem = ({
109109
size,
110110
isEmphasized: true,
111111
isChecked: isSelected,
112+
isDisabled,
112113
id: `menu-checkbox-${idx}`,
113114
customClasses: [
114115
`${rootClass}Checkbox`,
@@ -136,6 +137,7 @@ export const MenuItem = ({
136137
...globals,
137138
size,
138139
isChecked: isSelected,
140+
isDisabled,
139141
label: null,
140142
id: `menu-switch-${idx}`,
141143
customClasses: [

0 commit comments

Comments
 (0)