Skip to content

Commit

Permalink
ActionList: Checkbox inside disabled item should have not-allowed cus…
Browse files Browse the repository at this point in the history
…or (#3870)

* Add cursor not-allowed

* Create actionlist-disabled-item-checkbox.md

* test(vrt): update snapshots

* update snapshots!

* update missing snapshot

* new updated snapshots?

---------

Co-authored-by: siddharthkp <siddharthkp@users.noreply.github.com>
  • Loading branch information
siddharthkp and siddharthkp authored Nov 1, 2023
1 parent 33d302a commit 2c24d6a
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/smart-bugs-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/react": patch
---

ActionList: Checkbox inside a disabled item should have `not-allowed` cusor

<!-- Changed components: ActionList -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/ActionList/ActionList.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export const MultiSelect = () => {
selected={selectedIndices.includes(index)}
aria-checked={selectedIndices.includes(index)}
onSelect={() => handleSelect(index)}
disabled={index === 3 ? true : undefined}
>
<ActionList.LeadingVisual>
<TableIcon />
Expand Down
1 change: 1 addition & 0 deletions src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
'&[aria-disabled]': {
cursor: 'not-allowed',
'[data-component="ActionList.Checkbox"]': {
cursor: 'not-allowed',
bg: selected ? 'fg.muted' : 'var(--color-input-disabled-bg, rgba(175, 184, 193, 0.2))',
borderColor: selected ? 'fg.muted' : 'var(--color-input-disabled-bg, rgba(175, 184, 193, 0.2))',
},
Expand Down
8 changes: 8 additions & 0 deletions src/NavList/__snapshots__/NavList.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exports[`NavList renders a simple list 1`] = `
}
.c2[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -156,6 +157,7 @@ exports[`NavList renders a simple list 1`] = `
}
.c6[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -480,6 +482,7 @@ exports[`NavList renders with groups 1`] = `
}
.c6[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -566,6 +569,7 @@ exports[`NavList renders with groups 1`] = `
}
.c10[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -934,6 +938,7 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
}
.c11[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -1020,6 +1025,7 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
}
.c4[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -1381,6 +1387,7 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
}
.c11[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -1477,6 +1484,7 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
}
.c4[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down
6 changes: 6 additions & 0 deletions src/__tests__/__snapshots__/Autocomplete.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ exports[`snapshots renders a menu that contains an item to add to the menu 1`] =
}
.c3[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -1422,6 +1423,7 @@ exports[`snapshots renders a multiselect input 1`] = `
}
.c3[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -2131,6 +2133,7 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
}
.c3[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: #656d76;
border-color: #656d76;
}
Expand Down Expand Up @@ -2206,6 +2209,7 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
}
.c8[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -2857,6 +2861,7 @@ exports[`snapshots renders a single select input 1`] = `
}
.c3[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down Expand Up @@ -3307,6 +3312,7 @@ exports[`snapshots renders with a custom text input component 1`] = `
}
.c3[aria-disabled] [data-component="ActionList.Checkbox"] {
cursor: not-allowed;
background-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
border-color: var(--color-input-disabled-bg,rgba(175,184,193,0.2));
}
Expand Down

0 comments on commit 2c24d6a

Please sign in to comment.